diff --git a/assets/images/logo.png b/assets/images/logo.png new file mode 100644 index 00000000..6659dd53 Binary files /dev/null and b/assets/images/logo.png differ diff --git a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart index 414203d1..ab27edb0 100644 --- a/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart +++ b/lib/components/organism_components/local_profile_component/local_profile_component_widget.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:provider/provider.dart'; @@ -71,68 +72,57 @@ class _LocalProfileComponentWidgetState child: Padding( padding: const EdgeInsets.all(2.0), child: InkWell( - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - onTap: () async { - showModalBottomSheet( - isScrollControlled: true, - backgroundColor: const Color(0x00FFFFFF), - context: context, - builder: (context) { - return Padding( - padding: MediaQuery.viewInsetsOf(context), - child: const SizedBox( - height: double.infinity, - child: BottomArrowLinkedLocalsComponentWidget(), - ), - ); - }, - ).then((value) => safeSetState(() {})); - }, - child: ClipRRect( + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + onTap: () async { + showModalBottomSheet( + isScrollControlled: true, + backgroundColor: const Color(0x00FFFFFF), + context: context, + builder: (context) { + return Padding( + padding: MediaQuery.viewInsetsOf(context), + child: const SizedBox( + height: double.infinity, + child: + BottomArrowLinkedLocalsComponentWidget(), + ), + ); + }, + ).then((value) => safeSetState(() {})); + }, + child: ClipRRect( borderRadius: BorderRadius.circular(200.0), - child: Image.network( - 'https://freaccess.com.br/freaccess/Images/Clients/${AppState().cliUUID}.png', + child: CachedNetworkImage( + imageUrl: + 'https://freaccess.com.br/freaccess/Images/Clients/${AppState().cliUUID}.png', width: 80.0, height: 80.0, fit: BoxFit.cover, alignment: const Alignment(0.0, 0.0), - errorBuilder: (context, error, stackTrace) => - Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg', - width: 80.0, - height: 80.0, - fit: BoxFit.cover, - alignment: const Alignment(0.0, 0.0), - errorBuilder: (context, error, stackTrace) => - Image.asset('assets/images/error_image.svg'), - ), - )), - ), + // errorListener: (Easing) => log(Easing.toString()), + errorWidget: (_, __, ___) => + Image.asset('assets/images/error_image.svg'), + ), + )), ), ), - Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - valueOrDefault( - functions.convertToUppercase(AppState().local), - 'NOME DO LOCAL', + Text( + valueOrDefault( + functions.convertToUppercase(AppState().local), + 'NOME DO LOCAL', + ), + style: FlutterFlowTheme.of(context).labelMedium.override( + fontFamily: 'Nunito', + color: FlutterFlowTheme.of(context).info, + fontSize: 14.0, + letterSpacing: 0.0, + fontWeight: FontWeight.w500, + useGoogleFonts: + GoogleFonts.asMap().containsKey('Nunito'), ), - style: FlutterFlowTheme.of(context).labelMedium.override( - fontFamily: 'Nunito', - color: FlutterFlowTheme.of(context).info, - fontSize: 14.0, - letterSpacing: 0.0, - fontWeight: FontWeight.w500, - useGoogleFonts: - GoogleFonts.asMap().containsKey('Nunito'), - ), - ), - ], ), ] .divide(const SizedBox(width: 20.0)) diff --git a/lib/pages/home_page/home_page_widget.dart b/lib/pages/home_page/home_page_widget.dart index 983be7e1..e4dc9f88 100644 --- a/lib/pages/home_page/home_page_widget.dart +++ b/lib/pages/home_page/home_page_widget.dart @@ -50,7 +50,7 @@ class _HomePageWidgetState extends State { AppState().whatsapp = value.jsonBody['whatsapp']; AppState().provisional = value.jsonBody['provisional']; } else { - DialogUtil.errorDefault(context); + await DialogUtil.warningDefault(context); } }); }(); @@ -164,7 +164,6 @@ class _HomePageWidgetState extends State { item: MenuItem.button, ), ), - // Align( // alignment: const AlignmentDirectional(0.0, 0.0), // child: Provider( @@ -177,7 +176,6 @@ class _HomePageWidgetState extends State { // ), // ), //footer - const SizedBox( height: 100, width: double.infinity, @@ -249,8 +247,8 @@ class _HomePageWidgetState extends State { 60.0, 15.0, 0.0, 0.0), child: ClipRRect( borderRadius: BorderRadius.circular(8.0), - child: Image.network( - 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/8r2vsbd9i03k/logo.png', + child: Image.asset( + 'assets/images/logo.png', width: 50.0, height: 200.0, fit: BoxFit.none, @@ -264,9 +262,7 @@ class _HomePageWidgetState extends State { padding: const EdgeInsetsDirectional.fromSTEB( 0.0, 15.0, 0.0, 0.0), child: Text( - FFLocalizations.of(context).getText( - 'rg9pzkpz' /* FRE ACCESS */, - ), + 'FRE ACCESS', style: FlutterFlowTheme.of(context) .bodyMedium .override( @@ -287,28 +283,28 @@ class _HomePageWidgetState extends State { ), ), ), - Align( - alignment: const AlignmentDirectional(0.0, 1.0), - child: Container( - width: 100.0, - height: 50.0, - decoration: const BoxDecoration(), - child: Align( - alignment: const AlignmentDirectional(1.0, 1.0), - child: FlutterFlowIconButton( - borderRadius: 20.0, - borderWidth: 1.0, - buttonSize: 40.0, - icon: Icon( - Icons.notifications_sharp, - color: FlutterFlowTheme.of(context).info, - size: 24.0, - ), - onPressed: () {}, - ), - ), - ), - ), + // Align( + // alignment: const AlignmentDirectional(0.0, 1.0), + // child: Container( + // width: 100.0, + // height: 50.0, + // decoration: const BoxDecoration(), + // child: Align( + // alignment: const AlignmentDirectional(1.0, 1.0), + // child: FlutterFlowIconButton( + // borderRadius: 20.0, + // borderWidth: 1.0, + // buttonSize: 40.0, + // icon: Icon( + // Icons.notifications_sharp, + // color: FlutterFlowTheme.of(context).info, + // size: 24.0, + // ), + // onPressed: () {}, + // ), + // ), + // ), + // ), ], ), ), diff --git a/lib/shared/utils/dialog_util.dart b/lib/shared/utils/dialog_util.dart index 6db1ed89..beeecbe2 100644 --- a/lib/shared/utils/dialog_util.dart +++ b/lib/shared/utils/dialog_util.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:hub/components/molecular_components/throw_exception/throw_exception_widget.dart'; import 'package:hub/flutter_flow/flutter_flow_util.dart'; @@ -8,24 +7,33 @@ class DialogUtil { static const double _height = 350; static Future errorDefault(BuildContext context) { - return error(context, FFLocalizations.of(context).getVariableText( - ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.", - enText: "Failed to perform operation, please try again later." - )); + return error( + context, + FFLocalizations.of(context).getVariableText( + ptText: "Falha ao efetuar operação, Tente Novamente mais tarde.", + enText: "Failed to perform operation, please try again later.")); + } + + static Future warningDefault(BuildContext context) { + return warning( + context, + FFLocalizations.of(context).getVariableText( + ptText: "Atenção, algo deu errado. Tente novamente mais tarde.", + enText: "Warning, something went wrong. Try again later.")); } static Future error(BuildContext context, String message) async { return await showDialog( - context: context, - builder: (context) { - return Dialog( - child: SizedBox( - height: _height, - child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.error)) - ) - ); - } - ); + context: context, + builder: (context) { + return Dialog( + child: SizedBox( + height: _height, + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: message, type: EnumThrowException.error)))); + }); } static Future warning(BuildContext context, String message) async { @@ -35,11 +43,11 @@ class DialogUtil { return Dialog( child: SizedBox( height: _height, - child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.warning)) - ) - ); - } - ); + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: message, type: EnumThrowException.warning)))); + }); } static Future success(BuildContext context, String message) async { @@ -49,11 +57,10 @@ class DialogUtil { return Dialog( child: SizedBox( height: _height, - child: Padding(padding: MediaQuery.viewInsetsOf(context), child: ThrowExceptionWidget(msg: message, type: EnumThrowException.success)) - ) - ); - } - ); + child: Padding( + padding: MediaQuery.viewInsetsOf(context), + child: ThrowExceptionWidget( + msg: message, type: EnumThrowException.success)))); + }); } - -} \ No newline at end of file +}