feat: Improve image upload functionality

The code changes include fixes for image upload, renaming of a class, and improvements to message well, visitor register, and preferences pages. These changes aim to enhance the image upload functionality and ensure a smoother user experience.
This commit is contained in:
jantunesmesias 2024-08-02 11:22:31 -03:00
parent 08e072e183
commit 561a128943
1 changed files with 77 additions and 98 deletions

View File

@ -364,22 +364,11 @@ class _RegisiterVistorTemplateComponentWidgetState
), ),
), ),
Padding( Padding(
padding: padding: const EdgeInsetsDirectional.fromSTEB(
const EdgeInsetsDirectional.fromSTEB(24.0, 0.0, 24.0, 10.0), 24.0, 0.0, 24.0, 10.0),
child: Container(
width: MediaQuery.sizeOf(context).width * 0.95,
decoration: const BoxDecoration(),
child: Column( child: Column(
children: [ children: [
Row( FlutterFlowDropDown<String>(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsetsDirectional.fromSTEB(
0.0, 0.0, 0.0, 5.0),
child: FlutterFlowDropDown<String>(
controller: _model.dropDownValueController ??= controller: _model.dropDownValueController ??=
FormFieldController<String>(null), FormFieldController<String>(null),
options: [ options: [
@ -392,18 +381,16 @@ class _RegisiterVistorTemplateComponentWidgetState
], ],
onChanged: (val) => onChanged: (val) =>
setState(() => _model.dropDownValue = val), setState(() => _model.dropDownValue = val),
width: 200.0, width: MediaQuery.sizeOf(context).width * 0.9,
height: 44.0, // height: 44.0,
textStyle: FlutterFlowTheme.of(context) textStyle: FlutterFlowTheme.of(context)
.bodyMedium .bodyMedium
.override( .override(
fontFamily: FlutterFlowTheme.of(context) fontFamily:
.bodyMediumFamily, FlutterFlowTheme.of(context).bodyMediumFamily,
color: FlutterFlowTheme.of(context) color: FlutterFlowTheme.of(context).primaryText,
.primaryText,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap() useGoogleFonts: GoogleFonts.asMap().containsKey(
.containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.bodyMediumFamily), .bodyMediumFamily),
), ),
@ -412,13 +399,11 @@ class _RegisiterVistorTemplateComponentWidgetState
), ),
icon: Icon( icon: Icon(
Icons.keyboard_arrow_down_rounded, Icons.keyboard_arrow_down_rounded,
color: color: FlutterFlowTheme.of(context).primaryText,
FlutterFlowTheme.of(context).primaryText,
size: 24.0, size: 24.0,
), ),
elevation: 2.0, elevation: 2.0,
borderColor: borderColor: FlutterFlowTheme.of(context).customColor6,
FlutterFlowTheme.of(context).customColor6,
borderWidth: 0.5, borderWidth: 0.5,
borderRadius: 8.0, borderRadius: 8.0,
margin: const EdgeInsetsDirectional.fromSTEB( margin: const EdgeInsetsDirectional.fromSTEB(
@ -428,11 +413,6 @@ class _RegisiterVistorTemplateComponentWidgetState
isSearchable: false, isSearchable: false,
isMultiSelect: false, isMultiSelect: false,
), ),
),
]
.divide(const SizedBox(width: 19.0))
.addToStart(const SizedBox(width: 30.0)),
),
if (_model.dropDownValue == null || if (_model.dropDownValue == null ||
_model.dropDownValue == '') _model.dropDownValue == '')
Align( Align(
@ -459,7 +439,6 @@ class _RegisiterVistorTemplateComponentWidgetState
], ],
), ),
), ),
),
Builder( Builder(
builder: (context) { builder: (context) {
if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) { if ((_model.uploadedLocalFile.bytes?.isNotEmpty ?? false)) {
@ -502,7 +481,7 @@ class _RegisiterVistorTemplateComponentWidgetState
allowPhoto: true, allowPhoto: true,
includeDimensions: true, includeDimensions: true,
); );
if (selectedMedia != null){ if (selectedMedia != null) {
// && // &&
// selectedMedia.every((m) => // selectedMedia.every((m) =>
// validateFileFormat( // validateFileFormat(