feat: Update image URL for liberation history item

This commit is contained in:
Jonatas Antunes Messias 2024-07-01 13:01:07 -03:00
commit 2eb0f768f5
2 changed files with 375 additions and 368 deletions

View File

@ -44,8 +44,8 @@
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
6436409F27A31CDD00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 6436409E27A31CDF00820AF7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/InfoPlist.strings; sourceTree = "<group>"; };
6436409827A31CDC00820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; }; 6436409F27A31CD200820AF7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
@ -225,8 +225,8 @@
6436409C27A31CD800820AF7 /* InfoPlist.strings */ = { 6436409C27A31CD800820AF7 /* InfoPlist.strings */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
6436409F27A31CDD00820AF7 /* pt */, 6436409E27A31CDF00820AF7 /* pt */,
6436409827A31CDC00820AF7 /* en */, 6436409F27A31CD200820AF7 /* en */,
); );
name = InfoPlist.strings; name = InfoPlist.strings;
sourceTree = "<group>"; sourceTree = "<group>";

View File

@ -209,30 +209,25 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
), ),
); );
} }
final wrapGetLiberationsResponse = snapshot.data!; final columnGetLiberationsResponse = snapshot.data!;
return Builder( return Builder(
builder: (context) { builder: (context) {
final liberationHistory = PhpGroup.getLiberationsCall final liberationHistory = PhpGroup.getLiberationsCall
.rqList( .rqList(
wrapGetLiberationsResponse.jsonBody, columnGetLiberationsResponse.jsonBody,
) )
?.toList() ?? ?.toList() ??
[]; [];
return Wrap( return SingleChildScrollView(
spacing: 2.0, child: Column(
runSpacing: 1.0, mainAxisSize: MainAxisSize.max,
alignment: WrapAlignment.start,
crossAxisAlignment: WrapCrossAlignment.start,
direction: Axis.horizontal,
runAlignment: WrapAlignment.start,
verticalDirection: VerticalDirection.down,
clipBehavior: Clip.none,
children: List.generate(liberationHistory.length, children: List.generate(liberationHistory.length,
(liberationHistoryIndex) { (liberationHistoryIndex) {
final liberationHistoryItem = final liberationHistoryItem =
liberationHistory[liberationHistoryIndex]; liberationHistory[liberationHistoryIndex];
return Align( return Align(
alignment: const AlignmentDirectional(0.0, 0.0), alignment:
const AlignmentDirectional(0.0, 0.0),
child: Card( child: Card(
clipBehavior: Clip.antiAliasWithSaveLayer, clipBehavior: Clip.antiAliasWithSaveLayer,
color: FlutterFlowTheme.of(context) color: FlutterFlowTheme.of(context)
@ -264,12 +259,13 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
milliseconds: 500), milliseconds: 500),
fadeOutDuration: const Duration( fadeOutDuration: const Duration(
milliseconds: 500), milliseconds: 500),
imageUrl: valueOrDefault<String>( imageUrl:
"https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField( valueOrDefault<String>(
'https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
liberationHistoryItem, liberationHistoryItem,
r'''$.VTE_ID''', r'''$.VTE_ID''',
).toString()}&tipo=E", ).toString()}&tipo=E',
"https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg", 'https://storage.googleapis.com/flutterflow-io-6f20.appspot.com/projects/flutter-freaccess-hub-0xgz9q/assets/7ftdetkzc3s0/360_F_64676383_LdbmhiNM6Ypzb3FM4PPuFP9rHe7ri8Ju.jpg',
), ),
width: 80.0, width: 80.0,
fit: BoxFit.cover, fit: BoxFit.cover,
@ -288,7 +284,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
mainAxisSize: mainAxisSize:
MainAxisSize.max, MainAxisSize.max,
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment
.center,
children: [ children: [
Align( Align(
alignment: alignment:
@ -299,16 +296,14 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
liberationHistoryItem, liberationHistoryItem,
r'''$.VTE_NOME''', r'''$.VTE_NOME''',
).toString(), ).toString(),
style: style: FlutterFlowTheme
FlutterFlowTheme.of( .of(context)
context)
.bodyMedium .bodyMedium
.override( .override(
fontFamily: FlutterFlowTheme.of( fontFamily: FlutterFlowTheme.of(
context) context)
.bodyMediumFamily, .bodyMediumFamily,
fontSize: fontSize: 12.5,
12.5,
letterSpacing: letterSpacing:
0.0, 0.0,
fontWeight: fontWeight:
@ -326,7 +321,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
.addToStart( .addToStart(
const SizedBox( const SizedBox(
width: 10.0)) width: 10.0))
.addToEnd(const SizedBox( .addToEnd(
const SizedBox(
width: 10.0)), width: 10.0)),
), ),
Row( Row(
@ -349,7 +345,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
fontFamily: FlutterFlowTheme.of( fontFamily: FlutterFlowTheme.of(
context) context)
.bodyMediumFamily, .bodyMediumFamily,
fontSize: 12.5, fontSize:
12.5,
letterSpacing: letterSpacing:
0.0, 0.0,
fontWeight: fontWeight:
@ -386,7 +383,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
fontFamily: FlutterFlowTheme.of( fontFamily: FlutterFlowTheme.of(
context) context)
.bodyMediumFamily, .bodyMediumFamily,
fontSize: 12.5, fontSize:
12.5,
letterSpacing: letterSpacing:
0.0, 0.0,
useGoogleFonts: GoogleFonts useGoogleFonts: GoogleFonts
@ -423,7 +421,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
fontFamily: FlutterFlowTheme.of( fontFamily: FlutterFlowTheme.of(
context) context)
.bodyMediumFamily, .bodyMediumFamily,
fontSize: 12.5, fontSize:
12.5,
letterSpacing: letterSpacing:
0.0, 0.0,
fontWeight: fontWeight:
@ -449,7 +448,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
fontFamily: FlutterFlowTheme.of( fontFamily: FlutterFlowTheme.of(
context) context)
.bodyMediumFamily, .bodyMediumFamily,
fontSize: 12.5, fontSize:
12.5,
letterSpacing: letterSpacing:
0.0, 0.0,
useGoogleFonts: GoogleFonts useGoogleFonts: GoogleFonts
@ -473,23 +473,25 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
child: Padding( child: Padding(
padding: padding:
const EdgeInsetsDirectional const EdgeInsetsDirectional
.fromSTEB(10.0, 0.0, .fromSTEB(10.0,
0.0, 0.0), 0.0, 0.0, 0.0),
child: Container( child: Container(
width: 200.0, width: 200.0,
height: 27.0, height: 27.0,
decoration: BoxDecoration( decoration:
BoxDecoration(
color: valueOrDefault< color: valueOrDefault<
Color>( Color>(
() { () {
if (functions.jsonToStr( if (functions
.jsonToStr(
getJsonField( getJsonField(
liberationHistoryItem, liberationHistoryItem,
r'''$.VAW_STATUS''', r'''$.VAW_STATUS''',
)) == )) ==
'\"L\"') { '\"L\"') {
return FlutterFlowTheme return FlutterFlowTheme.of(
.of(context) context)
.success; .success;
} else if (functions } else if (functions
.jsonToStr( .jsonToStr(
@ -498,8 +500,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
r'''$.VAW_STATUS''', r'''$.VAW_STATUS''',
)) == )) ==
'\"B\"') { '\"B\"') {
return FlutterFlowTheme return FlutterFlowTheme.of(
.of(context) context)
.error; .error;
} else if (functions } else if (functions
.jsonToStr( .jsonToStr(
@ -508,12 +510,12 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
r'''$.VAW_STATUS''', r'''$.VAW_STATUS''',
)) == )) ==
'\"S\"') { '\"S\"') {
return FlutterFlowTheme return FlutterFlowTheme.of(
.of(context) context)
.warning; .warning;
} else { } else {
return FlutterFlowTheme return FlutterFlowTheme.of(
.of(context) context)
.primary; .primary;
} }
}(), }(),
@ -523,7 +525,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
), ),
borderRadius: borderRadius:
BorderRadius BorderRadius
.circular(5.0), .circular(
5.0),
), ),
child: Align( child: Align(
alignment: alignment:
@ -531,20 +534,23 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
0.0, 0.0), 0.0, 0.0),
child: Text( child: Text(
'${FFLocalizations.of(context).getVariableText( '${FFLocalizations.of(context).getVariableText(
ptText: 'Liberação', ptText:
'Liberação',
enText: enText:
'Liberation', 'Liberation',
)}${() { )}${() {
if (functions.jsonToStr( if (functions
.jsonToStr(
getJsonField( getJsonField(
liberationHistoryItem, liberationHistoryItem,
r'''$.NOT_STATUS''', r'''$.NOT_STATUS''',
)) == )) ==
'\"L\"') { '\"L\"') {
return FFLocalizations return FFLocalizations.of(
.of(context) context)
.getVariableText( .getVariableText(
ptText: 'Ativa', ptText:
'Ativa',
enText: enText:
'Active', 'Active',
); );
@ -555,8 +561,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
r'''$.NOT_STATUS''', r'''$.NOT_STATUS''',
)) == )) ==
'\"B\"') { '\"B\"') {
return FFLocalizations return FFLocalizations.of(
.of(context) context)
.getVariableText( .getVariableText(
ptText: ptText:
'Bloqueada', 'Bloqueada',
@ -570,8 +576,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
r'''$.NOT_STATUS''', r'''$.NOT_STATUS''',
)) == )) ==
'\"S\"') { '\"S\"') {
return FFLocalizations return FFLocalizations.of(
.of(context) context)
.getVariableText( .getVariableText(
ptText: ptText:
'Pendente', 'Pendente',
@ -579,8 +585,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
'Warning', 'Warning',
); );
} else { } else {
return FFLocalizations return FFLocalizations.of(
.of(context) context)
.getVariableText( .getVariableText(
ptText: ptText:
'Desconhecida', 'Desconhecida',
@ -612,8 +618,8 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
), ),
), ),
), ),
].divide( ].divide(const SizedBox(
const SizedBox(height: 3.0)), height: 3.0)),
), ),
), ),
), ),
@ -623,6 +629,7 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
), ),
); );
}), }),
),
); );
}, },
); );