feat: refine AI navigation and accessibility recovery
This commit is contained in:
@@ -16,7 +16,10 @@ import 'package:miaoji_zhang/shared/services/session_store.dart';
|
||||
enum _ReportKind { weekly, monthly, yearly }
|
||||
|
||||
class ReportPage extends StatefulWidget {
|
||||
const ReportPage({super.key});
|
||||
final String? initialPeriod;
|
||||
final DateTime? initialAnchor;
|
||||
|
||||
const ReportPage({super.key, this.initialPeriod, this.initialAnchor});
|
||||
|
||||
@override
|
||||
State<ReportPage> createState() => _ReportPageState();
|
||||
@@ -33,6 +36,12 @@ class _ReportPageState extends State<ReportPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_anchor = widget.initialAnchor ?? ShanghaiTime.now;
|
||||
_kind = switch (widget.initialPeriod) {
|
||||
'week' => _ReportKind.weekly,
|
||||
'year' => _ReportKind.yearly,
|
||||
_ => _ReportKind.monthly,
|
||||
};
|
||||
PublicConfigApi.companionNotifier.addListener(_refreshCompanion);
|
||||
CurrentLedgerStore.instance.addListener(_load);
|
||||
unawaited(_load());
|
||||
|
||||
Reference in New Issue
Block a user