-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
27093c0
commit a3465c8
Showing
11 changed files
with
222 additions
and
77 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
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,57 @@ | ||
import 'package:anicross/providers/info_models.dart'; | ||
import 'package:anicross/widgets/grid.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:isar/isar.dart'; | ||
|
||
class LaterPage extends StatefulWidget { | ||
const LaterPage({super.key}); | ||
|
||
@override | ||
State createState() => LaterPageState(); | ||
} | ||
|
||
class LaterPageState extends State<LaterPage> { | ||
List<AniData> animeData = []; | ||
List<AniData> mangaData = []; | ||
final Isar isar = Isar.getInstance() ?? | ||
Isar.openSync( | ||
[AniDataSchema], | ||
); | ||
late final dataChange = isar.aniDatas.watchLazy(fireImmediately: true); | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
} | ||
|
||
void updateData() { | ||
animeData = isar.aniDatas.filter().typeEqualTo("anime").findAllSync(); | ||
mangaData = isar.aniDatas.filter().typeEqualTo("manga").findAllSync(); | ||
} | ||
|
||
@override | ||
Widget build(context) { | ||
return StreamBuilder( | ||
stream: dataChange, | ||
builder: (context, snap) { | ||
updateData(); | ||
return CustomScrollView( | ||
slivers: [ | ||
Grid( | ||
data: animeData, | ||
paginate: () {}, | ||
keep: false, | ||
length: animeData.length, | ||
), | ||
Grid( | ||
data: mangaData, | ||
paginate: () {}, | ||
keep: false, | ||
length: mangaData.length, | ||
), | ||
], | ||
); | ||
}, | ||
); | ||
} | ||
} |
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
Oops, something went wrong.