import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:zhiying_base_widget/pages/login_page/invite/bloc/bloc.dart';
import 'package:zhiying_base_widget/pages/login_page/invite/bloc/login_invite_repository.dart';
import 'package:zhiying_base_widget/pages/login_page/model/login_model.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

import 'model/login_invite_user.dart';

///
/// 邀请页面
///
class LoginInvitePage extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: false,
      backgroundColor: HexColor.fromHex('#FFFFFF'),
      body: BlocProvider(
        create: (_) => LoginInviteBloc(repostitory: LoginInviteRepostitory())..add(LoginInviteInitEvent()),
        child: LoginInvitePageContainer(),
      ),
    );
  }
}

///
/// 邀请
class LoginInvitePageContainer extends StatefulWidget {
  @override
  _LoginInvitePageContainerState createState() => _LoginInvitePageContainerState();
}

class _LoginInvitePageContainerState extends State<LoginInvitePageContainer> {

  @override
  Widget build(BuildContext context) {
    return BlocConsumer<LoginInviteBloc, LoginInviteState>(
      listener: (context, state) {},
      buildWhen: (previous, current) {
        return true;
      },
      builder: (context, state) {
        /// 骨架屏
        return Container();
      },
    );
  }

  /// 主视图
  Widget _getMainWidget(LoginModel model) {
    return Column(children: <Widget>[

    ],);
  }

  /// appBar
  Widget _getAppBar(LoginModel model) {}

  /// title
  Widget _getTitleWidget(LoginModel model) {}

  /// 邀请码输入框
  Widget _getInviteInputWidget(LoginModel model) {}

  /// 邀请人信息
  Widget _getInviteInfoWidget(LoginInviteUser model) {}

  /// 按钮
  Widget _getSubmitButtomWidget(LoginModel model) {}
}
