feat: select school terms and smooth refractive Dock motion
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user