Profile_edit_page.dart 1002 B

123456789101112131415161718192021222324252627282930313233
  1. import 'package:cpt_profile/modules/profile_edit/profile_edit_view_model.dart';
  2. import 'package:cpt_profile/router/page/profile_page_router.dart';
  3. import 'package:flutter/material.dart';
  4. import 'package:auto_route/auto_route.dart';
  5. import 'package:hooks_riverpod/hooks_riverpod.dart';
  6. import 'package:router/ext/auto_router_extensions.dart';
  7. @RoutePage()
  8. class ProfileEditPage extends HookConsumerWidget {
  9. const ProfileEditPage({Key? key}) : super(key: key);
  10. //启动当前页面
  11. static void startInstance({BuildContext? context}) {
  12. if (context != null) {
  13. context.router.push(const ProfileEditPageRoute());
  14. } else {
  15. appRouter.push(const ProfileEditPageRoute());
  16. }
  17. }
  18. @override
  19. Widget build(BuildContext context, WidgetRef ref) {
  20. final _viewModel = ref.watch(profileEditViewModelProvider.notifier);
  21. return Scaffold(
  22. appBar: AppBar(title: Text("Profile Edit Page")),
  23. body: Center(
  24. child: Text("Profile Edit Page"),
  25. ),
  26. );
  27. }
  28. }