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.

58 lines
1.5 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/reactive/reactive.dart';
import 'package:isekai_wiki/styles.dart';
class ViewSettingsController extends GetxController {
var fontSizeDouble = (14.0).obs;
}
class ViewSettings extends StatefulWidget {
const ViewSettings({super.key});
@override
State<StatefulWidget> createState() => _ViewSettingsState();
}
class _ViewSettingsState extends ReactiveState<ViewSettings> {
ViewSettingsController c = ViewSettingsController();
@override
void initState() {
super.initState();
Get.put(c);
}
@override
void dispose() {
super.dispose();
Get.delete<ViewSettingsController>();
}
@override
Widget render(BuildContext context) {
return FollowTextScale(
child: CupertinoListSection.insetGrouped(
backgroundColor: Styles.themePageBackgroundColor,
children: <CupertinoListTile>[
CupertinoListTile.notched(
title: const Text('字体大小'),
additionalInfo: Obx(
() => CupertinoSlider(
onChanged: (double value) {
c.fontSizeDouble.value = value;
},
value: c.fontSizeDouble.value,
),
),
trailing: const CupertinoListTileChevron(),
onTap: () {},
),
],
),
);
}
}