if_need_create_store.dart 4.33 KB
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';

class IfNeedCreateStore extends StatefulWidget {
  IfNeedCreateStore({Key key}) : super(key: key);

  @override
  _IfNeedCreateStoreState createState() => _IfNeedCreateStoreState();
}

class _IfNeedCreateStoreState extends State<IfNeedCreateStore> {
  ScrollController _controller = ScrollController();
  bool noStore = false;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        backgroundColor: Colors.white,
        appBar: SystemAppBar(
          '',
          // leftTitle: '上一步',
          onTap: () {
            Navigator.pop(context);
          },
        ),
        body: Container(
            width: double.infinity,
            padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
            child: Column(crossAxisAlignment: CrossAxisAlignment.center,
                // mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  VEmptyView(80),
                  Image.asset(
                    noStore
                        ? Utils.getImgPath('not_member')
                        : Utils.getImgPath('is_member'),
                    width: ScreenUtil().setWidth(120),
                    height: ScreenUtil().setWidth(120),
                  ),
                  VEmptyView(60),
                  Text(
                    noStore ? '您还没有绑定任何店铺' : '您已经是“xxxxx”的员工',
                    style: TextStyle(
                        fontSize: ScreenUtil().setSp(32),
                        color: MyColours.color_333333,
                        fontWeight: FontWeight.bold),
                  ),
                  VEmptyView(172),
                  InkWell(
                      onTap: () {
                        if (noStore) {
                          //跳转至新建店铺流程
                          NavigatorUtil.goEnterStoreNamePage(context);
                        } else {
                          //进入店铺

                        }
                      },
                      child: Container(
                        width: double.infinity,
                        padding: EdgeInsets.symmetric(
                            horizontal: ScreenUtil().setWidth(40),
                            vertical: ScreenUtil().setWidth(18)),
                        decoration: BoxDecoration(
                            color: MyColours.color_24A4A8,
                            borderRadius: BorderRadius.circular(
                                ScreenUtil().setWidth(10))),
                        child: Text(
                          noStore ? '创建店铺' : '进入“xxxxxxx”',
                          textAlign: TextAlign.center,
                          maxLines: 1,
                          overflow: TextOverflow.ellipsis,
                          style: TextStyle(
                              color: MyColours.color_ffffff,
                              fontSize: ScreenUtil().setSp(34)),
                        ),
                      )),
                  noStore
                      ? Container()
                      : Container(
                          margin:
                              EdgeInsets.only(top: ScreenUtil().setWidth(40)),
                          padding: EdgeInsets.symmetric(
                            horizontal: ScreenUtil().setWidth(30),
                          ),
                          child: InkWell(
                            onTap: () {
                              //跳转至新建店铺流程
                              NavigatorUtil.goEnterStoreNamePage(context);
                            },
                            child: Text(
                              '不是我,我要重新建店',
                              textAlign: TextAlign.center,
                              style: TextStyle(
                                  color: MyColours.color_199095,
                                  fontSize: ScreenUtil().setSp(30)),
                            ),
                          )),
                ])));
  }
}