import 'package:flutter/cupertino.dart'; import 'package:get/get.dart'; import 'package:isekai_wiki/components/dummy_icon.dart'; import 'package:isekai_wiki/components/follow_scale.dart'; import 'package:isekai_wiki/components/isekai_nav_bar.dart'; import 'package:isekai_wiki/components/isekai_page_scaffold.dart'; import 'package:isekai_wiki/global.dart'; import 'package:isekai_wiki/reactive/reactive.dart'; import 'package:isekai_wiki/styles.dart'; class SettingsListController extends GetxController { VoidFutureCallback? onSelectionChange; } class SettingsList extends StatefulWidget { final String selected; final VoidFutureCallback? onSelectionChange; const SettingsList({super.key, this.selected = "", this.onSelectionChange}); @override State createState() { return _SettingsListState(); } } class _SettingsListState extends ReactiveState { var c = SettingsListController(); @override void receiveProps() { c.onSelectionChange = widget.onSelectionChange; } @override Widget render(BuildContext context) { return FollowTextScale( child: CupertinoListSection.insetGrouped( backgroundColor: Styles.themePageBackgroundColor, children: [ CupertinoListTile.notched( title: const Text('阅读设置'), leading: const DummyIcon( color: CupertinoColors.systemGrey, icon: CupertinoIcons.textformat, ), trailing: const CupertinoListTileChevron(), onTap: () {}, ), ], ), ); } } class SettingsListPage extends StatelessWidget { const SettingsListPage({super.key}); SliverChildListDelegate _buildSliverChildBuilderDelegate( BuildContext context) { return SliverChildListDelegate([ const SettingsList(), ]); } @override Widget build(BuildContext context) { return IsekaiPageScaffold( child: CustomScrollView( slivers: [ const IsekaiSliverNavigationBar( largeTitle: Text('设置'), ), SliverSafeArea( top: false, minimum: const EdgeInsets.only(top: 4), sliver: SliverList( delegate: _buildSliverChildBuilderDelegate(context), ), ) ], ), ); } }