payment_page.dart 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import 'package:cs_resources/theme/theme_config.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:auto_route/auto_route.dart';
  4. import 'package:flutter/services.dart';
  5. import 'package:hooks_riverpod/hooks_riverpod.dart';
  6. import 'package:router/ext/auto_router_extensions.dart';
  7. import 'package:widgets/my_appbar.dart';
  8. import '../../../router/page/payment_page_router.dart';
  9. import '../../payment/vm/payment_view_model.dart';
  10. @RoutePage()
  11. class PaymentPage extends HookConsumerWidget {
  12. const PaymentPage({Key? key}) : super(key: key);
  13. //启动当前页面
  14. static void startInstance({BuildContext? context}) {
  15. if (context != null) {
  16. context.router.push(const PaymentPageRoute());
  17. } else {
  18. appRouter.push(const PaymentPageRoute());
  19. }
  20. }
  21. @override
  22. Widget build(BuildContext context, WidgetRef ref) {
  23. final _viewModel = ref.read(paymentViewModelProvider.notifier);
  24. return Scaffold(
  25. // appBar: MyAppBar.appBar(context, "Payment", systemUiOverlayStyle: ThemeConfig.systemUiOverlayStyleLightThemeBlack),
  26. appBar: MyAppBar.searchAppBar(context, systemUiOverlayStyle: ThemeConfig.systemUiOverlayStyleLightThemeBlack),
  27. body: Container(
  28. width: double.infinity,
  29. child: Column(
  30. crossAxisAlignment: CrossAxisAlignment.center,
  31. children: [
  32. MyAppBar.titleBar(context, "Test Title"),
  33. Text("支付的主页面"),
  34. MyAppBar.searchTitleBar(context),
  35. ],
  36. ),
  37. ),
  38. );
  39. }
  40. }