import '/backend/api_requests/api_calls.dart';
import '/components/alert_box_custom_widget.dart';
import '/components/appbar_widget.dart';
import '/components/emptylist_widget.dart';
import '/components/nav_bar1_widget.dart';
import '/components/no_permission_widget.dart';
import '/components/permission_list_view_widget.dart';
import '/flutterlib/flutter_button_tabbar.dart';
import '/flutterlib/flutter_theme.dart';
import '/flutterlib/flutter_util.dart';
import '/flutterlib/flutter_widgets.dart';
import '/flutterlib/custom_functions.dart' as functions;
import 'dart:async';
import 'package:aligned_dialog/aligned_dialog.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import 'user_model.dart';
export 'user_model.dart';

class UserWidget extends StatefulWidget {
  const UserWidget({Key? key}) : super(key: key);

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

class _UserWidgetState extends State<UserWidget> with TickerProviderStateMixin {
  late UserModel _model;

  final scaffoldKey = GlobalKey<ScaffoldState>();

  @override
  void initState() {
    super.initState();
    _model = createModel(context, () => UserModel());

    // On page load action.
    SchedulerBinding.instance.addPostFrameCallback((_) async {
      _model.apiResult16 =
          await NumstationGroup.checkRoleHasPermissionCall.call(
        token: FFAppState().token,
        roleId: FFAppState().roleID,
        permissionId: 16,
      );
      if ((_model.apiResult16?.succeeded ?? true)) {
        setState(() {
          _model.checkPermission16 = getJsonField(
            (_model.apiResult16?.jsonBody ?? ''),
            r'''$.success''',
          );
        });
      }
      _model.apiResult21 =
          await NumstationGroup.checkRoleHasPermissionCall.call(
        token: FFAppState().token,
        roleId: FFAppState().roleID,
        permissionId: 21,
      );
      if ((_model.apiResult21?.succeeded ?? true)) {
        setState(() {
          _model.checkPermission21 = getJsonField(
            (_model.apiResult21?.jsonBody ?? ''),
            r'''$.success''',
          );
        });
      }
      _model.apiResult22 =
          await NumstationGroup.checkRoleHasPermissionCall.call(
        token: FFAppState().token,
        roleId: FFAppState().roleID,
        permissionId: 22,
      );
      if ((_model.apiResult22?.succeeded ?? true)) {
        setState(() {
          _model.checkPermission22 = getJsonField(
            (_model.apiResult22?.jsonBody ?? ''),
            r'''$.success''',
          );
        });
      }
      _model.apiResult23 =
          await NumstationGroup.checkRoleHasPermissionCall.call(
        token: FFAppState().token,
        roleId: FFAppState().roleID,
        permissionId: 23,
      );
      if ((_model.apiResult23?.succeeded ?? true)) {
        setState(() {
          _model.checkPermission23 = getJsonField(
            (_model.apiResult23?.jsonBody ?? ''),
            r'''$.success''',
          );
        });
      }
      _model.apiResult24 =
          await NumstationGroup.checkRoleHasPermissionCall.call(
        token: FFAppState().token,
        roleId: FFAppState().roleID,
        permissionId: 24,
      );
      if ((_model.apiResult24?.succeeded ?? true)) {
        setState(() {
          _model.checkPermission24 = getJsonField(
            (_model.apiResult24?.jsonBody ?? ''),
            r'''$.success''',
          );
        });
      }
      setState(() => _model.apiRequestCompleter2 = null);
      await _model.waitForApiRequestCompleted2();
      setState(() => _model.apiRequestCompleter1 = null);
      await _model.waitForApiRequestCompleted1();
    });

    _model.tabBarController = TabController(
      vsync: this,
      length: 3,
      initialIndex: 0,
    )..addListener(() => setState(() {}));
  }

  @override
  void dispose() {
    _model.dispose();

    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    if (isiOS) {
      SystemChrome.setSystemUIOverlayStyle(
        SystemUiOverlayStyle(
          statusBarBrightness: Theme.of(context).brightness,
          systemStatusBarContrastEnforced: true,
        ),
      );
    }

    context.watch<FFAppState>();

    return GestureDetector(
      onTap: () => _model.unfocusNode.canRequestFocus
          ? FocusScope.of(context).requestFocus(_model.unfocusNode)
          : FocusScope.of(context).unfocus(),
      child: Scaffold(
        key: scaffoldKey,
        backgroundColor: Color(0xFFEBEBE4),
        drawer: Container(
          width: 180.0,
          child: Drawer(
            elevation: 16.0,
            child: Container(
              width: 100.0,
              height: 100.0,
              decoration: BoxDecoration(
                color: Color(0xFF009B9A),
              ),
              child: Column(
                mainAxisSize: MainAxisSize.max,
                children: [
                  Padding(
                    padding:
                        EdgeInsetsDirectional.fromSTEB(0.0, 80.0, 0.0, 0.0),
                    child: Row(
                      mainAxisSize: MainAxisSize.max,
                      children: [
                        Container(
                          width: 180.0,
                          height: 61.0,
                          decoration: BoxDecoration(
                            color: Color(0xFF009B9A),
                          ),
                          child: InkWell(
                            splashColor: Colors.transparent,
                            focusColor: Colors.transparent,
                            hoverColor: Colors.transparent,
                            highlightColor: Colors.transparent,
                            onTap: () async {
                              context.pushNamed('account');
                            },
                            child: Row(
                              mainAxisSize: MainAxisSize.max,
                              mainAxisAlignment: MainAxisAlignment.start,
                              children: [
                                Padding(
                                  padding: EdgeInsetsDirectional.fromSTEB(
                                      15.0, 8.0, 0.0, 0.0),
                                  child: Container(
                                    width: 40.0,
                                    height: 40.0,
                                    decoration: BoxDecoration(
                                      color: FlutterTheme.of(context)
                                          .secondaryBackground,
                                      shape: BoxShape.circle,
                                    ),
                                    child: Align(
                                      alignment: AlignmentDirectional(0.0, 0.0),
                                      child: ClipRRect(
                                        borderRadius:
                                            BorderRadius.circular(8.0),
                                        child: SvgPicture.asset(
                                          'assets/images/company.svg',
                                          width: 30.0,
                                          height: 30.0,
                                          fit: BoxFit.contain,
                                        ),
                                      ),
                                    ),
                                  ),
                                ),
                                Padding(
                                  padding: EdgeInsetsDirectional.fromSTEB(
                                      8.0, 8.0, 0.0, 0.0),
                                  child: Text(
                                    FFLocalizations.of(context).getText(
                                      'y5lc8tus' /* ABC Ltd */,
                                    ),
                                    style: FlutterTheme.of(context)
                                        .bodyMedium
                                        .override(
                                          fontFamily: 'Readex Pro',
                                          color: Colors.white,
                                          fontSize: 16.0,
                                        ),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ),
                      ],
                    ),
                  ),
                  Container(
                    width: 180.0,
                    height: 61.0,
                    decoration: BoxDecoration(
                      color: Color(0xFF009B9A),
                    ),
                    child: InkWell(
                      splashColor: Colors.transparent,
                      focusColor: Colors.transparent,
                      hoverColor: Colors.transparent,
                      highlightColor: Colors.transparent,
                      onTap: () async {
                        context.pushNamed('account1');
                      },
                      child: Row(
                        mainAxisSize: MainAxisSize.max,
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: [
                          ClipRRect(
                            borderRadius: BorderRadius.circular(8.0),
                            child: SvgPicture.asset(
                              'assets/images/Group_2640.svg',
                              width: 0.0,
                              height: 0.0,
                              fit: BoxFit.contain,
                            ),
                          ),
                          Align(
                            alignment: AlignmentDirectional(0.0, 0.0),
                            child: Padding(
                              padding: EdgeInsetsDirectional.fromSTEB(
                                  5.0, 0.0, 0.0, 0.0),
                              child: ClipRRect(
                                borderRadius: BorderRadius.circular(8.0),
                                child: Image.asset(
                                  'assets/images/account.png',
                                  width: 50.0,
                                  height: 50.0,
                                  fit: BoxFit.cover,
                                ),
                              ),
                            ),
                          ),
                          Padding(
                            padding: EdgeInsetsDirectional.fromSTEB(
                                8.0, 0.0, 0.0, 0.0),
                            child: Text(
                              FFLocalizations.of(context).getText(
                                'dsluautr' /* Account */,
                              ),
                              style: FlutterTheme.of(context)
                                  .bodyMedium
                                  .override(
                                    fontFamily: 'Readex Pro',
                                    color: Colors.white,
                                    fontSize: 16.0,
                                  ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Container(
                    width: 180.0,
                    height: 61.0,
                    decoration: BoxDecoration(
                      color: Color(0xFF009B9A),
                    ),
                    child: InkWell(
                      splashColor: Colors.transparent,
                      focusColor: Colors.transparent,
                      hoverColor: Colors.transparent,
                      highlightColor: Colors.transparent,
                      onTap: () async {
                        context.pushNamed('tnc');
                      },
                      child: Row(
                        mainAxisSize: MainAxisSize.max,
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: [
                          ClipRRect(
                            borderRadius: BorderRadius.circular(8.0),
                            child: SvgPicture.asset(
                              'assets/images/document.svg',
                              width: 0.0,
                              height: 0.0,
                              fit: BoxFit.contain,
                            ),
                          ),
                          Align(
                            alignment: AlignmentDirectional(0.0, 0.0),
                            child: Padding(
                              padding: EdgeInsetsDirectional.fromSTEB(
                                  16.0, 0.0, 0.0, 0.0),
                              child: ClipRRect(
                                borderRadius: BorderRadius.circular(8.0),
                                child: SvgPicture.asset(
                                  'assets/images/tnc.svg',
                                  width: 30.0,
                                  height: 30.0,
                                  fit: BoxFit.cover,
                                ),
                              ),
                            ),
                          ),
                          Padding(
                            padding: EdgeInsetsDirectional.fromSTEB(
                                17.0, 0.0, 0.0, 0.0),
                            child: Text(
                              FFLocalizations.of(context).getText(
                                'ou0tju7x' /* T&C */,
                              ),
                              style: FlutterTheme.of(context)
                                  .bodyMedium
                                  .override(
                                    fontFamily: 'Readex Pro',
                                    color: Colors.white,
                                    fontSize: 16.0,
                                  ),
                            ),
                          ),
                          ClipRRect(
                            borderRadius: BorderRadius.circular(8.0),
                            child: SvgPicture.asset(
                              'assets/images/Group_2640.svg',
                              width: 0.0,
                              height: 0.0,
                              fit: BoxFit.fitHeight,
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Container(
                    width: 180.0,
                    height: 61.0,
                    decoration: BoxDecoration(
                      color: Color(0xFF009B9A),
                    ),
                    child: InkWell(
                      splashColor: Colors.transparent,
                      focusColor: Colors.transparent,
                      hoverColor: Colors.transparent,
                      highlightColor: Colors.transparent,
                      onTap: () async {
                        context.pushNamed('policy');
                      },
                      child: Row(
                        mainAxisSize: MainAxisSize.max,
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: [
                          ClipRRect(
                            borderRadius: BorderRadius.circular(8.0),
                            child: SvgPicture.asset(
                              'assets/images/Group_2640.svg',
                              width: 0.0,
                              height: 0.0,
                              fit: BoxFit.contain,
                            ),
                          ),
                          Align(
                            alignment: AlignmentDirectional(0.0, 0.0),
                            child: Padding(
                              padding: EdgeInsetsDirectional.fromSTEB(
                                  16.0, 0.0, 0.0, 0.0),
                              child: ClipRRect(
                                borderRadius: BorderRadius.circular(8.0),
                                child: SvgPicture.asset(
                                  'assets/images/pp.svg',
                                  width: 30.0,
                                  height: 30.0,
                                  fit: BoxFit.cover,
                                ),
                              ),
                            ),
                          ),
                          Padding(
                            padding: EdgeInsetsDirectional.fromSTEB(
                                16.0, 0.0, 0.0, 0.0),
                            child: Text(
                              FFLocalizations.of(context).getText(
                                '1ygk5i6z' /* Privacy
Policy */
                                ,
                              ),
                              style: FlutterTheme.of(context)
                                  .bodyMedium
                                  .override(
                                    fontFamily: 'Readex Pro',
                                    color: Colors.white,
                                    fontSize: 16.0,
                                  ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Container(
                    width: 180.0,
                    height: 61.0,
                    decoration: BoxDecoration(
                      color: Color(0xFF009B9A),
                    ),
                    child: InkWell(
                      splashColor: Colors.transparent,
                      focusColor: Colors.transparent,
                      hoverColor: Colors.transparent,
                      highlightColor: Colors.transparent,
                      onTap: () async {
                        context.pushNamed('language');
                      },
                      child: Row(
                        mainAxisSize: MainAxisSize.max,
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: [
                          ClipRRect(
                            borderRadius: BorderRadius.circular(8.0),
                            child: SvgPicture.asset(
                              'assets/images/Group_2640.svg',
                              width: 0.0,
                              height: 0.0,
                              fit: BoxFit.contain,
                            ),
                          ),
                          Align(
                            alignment: AlignmentDirectional(0.0, 0.0),
                            child: Padding(
                              padding: EdgeInsetsDirectional.fromSTEB(
                                  16.0, 0.0, 0.0, 0.0),
                              child: ClipRRect(
                                borderRadius: BorderRadius.circular(8.0),
                                child: SvgPicture.asset(
                                  'assets/images/language.svg',
                                  width: 30.0,
                                  height: 30.0,
                                  fit: BoxFit.contain,
                                ),
                              ),
                            ),
                          ),
                          Padding(
                            padding: EdgeInsetsDirectional.fromSTEB(
                                15.0, 0.0, 0.0, 0.0),
                            child: Text(
                              FFLocalizations.of(context).getText(
                                'duprcfjc' /* Languages */,
                              ),
                              style: FlutterTheme.of(context)
                                  .bodyMedium
                                  .override(
                                    fontFamily: 'Readex Pro',
                                    color: Colors.white,
                                    fontSize: 16.0,
                                  ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Container(
                    width: 180.0,
                    height: 61.0,
                    decoration: BoxDecoration(
                      color: Color(0xFF009B9A),
                    ),
                    child: InkWell(
                      splashColor: Colors.transparent,
                      focusColor: Colors.transparent,
                      hoverColor: Colors.transparent,
                      highlightColor: Colors.transparent,
                      onTap: () async {
                        context.pushNamed('setting');
                      },
                      child: Row(
                        mainAxisSize: MainAxisSize.max,
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: [
                          ClipRRect(
                            borderRadius: BorderRadius.circular(8.0),
                            child: SvgPicture.asset(
                              'assets/images/Group_2640.svg',
                              width: 0.0,
                              height: 0.0,
                              fit: BoxFit.contain,
                            ),
                          ),
                          Align(
                            alignment: AlignmentDirectional(0.0, 0.0),
                            child: Padding(
                              padding: EdgeInsetsDirectional.fromSTEB(
                                  16.0, 0.0, 0.0, 0.0),
                              child: ClipRRect(
                                borderRadius: BorderRadius.circular(8.0),
                                child: SvgPicture.asset(
                                  'assets/images/setting-2.svg',
                                  width: 30.0,
                                  height: 30.0,
                                  fit: BoxFit.contain,
                                ),
                              ),
                            ),
                          ),
                          Padding(
                            padding: EdgeInsetsDirectional.fromSTEB(
                                15.0, 0.0, 0.0, 0.0),
                            child: Text(
                              FFLocalizations.of(context).getText(
                                'c7ygdyc6' /* Settings */,
                              ),
                              style: FlutterTheme.of(context)
                                  .bodyMedium
                                  .override(
                                    fontFamily: 'Readex Pro',
                                    color: Colors.white,
                                    fontSize: 16.0,
                                  ),
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ),
        ),
        appBar: PreferredSize(
          preferredSize: Size.fromHeight(0.0),
          child: AppBar(
            backgroundColor: Color(0xFFE7E36B),
            automaticallyImplyLeading: false,
            actions: [],
            centerTitle: false,
            elevation: 0.0,
          ),
        ),
        body: SafeArea(
          top: true,
          child: Stack(
            children: [
              Padding(
                padding: EdgeInsetsDirectional.fromSTEB(0.0, 100.0, 0.0, 0.0),
                child: Column(
                  mainAxisSize: MainAxisSize.max,
                  children: [
                    Padding(
                      padding:
                          EdgeInsetsDirectional.fromSTEB(0.0, 16.0, 0.0, 0.0),
                      child: SingleChildScrollView(
                        child: Column(
                          mainAxisSize: MainAxisSize.max,
                          mainAxisAlignment: MainAxisAlignment.start,
                          children: [
                            Align(
                              alignment: AlignmentDirectional(0.0, 0.0),
                              child: Padding(
                                padding: EdgeInsetsDirectional.fromSTEB(
                                    0.0, 0.0, 0.0, 8.0),
                                child: Text(
                                  FFLocalizations.of(context).getText(
                                    'uthh47be' /* User */,
                                  ),
                                  style: FlutterTheme.of(context)
                                      .bodyMedium
                                      .override(
                                        fontFamily: 'Readex Pro',
                                        color: Color(0xFF364257),
                                        fontSize: 24.0,
                                        fontWeight: FontWeight.bold,
                                      ),
                                ),
                              ),
                            ),
                            Row(
                              mainAxisSize: MainAxisSize.max,
                              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                              children: [
                                if (_model.tabBarCurrentIndex.toString() == '0')
                                  Builder(
                                    builder: (context) => Padding(
                                      padding: EdgeInsetsDirectional.fromSTEB(
                                          0.0, 0.0, 0.0, 16.0),
                                      child: FFButtonWidget(
                                        onPressed: () async {
                                          if ((_model.checkPermission22 ==
                                                  true) ||
                                              (_model.checkPermission23 ==
                                                  true)) {
                                            context.pushNamed(
                                              'newuser',
                                              queryParameters: {
                                                'checkPermission23':
                                                    serializeParam(
                                                  _model.checkPermission23,
                                                  ParamType.bool,
                                                ),
                                                'checkPremission22':
                                                    serializeParam(
                                                  _model.checkPermission22,
                                                  ParamType.bool,
                                                ),
                                              }.withoutNulls,
                                            );
                                          } else {
                                            await showAlignedDialog(
                                              context: context,
                                              isGlobal: true,
                                              avoidOverflow: false,
                                              targetAnchor:
                                                  AlignmentDirectional(0.0, 0.0)
                                                      .resolve(
                                                          Directionality.of(
                                                              context)),
                                              followerAnchor:
                                                  AlignmentDirectional(0.0, 0.0)
                                                      .resolve(
                                                          Directionality.of(
                                                              context)),
                                              builder: (dialogContext) {
                                                return Material(
                                                  color: Colors.transparent,
                                                  child: GestureDetector(
                                                    onTap: () => _model
                                                            .unfocusNode
                                                            .canRequestFocus
                                                        ? FocusScope.of(context)
                                                            .requestFocus(_model
                                                                .unfocusNode)
                                                        : FocusScope.of(context)
                                                            .unfocus(),
                                                    child: AlertBoxCustomWidget(
                                                      text:
                                                          'Your role don\'t have this permission!',
                                                    ),
                                                  ),
                                                );
                                              },
                                            ).then((value) => setState(() {}));
                                          }
                                        },
                                        text:
                                            FFLocalizations.of(context).getText(
                                          'olo0fbwb' /* New User */,
                                        ),
                                        options: FFButtonOptions(
                                          width: 160.5,
                                          height: 50.0,
                                          padding:
                                              EdgeInsetsDirectional.fromSTEB(
                                                  24.0, 0.0, 24.0, 0.0),
                                          iconPadding:
                                              EdgeInsetsDirectional.fromSTEB(
                                                  0.0, 0.0, 0.0, 0.0),
                                          color: Color(0xFF009B9A),
                                          textStyle:
                                              FlutterTheme.of(context)
                                                  .titleSmall
                                                  .override(
                                                    fontFamily: 'Readex Pro',
                                                    color: Colors.white,
                                                    fontSize: 20.0,
                                                  ),
                                          elevation: 3.0,
                                          borderSide: BorderSide(
                                            color: Colors.transparent,
                                            width: 1.0,
                                          ),
                                          borderRadius:
                                              BorderRadius.circular(40.0),
                                        ),
                                      ),
                                    ),
                                  ),
                                if (_model.tabBarCurrentIndex.toString() == '0')
                                  Builder(
                                    builder: (context) => Padding(
                                      padding: EdgeInsetsDirectional.fromSTEB(
                                          0.0, 0.0, 0.0, 16.0),
                                      child: FFButtonWidget(
                                        onPressed: () async {
                                          if (_model.checkPermission16 !=
                                              true) {
                                            await showAlignedDialog(
                                              context: context,
                                              isGlobal: true,
                                              avoidOverflow: false,
                                              targetAnchor:
                                                  AlignmentDirectional(0.0, 0.0)
                                                      .resolve(
                                                          Directionality.of(
                                                              context)),
                                              followerAnchor:
                                                  AlignmentDirectional(0.0, 0.0)
                                                      .resolve(
                                                          Directionality.of(
                                                              context)),
                                              builder: (dialogContext) {
                                                return Material(
                                                  color: Colors.transparent,
                                                  child: GestureDetector(
                                                    onTap: () => _model
                                                            .unfocusNode
                                                            .canRequestFocus
                                                        ? FocusScope.of(context)
                                                            .requestFocus(_model
                                                                .unfocusNode)
                                                        : FocusScope.of(context)
                                                            .unfocus(),
                                                    child: AlertBoxCustomWidget(
                                                      text:
                                                          'Your role don\'t have this permission!',
                                                    ),
                                                  ),
                                                );
                                              },
                                            ).then((value) => setState(() {}));
                                          }
                                        },
                                        text:
                                            FFLocalizations.of(context).getText(
                                          'e3k5e1gf' /* Invitation */,
                                        ),
                                        options: FFButtonOptions(
                                          width: 160.5,
                                          height: 50.0,
                                          padding:
                                              EdgeInsetsDirectional.fromSTEB(
                                                  24.0, 0.0, 24.0, 0.0),
                                          iconPadding:
                                              EdgeInsetsDirectional.fromSTEB(
                                                  0.0, 0.0, 0.0, 0.0),
                                          color: Color(0xFF009B9A),
                                          textStyle:
                                              FlutterTheme.of(context)
                                                  .titleSmall
                                                  .override(
                                                    fontFamily: 'Readex Pro',
                                                    color: Colors.white,
                                                    fontSize: 20.0,
                                                  ),
                                          elevation: 3.0,
                                          borderSide: BorderSide(
                                            color: Colors.transparent,
                                            width: 1.0,
                                          ),
                                          borderRadius:
                                              BorderRadius.circular(40.0),
                                        ),
                                      ),
                                    ),
                                  ),
                              ],
                            ),
                          ],
                        ),
                      ),
                    ),
                    Expanded(
                      child: Padding(
                        padding: EdgeInsetsDirectional.fromSTEB(
                            10.0, 0.0, 10.0, 100.0),
                        child: Column(
                          children: [
                            Align(
                              alignment: Alignment(0.0, 0),
                              child: FlutterButtonTabBar(
                                useToggleButtonStyle: true,
                                labelStyle: FlutterTheme.of(context)
                                    .titleMedium
                                    .override(
                                      fontFamily: 'Readex Pro',
                                      fontSize: 16.0,
                                    ),
                                unselectedLabelStyle: TextStyle(),
                                labelColor: Color(0xFF364257),
                                unselectedLabelColor: Colors.white,
                                backgroundColor: Colors.white,
                                unselectedBackgroundColor: Color(0xFF364257),
                                borderColor:
                                    FlutterTheme.of(context).primary,
                                unselectedBorderColor:
                                    FlutterTheme.of(context).alternate,
                                borderWidth: 2.0,
                                borderRadius: 0.0,
                                elevation: 0.0,
                                labelPadding: EdgeInsetsDirectional.fromSTEB(
                                    0.0, 15.0, 0.0, 25.0),
                                buttonMargin: EdgeInsetsDirectional.fromSTEB(
                                    8.0, 0.0, 8.0, 0.0),
                                padding: EdgeInsets.all(4.0),
                                tabs: [
                                  Tab(
                                    text: FFLocalizations.of(context).getText(
                                      'gihgiwfx' /* User List */,
                                    ),
                                    icon: Icon(
                                      Icons.people,
                                    ),
                                  ),
                                  Tab(
                                    text: FFLocalizations.of(context).getText(
                                      'cprao4aa' /* User Access
      Right */
                                      ,
                                    ),
                                    icon: Icon(
                                      Icons.security,
                                    ),
                                  ),
                                  Tab(
                                    text: FFLocalizations.of(context).getText(
                                      'ozu9hh5b' /* Access
   Log */
                                      ,
                                    ),
                                    icon: Icon(
                                      Icons.login,
                                    ),
                                  ),
                                ],
                                controller: _model.tabBarController,
                              ),
                            ),
                            Expanded(
                              child: TabBarView(
                                controller: _model.tabBarController,
                                physics: const NeverScrollableScrollPhysics(),
                                children: [
                                  Column(
                                    mainAxisSize: MainAxisSize.max,
                                    children: [
                                      Expanded(
                                        child: Align(
                                          alignment:
                                              AlignmentDirectional(0.0, 0.0),
                                          child: Container(
                                            width: 400.0,
                                            height: 600.0,
                                            decoration: BoxDecoration(
                                              color:
                                                  FlutterTheme.of(context)
                                                      .secondaryBackground,
                                            ),
                                            child: Align(
                                              alignment: AlignmentDirectional(
                                                  0.0, -1.0),
                                              child: FutureBuilder<
                                                  ApiCallResponse>(
                                                future: (_model
                                                            .apiRequestCompleter2 ??=
                                                        Completer<
                                                            ApiCallResponse>()
                                                          ..complete(
                                                              NumstationGroup
                                                                  .userListCall
                                                                  .call(
                                                            token: FFAppState()
                                                                .token,
                                                          )))
                                                    .future,
                                                builder: (context, snapshot) {
                                                  // Customize what your widget looks like when it's loading.
                                                  if (!snapshot.hasData) {
                                                    return Center(
                                                      child: SizedBox(
                                                        width: 50.0,
                                                        height: 50.0,
                                                        child:
                                                            CircularProgressIndicator(
                                                          valueColor:
                                                              AlwaysStoppedAnimation<
                                                                  Color>(
                                                            FlutterTheme.of(
                                                                    context)
                                                                .info,
                                                          ),
                                                        ),
                                                      ),
                                                    );
                                                  }
                                                  final columnUserListResponse =
                                                      snapshot.data!;
                                                  return Builder(
                                                    builder: (context) {
                                                      final userList =
                                                          getJsonField(
                                                        columnUserListResponse
                                                            .jsonBody,
                                                        r'''$.company_users''',
                                                      ).toList();
                                                      if (userList.isEmpty) {
                                                        return Center(
                                                          child:
                                                              EmptylistWidget(),
                                                        );
                                                      }
                                                      return SingleChildScrollView(
                                                        child: Column(
                                                          mainAxisSize:
                                                              MainAxisSize.max,
                                                          mainAxisAlignment:
                                                              MainAxisAlignment
                                                                  .start,
                                                          children: List.generate(
                                                              userList.length,
                                                              (userListIndex) {
                                                            final userListItem =
                                                                userList[
                                                                    userListIndex];
                                                            return Align(
                                                              alignment:
                                                                  AlignmentDirectional(
                                                                      0.0,
                                                                      -1.0),
                                                              child: Padding(
                                                                padding: EdgeInsetsDirectional
                                                                    .fromSTEB(
                                                                        0.0,
                                                                        10.0,
                                                                        0.0,
                                                                        10.0),
                                                                child:
                                                                    Container(
                                                                  width: () {
                                                                    if (MediaQuery.sizeOf(context)
                                                                            .width <
                                                                        428.0) {
                                                                      return 310.0;
                                                                    } else if (MediaQuery.sizeOf(context)
                                                                            .width >=
                                                                        428.0) {
                                                                      return 360.0;
                                                                    } else {
                                                                      return 350.0;
                                                                    }
                                                                  }(),
                                                                  height: 144.0,
                                                                  decoration:
                                                                      BoxDecoration(
                                                                    color: FlutterTheme.of(
                                                                            context)
                                                                        .secondaryBackground,
                                                                    boxShadow: [
                                                                      BoxShadow(
                                                                        blurRadius:
                                                                            4.0,
                                                                        color: Color(
                                                                            0x33000000),
                                                                        offset: Offset(
                                                                            0.0,
                                                                            2.0),
                                                                      )
                                                                    ],
                                                                    borderRadius:
                                                                        BorderRadius.circular(
                                                                            8.0),
                                                                  ),
                                                                  child: Align(
                                                                    alignment:
                                                                        AlignmentDirectional(
                                                                            0.0,
                                                                            0.0),
                                                                    child:
                                                                        Column(
                                                                      mainAxisSize:
                                                                          MainAxisSize
                                                                              .max,
                                                                      mainAxisAlignment:
                                                                          MainAxisAlignment
                                                                              .start,
                                                                      children: [
                                                                        Padding(
                                                                          padding: EdgeInsetsDirectional.fromSTEB(
                                                                              8.0,
                                                                              8.0,
                                                                              8.0,
                                                                              0.0),
                                                                          child:
                                                                              Row(
                                                                            mainAxisSize:
                                                                                MainAxisSize.max,
                                                                            mainAxisAlignment:
                                                                                MainAxisAlignment.spaceBetween,
                                                                            children: [
                                                                              Text(
                                                                                getJsonField(
                                                                                  userListItem,
                                                                                  r'''$.user_role.display_name''',
                                                                                ).toString(),
                                                                                style: FlutterTheme.of(context).bodyMedium.override(
                                                                                      fontFamily: 'Readex Pro',
                                                                                      fontSize: 16.0,
                                                                                    ),
                                                                              ),
                                                                              Text(
                                                                                getJsonField(
                                                                                  userListItem,
                                                                                  r'''$.user_role.status''',
                                                                                ).toString(),
                                                                                style: FlutterTheme.of(context).bodyMedium.override(
                                                                                      fontFamily: 'Readex Pro',
                                                                                      color: Color(0xFF06AE25),
                                                                                      fontSize: 16.0,
                                                                                    ),
                                                                              ),
                                                                            ],
                                                                          ),
                                                                        ),
                                                                        Padding(
                                                                          padding: EdgeInsetsDirectional.fromSTEB(
                                                                              8.0,
                                                                              8.0,
                                                                              0.0,
                                                                              0.0),
                                                                          child:
                                                                              Row(
                                                                            mainAxisSize:
                                                                                MainAxisSize.max,
                                                                            children: [
                                                                              Text(
                                                                                getJsonField(
                                                                                  userListItem,
                                                                                  r'''$.first_name''',
                                                                                ).toString(),
                                                                                style: FlutterTheme.of(context).bodyMedium.override(
                                                                                      fontFamily: 'Readex Pro',
                                                                                      fontSize: 16.0,
                                                                                    ),
                                                                              ),
                                                                              Padding(
                                                                                padding: EdgeInsetsDirectional.fromSTEB(3.0, 0.0, 0.0, 0.0),
                                                                                child: Text(
                                                                                  getJsonField(
                                                                                    userListItem,
                                                                                    r'''$.last_name''',
                                                                                  ).toString(),
                                                                                  style: FlutterTheme.of(context).bodyMedium.override(
                                                                                        fontFamily: 'Readex Pro',
                                                                                        fontSize: 16.0,
                                                                                      ),
                                                                                ),
                                                                              ),
                                                                            ],
                                                                          ),
                                                                        ),
                                                                        Expanded(
                                                                          child:
                                                                              Padding(
                                                                            padding: EdgeInsetsDirectional.fromSTEB(
                                                                                8.0,
                                                                                8.0,
                                                                                0.0,
                                                                                0.0),
                                                                            child:
                                                                                Row(
                                                                              mainAxisSize: MainAxisSize.max,
                                                                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                                                              children: [
                                                                                Text(
                                                                                  getJsonField(
                                                                                    userListItem,
                                                                                    r'''$..email''',
                                                                                  ).toString().maybeHandleOverflow(
                                                                                        maxChars: 18,
                                                                                        replacement: '…',
                                                                                      ),
                                                                                  maxLines: 1,
                                                                                  style: FlutterTheme.of(context).bodyMedium.override(
                                                                                        fontFamily: 'Readex Pro',
                                                                                        fontSize: 16.0,
                                                                                      ),
                                                                                ),
                                                                                if ((_model.checkPermission22 == true) || (_model.checkPermission23 == true))
                                                                                  Flexible(
                                                                                    flex: 2,
                                                                                    child: Align(
                                                                                      alignment: AlignmentDirectional(1.0, 0.0),
                                                                                      child: Padding(
                                                                                        padding: EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 5.0, 0.0),
                                                                                        child: InkWell(
                                                                                          splashColor: Colors.transparent,
                                                                                          focusColor: Colors.transparent,
                                                                                          hoverColor: Colors.transparent,
                                                                                          highlightColor: Colors.transparent,
                                                                                          onTap: () async {
                                                                                            context.pushNamed(
                                                                                              'editUser',
                                                                                              queryParameters: {
                                                                                                'firstName': serializeParam(
                                                                                                  getJsonField(
                                                                                                    userListItem,
                                                                                                    r'''$.first_name''',
                                                                                                  ).toString(),
                                                                                                  ParamType.String,
                                                                                                ),
                                                                                                'lastName': serializeParam(
                                                                                                  getJsonField(
                                                                                                    userListItem,
                                                                                                    r'''$.last_name''',
                                                                                                  ).toString(),
                                                                                                  ParamType.String,
                                                                                                ),
                                                                                                'phone': serializeParam(
                                                                                                  getJsonField(
                                                                                                    userListItem,
                                                                                                    r'''$.phone''',
                                                                                                  ),
                                                                                                  ParamType.int,
                                                                                                ),
                                                                                                'email': serializeParam(
                                                                                                  getJsonField(
                                                                                                    userListItem,
                                                                                                    r'''$.email''',
                                                                                                  ).toString(),
                                                                                                  ParamType.String,
                                                                                                ),
                                                                                                'userID': serializeParam(
                                                                                                  getJsonField(
                                                                                                    userListItem,
                                                                                                    r'''$.id''',
                                                                                                  ),
                                                                                                  ParamType.int,
                                                                                                ),
                                                                                                'checkPermission23': serializeParam(
                                                                                                  _model.checkPermission23,
                                                                                                  ParamType.bool,
                                                                                                ),
                                                                                                'checkPremission22': serializeParam(
                                                                                                  _model.checkPermission22,
                                                                                                  ParamType.bool,
                                                                                                ),
                                                                                                'roleID': serializeParam(
                                                                                                  getJsonField(
                                                                                                    userListItem,
                                                                                                    r'''$.role_id''',
                                                                                                  ).toString(),
                                                                                                  ParamType.String,
                                                                                                ),
                                                                                              }.withoutNulls,
                                                                                            );
                                                                                          },
                                                                                          child: Container(
                                                                                            width: 34.0,
                                                                                            height: 34.0,
                                                                                            decoration: BoxDecoration(
                                                                                              color: Color(0xFFF3CF5D),
                                                                                              shape: BoxShape.circle,
                                                                                            ),
                                                                                            child: Align(
                                                                                              alignment: AlignmentDirectional(0.0, 0.0),
                                                                                              child: FaIcon(
                                                                                                FontAwesomeIcons.pen,
                                                                                                color: Color(0xFF364257),
                                                                                                size: 20.0,
                                                                                              ),
                                                                                            ),
                                                                                          ),
                                                                                        ),
                                                                                      ),
                                                                                    ),
                                                                                  ),
                                                                                if ((_model.checkPermission22 == true) || (_model.checkPermission23 == true))
                                                                                  Flexible(
                                                                                    child: Align(
                                                                                      alignment: AlignmentDirectional(0.0, 0.0),
                                                                                      child: Padding(
                                                                                        padding: EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 8.0, 0.0),
                                                                                        child: InkWell(
                                                                                          splashColor: Colors.transparent,
                                                                                          focusColor: Colors.transparent,
                                                                                          hoverColor: Colors.transparent,
                                                                                          highlightColor: Colors.transparent,
                                                                                          onTap: () async {
                                                                                            context.pushNamed(
                                                                                              'userDetail',
                                                                                              queryParameters: {
                                                                                                'firstName': serializeParam(
                                                                                                  getJsonField(
                                                                                                    userListItem,
                                                                                                    r'''$..first_name''',
                                                                                                  ).toString(),
                                                                                                  ParamType.String,
                                                                                                ),
                                                                                                'lastName': serializeParam(
                                                                                                  getJsonField(
                                                                                                    userListItem,
                                                                                                    r'''$..last_name''',
                                                                                                  ).toString(),
                                                                                                  ParamType.String,
                                                                                                ),
                                                                                                'phone': serializeParam(
                                                                                                  getJsonField(
                                                                                                    userListItem,
                                                                                                    r'''$..phone''',
                                                                                                  ),
                                                                                                  ParamType.int,
                                                                                                ),
                                                                                                'email': serializeParam(
                                                                                                  getJsonField(
                                                                                                    userListItem,
                                                                                                    r'''$..email''',
                                                                                                  ).toString(),
                                                                                                  ParamType.String,
                                                                                                ),
                                                                                                'status': serializeParam(
                                                                                                  getJsonField(
                                                                                                    userListItem,
                                                                                                    r'''$.status''',
                                                                                                  ).toString(),
                                                                                                  ParamType.String,
                                                                                                ),
                                                                                              }.withoutNulls,
                                                                                            );
                                                                                          },
                                                                                          child: Container(
                                                                                            width: 34.0,
                                                                                            height: 34.0,
                                                                                            decoration: BoxDecoration(
                                                                                              color: Color(0xFF009B9A),
                                                                                              shape: BoxShape.circle,
                                                                                            ),
                                                                                            child: Align(
                                                                                              alignment: AlignmentDirectional(0.0, 0.0),
                                                                                              child: Icon(
                                                                                                Icons.remove_red_eye_outlined,
                                                                                                color: Colors.white,
                                                                                                size: 24.0,
                                                                                              ),
                                                                                            ),
                                                                                          ),
                                                                                        ),
                                                                                      ),
                                                                                    ),
                                                                                  ),
                                                                              ],
                                                                            ),
                                                                          ),
                                                                        ),
                                                                        if ((_model.checkPermission22 ==
                                                                                true) ||
                                                                            (_model.checkPermission23 ==
                                                                                true))
                                                                          Expanded(
                                                                            child:
                                                                                Align(
                                                                              alignment: AlignmentDirectional(0.0, 1.0),
                                                                              child: Padding(
                                                                                padding: EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 0.0, 8.0),
                                                                                child: Row(
                                                                                  mainAxisSize: MainAxisSize.max,
                                                                                  crossAxisAlignment: CrossAxisAlignment.end,
                                                                                  children: [
                                                                                    InkWell(
                                                                                      splashColor: Colors.transparent,
                                                                                      focusColor: Colors.transparent,
                                                                                      hoverColor: Colors.transparent,
                                                                                      highlightColor: Colors.transparent,
                                                                                      onTap: () async {
                                                                                        var confirmDialogResponse = await showDialog<bool>(
                                                                                              context: context,
                                                                                              builder: (alertDialogContext) {
                                                                                                return AlertDialog(
                                                                                                  title: Text('Do you really want to achieve it?'),
                                                                                                  actions: [
                                                                                                    TextButton(
                                                                                                      onPressed: () => Navigator.pop(alertDialogContext, false),
                                                                                                      child: Text('No'),
                                                                                                    ),
                                                                                                    TextButton(
                                                                                                      onPressed: () => Navigator.pop(alertDialogContext, true),
                                                                                                      child: Text('Yes'),
                                                                                                    ),
                                                                                                  ],
                                                                                                );
                                                                                              },
                                                                                            ) ??
                                                                                            false;
                                                                                        if (confirmDialogResponse) {
                                                                                          _model.apiResult6id = await NumstationGroup.deleteUserCall.call(
                                                                                            token: FFAppState().token,
                                                                                            userId: getJsonField(
                                                                                              userListItem,
                                                                                              r'''$.id''',
                                                                                            ),
                                                                                          );
                                                                                          ScaffoldMessenger.of(context).showSnackBar(
                                                                                            SnackBar(
                                                                                              content: Text(
                                                                                                'Successfully achieve the selected user!',
                                                                                                style: TextStyle(
                                                                                                  color: FlutterTheme.of(context).primaryText,
                                                                                                ),
                                                                                              ),
                                                                                              duration: Duration(milliseconds: 4000),
                                                                                              backgroundColor: Color(0xFF3B3B3B),
                                                                                            ),
                                                                                          );
                                                                                        }

                                                                                        setState(() {});
                                                                                      },
                                                                                      child: Text(
                                                                                        FFLocalizations.of(context).getText(
                                                                                          'pv9ozoao' /* Achieve */,
                                                                                        ),
                                                                                        style: FlutterTheme.of(context).bodyMedium.override(
                                                                                              fontFamily: 'Readex Pro',
                                                                                              color: Color(0xFF9B0025),
                                                                                              fontSize: 16.0,
                                                                                              fontWeight: FontWeight.normal,
                                                                                              decoration: TextDecoration.underline,
                                                                                            ),
                                                                                      ),
                                                                                    ),
                                                                                  ],
                                                                                ),
                                                                              ),
                                                                            ),
                                                                          ),
                                                                      ],
                                                                    ),
                                                                  ),
                                                                ),
                                                              ),
                                                            );
                                                          }),
                                                        ),
                                                      );
                                                    },
                                                  );
                                                },
                                              ),
                                            ),
                                          ),
                                        ),
                                      ),
                                    ],
                                  ),
                                  SingleChildScrollView(
                                    child: Column(
                                      mainAxisSize: MainAxisSize.max,
                                      children: [
                                        if (_model.checkPermission21 == true)
                                          Padding(
                                            padding:
                                                EdgeInsetsDirectional.fromSTEB(
                                                    0.0, 0.0, 0.0, 5.0),
                                            child: Container(
                                              width: 400.0,
                                              height: 820.0,
                                              decoration: BoxDecoration(
                                                color:
                                                    FlutterTheme.of(context)
                                                        .secondaryBackground,
                                              ),
                                              child: wrapWithModel(
                                                model: _model
                                                    .permissionListViewModel,
                                                updateCallback: () =>
                                                    setState(() {}),
                                                updateOnChange: true,
                                                child: PermissionListViewWidget(
                                                  parameter1:
                                                      _model.permissionsID,
                                                ),
                                              ),
                                            ),
                                          ),
                                        if (_model.checkPermission21 == false)
                                          Container(
                                            width: 400.0,
                                            height: 600.0,
                                            decoration: BoxDecoration(
                                              color:
                                                  FlutterTheme.of(context)
                                                      .secondaryBackground,
                                            ),
                                            child: wrapWithModel(
                                              model: _model.noPermissionModel1,
                                              updateCallback: () =>
                                                  setState(() {}),
                                              child: NoPermissionWidget(),
                                            ),
                                          ),
                                      ],
                                    ),
                                  ),
                                  Column(
                                    mainAxisSize: MainAxisSize.max,
                                    mainAxisAlignment: MainAxisAlignment.start,
                                    children: [
                                      if (_model.checkPermission24 == true)
                                        Container(
                                          width: 400.0,
                                          height: 820.0,
                                          decoration: BoxDecoration(
                                            color: FlutterTheme.of(context)
                                                .secondaryBackground,
                                          ),
                                          child: SingleChildScrollView(
                                            child: Column(
                                              mainAxisSize: MainAxisSize.max,
                                              children: [
                                                ListView(
                                                  padding: EdgeInsets.zero,
                                                  reverse: true,
                                                  primary: false,
                                                  shrinkWrap: true,
                                                  scrollDirection:
                                                      Axis.vertical,
                                                  children: [
                                                    FutureBuilder<
                                                        ApiCallResponse>(
                                                      future: (_model
                                                                  .apiRequestCompleter1 ??=
                                                              Completer<
                                                                  ApiCallResponse>()
                                                                ..complete(
                                                                    NumstationGroup
                                                                        .accessLogsCall
                                                                        .call(
                                                                  token:
                                                                      FFAppState()
                                                                          .token,
                                                                )))
                                                          .future,
                                                      builder:
                                                          (context, snapshot) {
                                                        // Customize what your widget looks like when it's loading.
                                                        if (!snapshot.hasData) {
                                                          return Center(
                                                            child: SizedBox(
                                                              width: 50.0,
                                                              height: 50.0,
                                                              child:
                                                                  CircularProgressIndicator(
                                                                valueColor:
                                                                    AlwaysStoppedAnimation<
                                                                        Color>(
                                                                  FlutterTheme.of(
                                                                          context)
                                                                      .info,
                                                                ),
                                                              ),
                                                            ),
                                                          );
                                                        }
                                                        final columnAccessLogsResponse =
                                                            snapshot.data!;
                                                        return Builder(
                                                          builder: (context) {
                                                            final logList =
                                                                getJsonField(
                                                              columnAccessLogsResponse
                                                                  .jsonBody,
                                                              r'''$..logs''',
                                                            ).toList();
                                                            if (logList
                                                                .isEmpty) {
                                                              return Center(
                                                                child:
                                                                    EmptylistWidget(),
                                                              );
                                                            }
                                                            return Column(
                                                              mainAxisSize:
                                                                  MainAxisSize
                                                                      .max,
                                                              children: List.generate(
                                                                  logList
                                                                      .length,
                                                                  (logListIndex) {
                                                                final logListItem =
                                                                    logList[
                                                                        logListIndex];
                                                                return Padding(
                                                                  padding: EdgeInsetsDirectional
                                                                      .fromSTEB(
                                                                          0.0,
                                                                          5.0,
                                                                          0.0,
                                                                          8.0),
                                                                  child:
                                                                      Container(
                                                                    width: () {
                                                                      if (MediaQuery.sizeOf(context)
                                                                              .width <
                                                                          428.0) {
                                                                        return 320.0;
                                                                      } else if (MediaQuery.sizeOf(context)
                                                                              .width >=
                                                                          428.0) {
                                                                        return 350.0;
                                                                      } else {
                                                                        return 340.0;
                                                                      }
                                                                    }(),
                                                                    decoration:
                                                                        BoxDecoration(
                                                                      color: FlutterTheme.of(
                                                                              context)
                                                                          .secondaryBackground,
                                                                    ),
                                                                    child:
                                                                        Column(
                                                                      mainAxisSize:
                                                                          MainAxisSize
                                                                              .max,
                                                                      children: [
                                                                        Row(
                                                                          mainAxisSize:
                                                                              MainAxisSize.max,
                                                                          children: [
                                                                            Text(
                                                                              getJsonField(
                                                                                logListItem,
                                                                                r'''$..description''',
                                                                              ).toString(),
                                                                              style: FlutterTheme.of(context).bodyMedium.override(
                                                                                    fontFamily: 'Readex Pro',
                                                                                    fontSize: 16.0,
                                                                                  ),
                                                                            ),
                                                                          ],
                                                                        ),
                                                                        Padding(
                                                                          padding: EdgeInsetsDirectional.fromSTEB(
                                                                              0.0,
                                                                              8.0,
                                                                              0.0,
                                                                              8.0),
                                                                          child:
                                                                              Row(
                                                                            mainAxisSize:
                                                                                MainAxisSize.max,
                                                                            mainAxisAlignment:
                                                                                MainAxisAlignment.spaceBetween,
                                                                            children: [
                                                                              Text(
                                                                                functions.formatDate(getJsonField(
                                                                                  logListItem,
                                                                                  r'''$..created_at''',
                                                                                ).toString()),
                                                                                style: FlutterTheme.of(context).bodyMedium.override(
                                                                                      fontFamily: 'Readex Pro',
                                                                                      fontSize: 16.0,
                                                                                    ),
                                                                              ),
                                                                              Text(
                                                                                functions.formatTime(getJsonField(
                                                                                  logListItem,
                                                                                  r'''$..created_at''',
                                                                                ).toString()),
                                                                                style: FlutterTheme.of(context).bodyMedium.override(
                                                                                      fontFamily: 'Readex Pro',
                                                                                      fontSize: 16.0,
                                                                                    ),
                                                                              ),
                                                                            ],
                                                                          ),
                                                                        ),
                                                                        SizedBox(
                                                                          width:
                                                                              350.0,
                                                                          child:
                                                                              Divider(
                                                                            thickness:
                                                                                1.0,
                                                                            color:
                                                                                Color(0xFFEBEBE4),
                                                                          ),
                                                                        ),
                                                                      ],
                                                                    ),
                                                                  ),
                                                                );
                                                              }),
                                                            );
                                                          },
                                                        );
                                                      },
                                                    ),
                                                  ],
                                                ),
                                              ],
                                            ),
                                          ),
                                        ),
                                      if (_model.checkPermission24 == false)
                                        Container(
                                          width: 400.0,
                                          height: 550.0,
                                          decoration: BoxDecoration(
                                            color: FlutterTheme.of(context)
                                                .secondaryBackground,
                                          ),
                                          child: wrapWithModel(
                                            model: _model.noPermissionModel2,
                                            updateCallback: () =>
                                                setState(() {}),
                                            child: NoPermissionWidget(),
                                          ),
                                        ),
                                    ],
                                  ),
                                ],
                              ),
                            ),
                          ],
                        ),
                      ),
                    ),
                  ],
                ),
              ),
              Align(
                alignment: AlignmentDirectional(0.0, 1.0),
                child: wrapWithModel(
                  model: _model.navBar1Model,
                  updateCallback: () => setState(() {}),
                  child: NavBar1Widget(),
                ),
              ),
              wrapWithModel(
                model: _model.appbarModel,
                updateCallback: () => setState(() {}),
                child: AppbarWidget(),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
