@override Widget build(BuildContext context) { context.watch(); return GestureDetector( onTap: () => _model.unfocusNode.canRequestFocus ? FocusScope.of(context).requestFocus(_model.unfocusNode) : FocusScope.of(context).unfocus(), child: Scaffold( key: scaffoldKey, backgroundColor: FlutterFlowTheme.of(context).primaryBackground, appBar: AppBar( backgroundColor: FlutterFlowTheme.of(context).primaryBackground, automaticallyImplyLeading: false, leading: FlutterFlowIconButton( borderColor: Colors.transparent, borderRadius: 30.0, borderWidth: 1.0, buttonSize: 60.0, icon: Icon( Icons.keyboard_arrow_left, color: FlutterFlowTheme.of(context).primaryText, size: 30.0, ), onPressed: () async { context.pop(); }, ), title: Text( FFLocalizations.of(context).getText( 'ch8qymga' /* Histórico de Acesso */, ), style: FlutterFlowTheme.of(context).headlineMedium.override( fontFamily: FlutterFlowTheme.of(context).headlineMediumFamily, color: FlutterFlowTheme.of(context).primaryText, fontSize: 18.0, letterSpacing: 0.0, useGoogleFonts: GoogleFonts.asMap().containsKey( FlutterFlowTheme.of(context).headlineMediumFamily), ), ), actions: const [], centerTitle: true, elevation: 0.0, ), body: SafeArea( top: true, child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [ Container( width: double.infinity, height: 38.0, decoration: BoxDecoration( color: FlutterFlowTheme.of(context).primaryBackground, ), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.end, children: [ FlutterFlowIconButton( borderColor: Colors.transparent, borderRadius: 20.0, borderWidth: 1.0, buttonSize: 40.0, icon: Icon( Icons.filter_list, color: FlutterFlowTheme.of(context).primaryText, size: 24.0, ), onPressed: () async { await showModalBottomSheet( isScrollControlled: true, backgroundColor: Colors.transparent, context: context, builder: (context) { return GestureDetector( onTap: () => _model.unfocusNode.canRequestFocus ? FocusScope.of(context) .requestFocus(_model.unfocusNode) : FocusScope.of(context).unfocus(), child: Padding( padding: MediaQuery.viewInsetsOf(context), child: const OptModalWidget(), ), ); }, ).then((value) => safeSetState(() { updateSelectedType(value); debugPrint('Selected type: $value'); })); }, ), ] .addToStart(const SizedBox(width: 10.0)) .addToEnd(const SizedBox(width: 10.0)), ), ), Expanded( child: Container( width: double.infinity, height: double.infinity, decoration: const BoxDecoration(), child: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, children: [ FutureBuilder( future: _model.accessHistory( requestFn: () => PhpGroup.getAccessCall.call( devUUID: FFAppState().devUUID, userUUID: FFAppState().userUUID, cliID: FFAppState().cliUUID, atividade: 'getAcessos', pageSize: '100', pageNumber: '1', pesTipo: selectedType, ), ), 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: SpinKitCircle( color: FlutterFlowTheme.of(context).primary, size: 50.0, ), ), ); } final wrapGetAccessResponse = snapshot.data!; return Builder( builder: (context) { final accessHistory = PhpGroup.getAccessCall .access( wrapGetAccessResponse.jsonBody, ) ?.toList() ?? []; return Wrap( spacing: 2.0, runSpacing: 1.0, alignment: WrapAlignment.start, crossAxisAlignment: WrapCrossAlignment.start, direction: Axis.horizontal, runAlignment: WrapAlignment.start, verticalDirection: VerticalDirection.down, clipBehavior: Clip.none, children: List.generate(accessHistory.length, (accessHistoryIndex) { final accessHistoryItem = accessHistory[accessHistoryIndex]; return Align( alignment: const AlignmentDirectional(0.0, 0.0), child: Card( clipBehavior: Clip.antiAliasWithSaveLayer, color: FlutterFlowTheme.of(context) .secondaryBackground, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0), ), child: Container( width: 350.0, height: 128.0, decoration: BoxDecoration( color: FlutterFlowTheme.of(context) .primaryBackground, ), child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisSize: MainAxisSize.max, children: [ Padding( padding: const EdgeInsets.all( 10.0), child: ClipRRect( borderRadius: BorderRadius.circular( 100.0), child: Image.network( valueOrDefault( 'https://freaccess.com.br/freaccess/getImage.php?devUUID=${FFAppState().devUUID}&userUUID=${FFAppState().userUUID}&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( accessHistoryItem, r'''$.VTE_DOCUMENTO''', ).toString()}&tipo=E', 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', ), width: 60.0, height: 60.0, fit: BoxFit.cover, ), ), ), Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment .start, children: [ Text( getJsonField( accessHistoryItem, r'''$.PES_NOME''', ).toString(), style: FlutterFlowTheme.of( context) .bodyMedium .override( fontFamily: FlutterFlowTheme.of( context) .bodyMediumFamily, letterSpacing: 0.0, useGoogleFonts: GoogleFonts .asMap() .containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), ), ), Container( width: 100.0, height: 25.0, decoration: BoxDecoration( color: functions.jsonToStr( getJsonField( accessHistoryItem, r'''$.PES_TIPO''', )) == 'E' ? FlutterFlowTheme .of( context) .primary : FlutterFlowTheme .of(context) .warning, borderRadius: BorderRadius .circular( 24.0), ), child: Align( alignment: const AlignmentDirectional( 0.0, 0.0), child: Text( getJsonField( accessHistoryItem, r'''$.PES_TIPO''', ).toString(), style: FlutterFlowTheme .of(context) .bodyMedium .override( fontFamily: FlutterFlowTheme.of( context) .bodyMediumFamily, color: FlutterFlowTheme.of( context) .info, letterSpacing: 0.0, useGoogleFonts: GoogleFonts .asMap() .containsKey( FlutterFlowTheme.of(context) .bodyMediumFamily), ), ), ), ), ], ), ] .divide(const SizedBox( width: 20.0)) .addToStart(const SizedBox( width: 5.0)) .addToEnd(const SizedBox( width: 5.0)), ), Row( mainAxisSize: MainAxisSize.max, children: [ Expanded( child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment .center, children: [ Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment .start, children: [ Text( FFLocalizations.of( context) .getText( '2odgr6hg' /* Entrou: */, ), style: FlutterFlowTheme .of(context) .bodyMedium .override( fontFamily: FlutterFlowTheme.of(context) .bodyMediumFamily, fontSize: 12.5, letterSpacing: 0.0, fontWeight: FontWeight .bold, useGoogleFonts: GoogleFonts .asMap() .containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), ), ), Text( getJsonField( accessHistoryItem, r'''$.ACE_DATAHORA''', ).toString(), style: FlutterFlowTheme .of(context) .bodyMedium .override( fontFamily: FlutterFlowTheme.of(context) .bodyMediumFamily, fontSize: 12.5, letterSpacing: 0.0, useGoogleFonts: GoogleFonts .asMap() .containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), ), ), ].addToStart( const SizedBox( width: 10.0)), ), Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment .start, children: [ Text( FFLocalizations.of( context) .getText( 'zrde3fke' /* Setor */, ), style: FlutterFlowTheme .of(context) .bodyMedium .override( fontFamily: FlutterFlowTheme.of(context) .bodyMediumFamily, fontSize: 12.5, letterSpacing: 0.0, fontWeight: FontWeight .bold, useGoogleFonts: GoogleFonts .asMap() .containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), ), ), Text( getJsonField( accessHistoryItem, r'''$.ACI_DESCRICAO''', ).toString(), style: FlutterFlowTheme .of(context) .bodyMedium .override( fontFamily: FlutterFlowTheme.of(context) .bodyMediumFamily, fontSize: 12.5, letterSpacing: 0.0, useGoogleFonts: GoogleFonts .asMap() .containsKey( FlutterFlowTheme.of(context).bodyMediumFamily), ), ), ].addToStart( const SizedBox( width: 10.0)), ), ].divide(const SizedBox( height: 3.0)), ), ), ] .addToStart(const SizedBox( width: 5.0)) .addToEnd(const SizedBox( width: 5.0)), ), ], ), ), ), ); }), ); }, ); }, ), ], ), ), ), ), ].addToStart(const SizedBox(height: 5.0)), ), ), ), ); }