Skip to content

Commit

Permalink
DEV UPDATE:Add member filter
Browse files Browse the repository at this point in the history
  • Loading branch information
misakajimmy committed Jan 14, 2023
1 parent f67a153 commit 5c76e1c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
13 changes: 9 additions & 4 deletions lib/routes/video/videoList.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:math';
import 'package:eoe_fans/common/Api.dart';
import 'package:eoe_fans/models/member.dart';
import 'package:eoe_fans/models/video.dart';
Expand All @@ -8,6 +9,7 @@ import 'package:eoe_fans/routes/video/videoMemberFilter.dart';
import 'package:eoe_fans/common/Global.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:flutter/material.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

class VideoList extends StatefulWidget {
const VideoList({Key? key, this.origin}) : super(key: key);
Expand All @@ -19,6 +21,8 @@ class VideoList extends StatefulWidget {
}

class _VideoListState extends State<VideoList> {
final RefreshController _refreshController =
RefreshController(initialRefresh: true);
late final bool? origin;

int _page = -1;
Expand All @@ -29,7 +33,7 @@ class _VideoListState extends State<VideoList> {

@override
void initState() {
print('object');
// print('object');
_getVideos();
super.initState();
}
Expand All @@ -56,16 +60,17 @@ class _VideoListState extends State<VideoList> {
});
}

_reloadVideos() async {
_reloadVideos({int? page}) async {
setState(() {
videoList = [];
_page = -1;
_getVideos();
_page = page ?? -1;
});
await _getVideos();
}

@override
Widget build(BuildContext context) {

var videos = videoList
.map((video) => StaggeredGridTile.count(
crossAxisCellCount: 2,
Expand Down
5 changes: 2 additions & 3 deletions lib/routes/video/videoPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ class _VideoPageState extends State<VideoPage> {
),
),
body: Container(
padding: const EdgeInsets.only(
left: 4, right: 4, top: 4),
child: const TabBarView(
padding: const EdgeInsets.only(left: 4, right: 4, top: 4),
child: const TabBarView(
children: [
VideoList(origin: false),
VideoList(origin: true),
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.1"
pull_to_refresh:
dependency: "direct main"
description:
name: pull_to_refresh
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
rxdart:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies:
flutter_staggered_grid_view: ^0.6.2
cached_network_image: ^3.2.3
hexcolor: ^3.0.1
pull_to_refresh: ^2.0.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 5c76e1c

Please sign in to comment.