-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
437 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
- [x] 视频播放器 | ||
- [x] 硬件加速 | ||
- [x] 在线更新 | ||
- [ ] 追番列表 | ||
- [x] 追番列表 | ||
- [ ] 番剧下载 | ||
- [ ] 番剧更新提醒 | ||
- [ ] 还有更多 (/・ω・\) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import 'dart:io'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:mobx/mobx.dart'; | ||
import 'package:oneanime/bean/anime/anime_info.dart'; | ||
import 'package:oneanime/request/list.dart'; | ||
import 'package:oneanime/request/video.dart'; | ||
import 'package:oneanime/pages/video/video_controller.dart'; | ||
import 'package:flutter_modular/flutter_modular.dart'; | ||
import 'package:hive/hive.dart'; | ||
import 'package:oneanime/utils/storage.dart'; | ||
import 'package:oneanime/pages/popular/popular_controller.dart'; | ||
import 'package:flutter_open_chinese_convert/flutter_open_chinese_convert.dart'; | ||
|
||
part 'follow_controller.g.dart'; | ||
|
||
class FollowController = _FollowController with _$FollowController; | ||
|
||
abstract class _FollowController with Store { | ||
final PopularController popularController = Modular.get<PopularController>(); | ||
late List<AnimeInfo> list; | ||
// List<AnimeInfo> list = GStorage.listCahce.values.toList(); | ||
|
||
@observable | ||
ObservableList<AnimeInfo> followList = ObservableList<AnimeInfo>.of([]); | ||
|
||
double scrollOffset = 0.0; | ||
bool isLoadingMore = true; | ||
String keyword = ''; | ||
|
||
Future getFollowList() async { | ||
followList.clear(); | ||
list = popularController.list; | ||
list.asMap().forEach((index, item) { | ||
if(item.follow == true) { | ||
followList.add(item); | ||
} | ||
}); | ||
} | ||
|
||
Future updateFollow(int link, bool status) async { | ||
list.asMap().forEach((index, item) { | ||
if(item.link == link) { | ||
list[index].follow = status; | ||
return; | ||
} | ||
}); | ||
updateData(); | ||
} | ||
|
||
Future updateData() async { | ||
await GStorage.listCahce.clear(); | ||
await GStorage.listCahce.addAll(list); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.