import 'package:cs_resources/generated/assets.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/my_load_image.dart';

import '../../router/page/property_page_router.dart';
import './property_news_detail_vm.dart';

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

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

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final _vm = ref.read(propertyNewsDetailVmProvider.notifier);

    return Scaffold(
      appBar: AppBar(title: Text("新闻详情页面")),
      body: Column(
        children: [
          MyAssetImage(
            Assets.propertyIoan,
            width: 100,
            height: 100,
          ),
        ],
      ),
    );
  }
}
