import 'package:fis_ui/index.dart';
import 'package:flutter/material.dart';
import 'package:flyinsono/architecture/define.dart';
import 'package:flyinsono/views/wechat_mini_program/wx_public_widgets/wx_header.dart';
import 'package:flyinsono/views/wechat_mini_program/wx_public_widgets/wx_screen_direction_lock.dart';
import '../wx_public_widgets/wx_footer.dart';
import 'index.dart';
import 'widgets/widgets.dart';

class MiniProgramHomePage extends FisView<WxHomeController> {
  const MiniProgramHomePage({Key? key}) : super(key: key);

  // 主视图
  FWidget _buildView() {
    return FColumn(
      children: [
        WxHeader(),
        FContainer(
          margin: EdgeInsets.all(20),
          padding: EdgeInsets.all(20),
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(10),
          ),
          child: MenuButtons(),
        ),
        FExpanded(child: FContainer()),
        WxFooter(),
      ],
    );
  }

  @override
  FWidget build(BuildContext context) {
    return FisBuilder<WxHomeController>(
      builder: (_) {
        return WxScreenDirectionLock(
          direction: ScreenDirection.vertical,
          page: Scaffold(
            backgroundColor: Color.fromARGB(255, 241, 241, 241),
            body: SafeArea(
              child: _buildView(),
            ),
          ),
        );
      },
    );
  }
}
