You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.3 KiB
Dart

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<StatefulWidget> createState() {
return _SettingsListState();
}
}
class _SettingsListState extends ReactiveState<SettingsList> {
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>[
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: <Widget>[
const IsekaiSliverNavigationBar(
largeTitle: Text('设置'),
),
SliverSafeArea(
top: false,
minimum: const EdgeInsets.only(top: 4),
sliver: SliverList(
delegate: _buildSliverChildBuilderDelegate(context),
),
)
],
),
);
}
}