/*
 * @Author       : WuWei
 * @LastEditors: ChenYaJin
 * @Date         : 2022-01-19 16:44:36
 * @LastEditTime: 2023-05-25 11:51:23
 * @Description  : Do not edit
 */
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:service_package/src/models/cascade_house.dart';
import 'package:wisdom_cli/wisdom_cli.dart';
import '../../assets.gen.dart';
import 'store.dart';
part 'components/form.dart';
part 'components/tabbar.dart';

class IndexPageView extends StatelessWidget {
  const IndexPageView({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final style = WTheme.of(context);
    final colorScheme = style.colorScheme;
    IndexPageStore store = Provider.of(context, listen: true);
    return Theme(
      data: Theme.of(context).copyWith(
        inputDecorationTheme: InputDecorationTheme(
          border: InputBorder.none,
          isCollapsed: false,
          isDense: false,
          contentPadding: EdgeInsets.symmetric(vertical: 11.pt),
        ),
      ),
      child: Scaffold(
        appBar: WAppBar(
          iconTheme: IconThemeData(
            color: colorScheme.mainTitle,
            size: 19.pt,
          ),
          backgroundColor: Colors.white,
          brightness: Brightness.light,
          title: WisText('${store.arguments.appBarTitle ?? '客服工作台'}',
              size: 19.pt,
              weight: FontWeight.w600,
              color: colorScheme.mainTitle),
        ),
        body: Wisdom.column(
          children: [
            _TabBarComponent(),
            _FormComponent().asExpanded(),
            SizedBox(
              height: 60.pt,
            ),
          ],
        ),
        bottomSheet: BottomAppBar(
          color: Colors.white,
          padding: EdgeInsets.all(0),
          child: Wisdom.row(
            height: 44.pt,
            color: Colors.white,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            // margin: EdgeInsets.symmetric(horizontal: 10.pt,vertical: 8.pt,),
            children: [
              WLoadingButton(
                onPressed: () => store.submit(),
                margin: EdgeInsets.fromLTRB(15.pt, 15.pt, 15.pt, 15.pt),
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.circular(25.pt),
                ),
                height: 44.pt,
                child: WisText('确认登记'),
              ).asExpanded(),
            ],
          ),
        ),
      ),
    );
  }
}
