diff --git a/lib/shared/components/molecules/locals/presentation/widgets/local_profile/local_profile_widget.dart b/lib/shared/components/molecules/locals/presentation/widgets/local_profile/local_profile_widget.dart index 9d436de2..cfcfa437 100644 --- a/lib/shared/components/molecules/locals/presentation/widgets/local_profile/local_profile_widget.dart +++ b/lib/shared/components/molecules/locals/presentation/widgets/local_profile/local_profile_widget.dart @@ -21,13 +21,18 @@ class LocalProfileComponentWidget extends StatefulWidget { } class _LocalProfileComponentWidgetState extends State { + bool _isLoading = false; + Future retrieveProfileInfo() async { + + setState(() {_isLoading = true;}); - Future callback() async { await StorageHelper().set(KeychainStorageKey.clientUUID.value, ''); LocalsRepositoryImpl.license.add(false); final response = await LocalsRepositoryImpl().update(context); LocalsRepositoryImpl.license.add(response); + + setState(() {_isLoading = false;}); } @override @@ -58,7 +63,7 @@ class _LocalProfileComponentWidgetState extends State( builder: (context, state) { - return _buildAsyncLocalProfile(context, state, limitedFontSize, callback); + return _buildAsyncLocalProfile(context, state, limitedFontSize); }, ); @@ -96,12 +101,7 @@ class _LocalProfileComponentWidgetState extends State Container( - decoration: BoxDecoration( - image: DecorationImage( - image: imageProvider, - fit: BoxFit.cover, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Align( + alignment: const AlignmentDirectional(-1.0, 0.0), + child: Padding( + padding: const EdgeInsets.all(2.0), + child: InkWell( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: _isLoading ? null : retrieveProfileInfo, + child: ClipRRect( + borderRadius: BorderRadius.circular(200.0), + child: CachedNetworkImage( + imageBuilder: (context, imageProvider) => Container( + decoration: BoxDecoration( + image: DecorationImage( + image: imageProvider, + fit: BoxFit.cover, + ), ), ), + imageUrl: valueOrDefault('https://freaccess.com.br/freaccess/Images/Clients/${state.cliUUID}.png', 'assets/images/home.png'), + width: 80.0, + height: 80.0, + fit: BoxFit.cover, + alignment: const Alignment(0.0, 0.0), + placeholder: (context, url) => Image.asset('assets/images/home.png'), + errorListener: (_) => Image.asset('assets/images/home.png'), + errorWidget: (_, __, ___) => Image.asset('assets/images/home.png'), ), - imageUrl: valueOrDefault('https://freaccess.com.br/freaccess/Images/Clients/${state.cliUUID}.png', 'assets/images/home.png'), - width: 80.0, - height: 80.0, - fit: BoxFit.cover, - alignment: const Alignment(0.0, 0.0), - placeholder: (context, url) => Image.asset('assets/images/home.png'), - errorListener: (_) => Image.asset('assets/images/home.png'), - errorWidget: (_, __, ___) => Image.asset('assets/images/home.png'), - ), - )), - ), - ), - Expanded( - child: Tooltip( - message: valueOrDefault( - convertToUppercase(state.cliName), - FFLocalizations.of(context).getVariableText( - ptText: 'SEM LOCAL VINCULADO', - enText: 'NO LINKED LOCAL', - ), + )), ), - child: Text( - valueOrDefault( + ), + Expanded( + child: Tooltip( + message: valueOrDefault( convertToUppercase(state.cliName), FFLocalizations.of(context).getVariableText( ptText: 'SEM LOCAL VINCULADO', enText: 'NO LINKED LOCAL', ), ), - overflow: TextOverflow.ellipsis, - maxLines: 1, - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).info, - fontSize: limitedFontSize, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + child: Text( + valueOrDefault( + convertToUppercase(state.cliName), + FFLocalizations.of(context).getVariableText( + ptText: 'SEM LOCAL VINCULADO', + enText: 'NO LINKED LOCAL', ), + ), + overflow: TextOverflow.ellipsis, + maxLines: 1, + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).info, + fontSize: limitedFontSize, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: GoogleFonts.asMap().containsKey('Nunito'), + ), + ), ), ), - ), - ].divide(const SizedBox(width: 20.0)).addToStart(const SizedBox(width: 20.0)).addToEnd(const SizedBox(width: 20.0)), + ].divide(const SizedBox(width: 20.0)).addToStart(const SizedBox(width: 20.0)).addToEnd(const SizedBox(width: 20.0)), + ), ), ), ), - ), - ); - - - } + ); + + + } }