import 'package:cs_resources/theme/theme_config.dart';
import 'package:flutter/material.dart';
import 'package:auto_route/auto_route.dart';
import 'package:flutter/services.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:router/ext/auto_router_extensions.dart';
import 'package:widgets/my_appbar.dart';

import '../../../router/page/payment_page_router.dart';
import '../../payment/vm/payment_view_model.dart';

@RoutePage()
class PaymentPage extends HookConsumerWidget {
  const PaymentPage({Key? key}) : super(key: key);

  //启动当前页面
  static void startInstance({BuildContext? context}) {
    if (context != null) {
      context.router.push(const PaymentPageRoute());
    } else {
      appRouter.push(const PaymentPageRoute());
    }
  }

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final _viewModel = ref.read(paymentViewModelProvider.notifier);
    return Scaffold(
      // appBar: MyAppBar.appBar(context, "Payment", systemUiOverlayStyle: ThemeConfig.systemUiOverlayStyleLightThemeBlack),
      appBar: MyAppBar.searchAppBar(context, systemUiOverlayStyle: ThemeConfig.systemUiOverlayStyleLightThemeBlack),
      body: Container(
        width: double.infinity,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            MyAppBar.titleBar(context, "Test Title"),
            Text("支付的主页面"),
            MyAppBar.searchTitleBar(context),
          ],
        ),
      ),
    );
  }
}
