import 'package:cs_resources/generated/l10n.dart'; import 'package:cs_resources/theme/app_colors_theme.dart'; import 'package:flutter/material.dart'; import 'package:auto_route/auto_route.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:router/ext/auto_router_extensions.dart'; import 'package:widgets/ext/ex_widget.dart'; import 'package:widgets/my_button.dart'; import '../../router/page/form_page_router.dart'; import 'vm/apply_view_model.dart'; @RoutePage() class NoteManagementPage extends HookConsumerWidget { const NoteManagementPage({Key? key}) : super(key: key); //启动当前页面 static void startInstance({BuildContext? context}) { if (context != null) { context.router.push(const NoteManagementPageRoute()); } else { appRouter.push(const NoteManagementPageRoute()); } } @override Widget build(BuildContext context, WidgetRef ref) { final viewModel = ref.watch(applyViewModelProvider.notifier); final state = ref.watch(applyViewModelProvider); return WillPopScope( child: Scaffold( appBar: AppBar(title: Text("NoteManagementPage")), body: Column( children: [ Text("NoteManagementPage").expanded(), //底部按钮 MyButton( onPressed: viewModel.gotoNextPage, text: S.current.next, textColor: Colors.white, backgroundColor: context.appColors.btnBgDefault, fontWeight: FontWeight.w500, type: ClickType.throttle, fontSize: 16, minHeight: 50, radius: 0, ), ], )), onWillPop: () async{ viewModel.handlePopAction(); return true; }); } }