mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
novel
This commit is contained in:
46
lib/pages/novel_recommendation_page.dart
Normal file
46
lib/pages/novel_recommendation_page.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
import 'package:pixes/components/grid.dart';
|
||||
import 'package:pixes/components/loading.dart';
|
||||
import 'package:pixes/components/novel.dart';
|
||||
import 'package:pixes/components/title_bar.dart';
|
||||
import 'package:pixes/foundation/app.dart';
|
||||
import 'package:pixes/network/network.dart';
|
||||
import 'package:pixes/utils/translation.dart';
|
||||
|
||||
class NovelRecommendationPage extends StatefulWidget {
|
||||
const NovelRecommendationPage({super.key});
|
||||
|
||||
@override
|
||||
State<NovelRecommendationPage> createState() =>
|
||||
_NovelRecommendationPageState();
|
||||
}
|
||||
|
||||
class _NovelRecommendationPageState
|
||||
extends MultiPageLoadingState<NovelRecommendationPage, Novel> {
|
||||
@override
|
||||
Widget buildContent(BuildContext context, List<Novel> data) {
|
||||
return Column(
|
||||
children: [
|
||||
TitleBar(title: "Recommendation".tl),
|
||||
Expanded(
|
||||
child: GridViewWithFixedItemHeight(
|
||||
itemCount: data.length,
|
||||
itemHeight: 164,
|
||||
minCrossAxisExtent: 400,
|
||||
builder: (context, index) {
|
||||
if (index == data.length - 1) {
|
||||
nextPage();
|
||||
}
|
||||
return NovelWidget(data[index]);
|
||||
},
|
||||
).paddingHorizontal(8),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Res<List<Novel>>> loadData(int page) {
|
||||
return Network().getRecommendNovels();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user