From b9d23b185c9159ad904cf1a7f4a6f3ce474eabc3 Mon Sep 17 00:00:00 2001 From: Lucas Date: Tue, 6 Aug 2024 17:25:19 -0300 Subject: [PATCH] Re-model modal --- lib/flutter_flow/upload_data.dart | 118 ++++++++++++++++++++---------- 1 file changed, 79 insertions(+), 39 deletions(-) diff --git a/lib/flutter_flow/upload_data.dart b/lib/flutter_flow/upload_data.dart index c7c4c597..7136765b 100644 --- a/lib/flutter_flow/upload_data.dart +++ b/lib/flutter_flow/upload_data.dart @@ -57,16 +57,25 @@ Future?> selectMediaWithSourceBottomSheet({ bool includeDimensions = false, bool includeBlurHash = false, }) async { - createUploadMediaListTile(String label, MediaSource mediaSource) => ListTile( - title: Text( - label, - textAlign: TextAlign.center, - style: GoogleFonts.getFont( - pickerFontFamily, - color: FlutterFlowTheme.of(context).primaryText, - fontWeight: FontWeight.w600, - fontSize: 20, - ), + createUploadMediaListTile( + String label, MediaSource mediaSource, IconData icon) => + ListTile( + title: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(icon, color: FlutterFlowTheme.of(context).primaryText), + SizedBox(width: 5), + Text( + label, + textAlign: TextAlign.center, + style: GoogleFonts.getFont( + pickerFontFamily, + color: FlutterFlowTheme.of(context).primaryText, + fontWeight: FontWeight.w600, + fontSize: 12, + ), + ), + ], ), tileColor: FlutterFlowTheme.of(context).primaryBackground, dense: false, @@ -83,11 +92,22 @@ Future?> selectMediaWithSourceBottomSheet({ mainAxisSize: MainAxisSize.min, children: [ if (!kIsWeb) ...[ + Container( + margin: const EdgeInsets.only(top: 10), + width: 40, + height: 5, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + ), Padding( padding: const EdgeInsets.fromLTRB(0, 8, 0, 0), child: ListTile( title: Text( - 'Choose Source', + FFLocalizations.of(context).getVariableText( + ptText: "Escolha uma das opções", + enText: "Choose one of the options"), textAlign: TextAlign.center, style: GoogleFonts.getFont( pickerFontFamily, @@ -95,41 +115,61 @@ Future?> selectMediaWithSourceBottomSheet({ .primaryText .withOpacity(0.65), fontWeight: FontWeight.w500, - fontSize: 20, + fontSize: 14, ), ), tileColor: FlutterFlowTheme.of(context).primaryBackground, dense: true, ), ), - const Divider(), ], - if (allowPhoto && allowVideo) ...[ - createUploadMediaListTile( - 'Gallery (Photo)', - MediaSource.photoGallery, - ), - const Divider(), - createUploadMediaListTile( - 'Gallery (Video)', - MediaSource.videoGallery, - ), - ] else if (allowPhoto) - createUploadMediaListTile( - 'Gallery', - MediaSource.photoGallery, - ) - else - createUploadMediaListTile( - 'Gallery', - MediaSource.videoGallery, - ), - if (!kIsWeb) ...[ - const Divider(), - createUploadMediaListTile('Camera', MediaSource.camera), - const Divider(), - ], - const SizedBox(height: 10), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + if (allowPhoto && allowVideo) ...[ + Expanded( + child: createUploadMediaListTile( + FFLocalizations.of(context).getVariableText( + ptText: "Galeria (Foto)", + enText: "Gallery (Photo)"), + MediaSource.photoGallery, + Icons.camera), + ), + Expanded( + child: createUploadMediaListTile( + FFLocalizations.of(context).getVariableText( + ptText: "Galeria (Video)", + enText: "Gallery (Video)"), + MediaSource.videoGallery, + Icons.videocam), + ) + ] else if (allowPhoto) + Expanded( + child: createUploadMediaListTile( + FFLocalizations.of(context).getVariableText( + ptText: "Galeria", enText: "Gallery"), + MediaSource.photoGallery, + Icons.photo)) + else + Expanded( + child: createUploadMediaListTile( + FFLocalizations.of(context).getVariableText( + ptText: "Galeria", enText: "Gallery"), + MediaSource.videoGallery, + Icons.videocam), + ), + if (!kIsWeb) ...[ + Expanded( + child: createUploadMediaListTile( + FFLocalizations.of(context).getVariableText( + ptText: "Camera", enText: "Camera"), + MediaSource.camera, + Icons.camera_alt), + ) + ], + ], + ), + const SizedBox(height: 15), ], ); });