feat: select school terms and smooth refractive Dock motion

This commit is contained in:
Codex
2026-10-13 19:08:36 +08:00
parent 3e2d8864af
commit 50fcc70e8e
33 changed files with 1245 additions and 94 deletions
+16 -1
View File
@@ -8,8 +8,13 @@ import '../../domain/semester.dart';
import '../../services/notification_service.dart';
class SettingsPage extends StatefulWidget {
const SettingsPage({super.key, required this.controller});
const SettingsPage({
super.key,
required this.controller,
this.focusSemester = false,
});
final AppController controller;
final bool focusSemester;
@override
State<SettingsPage> createState() => _SettingsPageState();
}
@@ -20,6 +25,7 @@ class _SettingsPageState extends State<SettingsPage> {
double? _courseHeightDraft;
bool _savingHeight = false;
String? _weeksError, _dateError;
final _scroll = ScrollController();
@override
void initState() {
super.initState();
@@ -27,11 +33,19 @@ class _SettingsPageState extends State<SettingsPage> {
_weeks = TextEditingController(
text: '${widget.controller.snapshot.settings.semester?.totalWeeks ?? 20}',
);
if (widget.focusSemester) {
WidgetsBinding.instance.addPostFrameCallback((_) {
if (mounted && _scroll.hasClients) {
_scroll.jumpTo(_scroll.position.maxScrollExtent);
}
});
}
}
@override
void dispose() {
_weeks.dispose();
_scroll.dispose();
super.dispose();
}
@@ -132,6 +146,7 @@ class _SettingsPageState extends State<SettingsPage> {
),
),
body: ListView(
controller: _scroll,
padding: const EdgeInsets.fromLTRB(20, 12, 20, 40),
children: [
if (c.isDemo)