feat: Update image URL for liberation history item

This commit is contained in:
Jonatas Antunes Messias 2024-07-01 17:20:28 -03:00
parent 2eb0f768f5
commit 6b6bb28c8b
5 changed files with 544 additions and 619 deletions

File diff suppressed because one or more lines are too long

View File

@ -1854,15 +1854,18 @@ class GetAccessCall {
} }
class GetLiberationsCall { class GetLiberationsCall {
Future<ApiCallResponse> call({ Stream<ApiCallResponse> call({
String? devUUID = '', String? devUUID = '',
String? userUUID = '', String? userUUID = '',
String? cliID = '', String? cliID = '',
String? atividade = '', String? atividade = '',
}) async { }) {
final baseUrl = PhpGroup.getBaseUrl(); final baseUrl = PhpGroup.getBaseUrl();
final StreamController<ApiCallResponse> controller = StreamController();
return ApiManager.instance.makeApiCall( Future.microtask(() async {
try {
final response = await ApiManager.instance.makeApiCall(
callName: 'getLiberations', callName: 'getLiberations',
apiUrl: '$baseUrl/processRequest.php', apiUrl: '$baseUrl/processRequest.php',
callType: ApiCallType.POST, callType: ApiCallType.POST,
@ -1883,6 +1886,15 @@ class GetLiberationsCall {
isStreamingApi: false, isStreamingApi: false,
alwaysAllowBody: false, alwaysAllowBody: false,
); );
controller.add(response);
await controller.close();
} catch (e) {
controller.addError(e);
await controller.close();
}
});
return controller.stream;
} }
bool? error(dynamic response) => castToType<bool>(getJsonField( bool? error(dynamic response) => castToType<bool>(getJsonField(

View File

@ -422,8 +422,8 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
'en': 'Search here', 'en': 'Search here',
}, },
'dkzewokx': { 'dkzewokx': {
'pt': 'Date:', 'pt': 'Data:',
'en': 'Shipping:', 'en': 'Date:',
}, },
'2s9avwbq': { '2s9avwbq': {
'pt': 'Motivo:', 'pt': 'Motivo:',
@ -488,6 +488,10 @@ final kTranslationsMap = <Map<String, Map<String, String>>>[
'pt': 'Tipo de Pessoa', 'pt': 'Tipo de Pessoa',
'en': 'Type of Person', 'en': 'Type of Person',
}, },
'zok7lu4w': {
'pt': 'Visitante',
'en': 'Visitor',
},
'oonqk812': { 'oonqk812': {
'pt': 'Morador', 'pt': 'Morador',
'en': 'Resident', 'en': 'Resident',

View File

@ -16,11 +16,11 @@ class LiberationHistoryModel extends FlutterFlowModel<LiberationHistoryWidget> {
/// Query cache managers for this widget. /// Query cache managers for this widget.
final _getLiberationsManager = FutureRequestManager<ApiCallResponse>(); final _getLiberationsManager = StreamRequestManager<ApiCallResponse>();
Future<ApiCallResponse> getLiberations({ Stream<ApiCallResponse> getLiberations({
String? uniqueQueryKey, String? uniqueQueryKey,
bool? overrideCache, bool? overrideCache,
required Future<ApiCallResponse> Function() requestFn, required Stream<ApiCallResponse> Function() requestFn,
}) => }) =>
_getLiberationsManager.performRequest( _getLiberationsManager.performRequest(
uniqueQueryKey: uniqueQueryKey, uniqueQueryKey: uniqueQueryKey,

View File

@ -1,3 +1,5 @@
import 'package:f_r_e_hub/components/templates_components/visit_request_template_component/visit_request_template_component_widget.dart';
import '/backend/api_requests/api_calls.dart'; import '/backend/api_requests/api_calls.dart';
import '/flutter_flow/flutter_flow_icon_button.dart'; import '/flutter_flow/flutter_flow_icon_button.dart';
import '/flutter_flow/flutter_flow_theme.dart'; import '/flutter_flow/flutter_flow_theme.dart';
@ -43,7 +45,6 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
context.watch<FFAppState>(); context.watch<FFAppState>();
return GestureDetector( return GestureDetector(
onTap: () => _model.unfocusNode.canRequestFocus onTap: () => _model.unfocusNode.canRequestFocus
? FocusScope.of(context).requestFocus(_model.unfocusNode) ? FocusScope.of(context).requestFocus(_model.unfocusNode)
@ -51,7 +52,15 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
child: Scaffold( child: Scaffold(
key: scaffoldKey, key: scaffoldKey,
backgroundColor: FlutterFlowTheme.of(context).primaryBackground, backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
appBar: AppBar( appBar: appBarLiberationHistoryPage(context),
body: bodyLiberationHistoryPage(context, _model),
),
);
}
}
PreferredSizeWidget appBarLiberationHistoryPage(BuildContext context) {
return AppBar(
backgroundColor: FlutterFlowTheme.of(context).primaryBackground, backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
automaticallyImplyLeading: false, automaticallyImplyLeading: false,
leading: FlutterFlowIconButton( leading: FlutterFlowIconButton(
@ -82,79 +91,84 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
), ),
actions: const [], actions: const [],
centerTitle: true, centerTitle: true,
), );
body: SafeArea( }
Widget bodyLiberationHistoryPage(
BuildContext context, LiberationHistoryModel _model) {
return SafeArea(
top: true, top: true,
child: Column( child: Stack(
children: [
liberationDynamicListViw(context, _model),
searchBarContainer(context, _model),
].addToStart(const SizedBox(height: 0)),
),
);
}
Widget searchBarContainer(BuildContext context, LiberationHistoryModel _model) {
return Column(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Container( Row(
width: double.infinity, mainAxisSize: MainAxisSize.max,
height: 100.0, mainAxisAlignment: MainAxisAlignment.center,
decoration: BoxDecoration( children: [
color: FlutterFlowTheme.of(context).secondaryBackground, Padding(
), padding: const EdgeInsetsDirectional.fromSTEB(8.0, 8.0, 8.0, 8.0),
alignment: const AlignmentDirectional(0.0, -1.0),
child: Padding(
padding:
const EdgeInsetsDirectional.fromSTEB(8.0, 0.0, 8.0, 0.0),
child: SizedBox( child: SizedBox(
width: 300.0, width: 300.0,
height: 40.0,
child: TextFormField( child: TextFormField(
controller: _model.textController, controller: _model.textController,
focusNode: _model.textFieldFocusNode, focusNode: _model.textFieldFocusNode,
autofocus: true, autofocus: false,
obscureText: false, obscureText: false,
decoration: InputDecoration( decoration: InputDecoration(
isDense: true, isDense: true,
labelText: FFLocalizations.of(context).getText( labelText: FFLocalizations.of(context).getText(
'dy0mx15f' /* Pesquise aqui */, 'dy0mx15f' /* Pesquise aqui */,
), ),
labelStyle: FlutterFlowTheme.of(context) labelStyle: FlutterFlowTheme.of(context).labelMedium.override(
.labelMedium fontFamily:
.override( FlutterFlowTheme.of(context).labelMediumFamily,
fontFamily: FlutterFlowTheme.of(context)
.labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context).labelMediumFamily),
.labelMediumFamily),
), ),
hintStyle: FlutterFlowTheme.of(context) hintStyle: FlutterFlowTheme.of(context).labelMedium.override(
.labelMedium fontFamily:
.override( FlutterFlowTheme.of(context).labelMediumFamily,
fontFamily: FlutterFlowTheme.of(context)
.labelMediumFamily,
color: FlutterFlowTheme.of(context).primaryText, color: FlutterFlowTheme.of(context).primaryText,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context).labelMediumFamily),
.labelMediumFamily),
), ),
enabledBorder: UnderlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: FlutterFlowTheme.of(context).alternate, color: FlutterFlowTheme.of(context).alternate,
width: 2.0, width: 2.0,
), ),
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
), ),
focusedBorder: UnderlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: FlutterFlowTheme.of(context).primary, color: FlutterFlowTheme.of(context).primary,
width: 2.0, width: 2.0,
), ),
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
), ),
errorBorder: UnderlineInputBorder( errorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error, color: FlutterFlowTheme.of(context).error,
width: 2.0, width: 2.0,
), ),
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
), ),
focusedErrorBorder: UnderlineInputBorder( focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: FlutterFlowTheme.of(context).error, color: FlutterFlowTheme.of(context).error,
width: 2.0, width: 2.0,
@ -169,25 +183,30 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
), ),
), ),
style: FlutterFlowTheme.of(context).bodyMedium.override( style: FlutterFlowTheme.of(context).bodyMedium.override(
fontFamily: fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
FlutterFlowTheme.of(context).bodyMediumFamily,
letterSpacing: 0.0, letterSpacing: 0.0,
useGoogleFonts: GoogleFonts.asMap().containsKey( useGoogleFonts: GoogleFonts.asMap().containsKey(
FlutterFlowTheme.of(context).bodyMediumFamily), FlutterFlowTheme.of(context).bodyMediumFamily),
), ),
validator: validator: _model.textControllerValidator.asValidator(context),
_model.textControllerValidator.asValidator(context),
), ),
), ),
), ),
],
), ),
Expanded( ].addToStart(const SizedBox(height: 0)),
);
}
Widget liberationDynamicListViw(
BuildContext context, LiberationHistoryModel _model) {
return Expanded(
child: Container( child: Container(
width: double.infinity, width: double.infinity,
height: double.infinity, height: double.infinity,
decoration: const BoxDecoration(), decoration: const BoxDecoration(),
child: FutureBuilder<ApiCallResponse>( child: StreamBuilder<ApiCallResponse>(
future: _model.getLiberations( stream: _model.getLiberations(
requestFn: () => PhpGroup.getLiberationsCall.call( requestFn: () => PhpGroup.getLiberationsCall.call(
devUUID: FFAppState().devUUID, devUUID: FFAppState().devUUID,
userUUID: FFAppState().userUUID, userUUID: FFAppState().userUUID,
@ -196,7 +215,6 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
), ),
), ),
builder: (context, snapshot) { builder: (context, snapshot) {
// Customize what your widget looks like when it's loading.
if (!snapshot.hasData) { if (!snapshot.hasData) {
return Center( return Center(
child: SizedBox( child: SizedBox(
@ -210,28 +228,74 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
); );
} }
final columnGetLiberationsResponse = snapshot.data!; final columnGetLiberationsResponse = snapshot.data!;
return Builder(
builder: (context) {
final liberationHistory = PhpGroup.getLiberationsCall final liberationHistory = PhpGroup.getLiberationsCall
.rqList( .rqList(
columnGetLiberationsResponse.jsonBody, columnGetLiberationsResponse.jsonBody,
) )
?.toList() ?? ?.toList() ??
[]; [];
return SingleChildScrollView( final filteredLiberationHistory =
child: Column( _model.textController.text.isNotEmpty
mainAxisSize: MainAxisSize.max, ? liberationHistory
children: List.generate(liberationHistory.length, .where((item) => functions
(liberationHistoryIndex) { .jsonToStr(getJsonField(
final liberationHistoryItem = item,
liberationHistory[liberationHistoryIndex]; r'''$.VTE_NOME''',
return Align( ))
alignment: .toLowerCase()
const AlignmentDirectional(0.0, 0.0), .contains(
_model.textController.text.toLowerCase(),
))
.toList()
: liberationHistory;
return ListView.builder(
itemCount: filteredLiberationHistory.length,
addAutomaticKeepAlives: false,
addRepaintBoundaries: true,
cacheExtent: 1000.0,
itemBuilder: (BuildContext context, int index) {
final liberationHistoryItem = filteredLiberationHistory[index];
return Padding(
padding: EdgeInsets.only(
top: index == 0 ? 60.0 : 8.0,
left: 8.0,
right: 8.0,
bottom: 8.0,
),
child: Align(
alignment: AlignmentDirectional(0.0, 0.0),
child: liberationHistoryItemCard(
context,
liberationHistoryItem,
),
),
);
},
);
},
),
),
);
}
Widget liberationHistoryItemCard(
BuildContext context, dynamic liberationHistoryItem) {
return InkWell(
onTap: () {
showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
useSafeArea: true,
context: context,
builder: (context) {
return const VisitRequestTemplateComponentWidget();
},
);
},
child: Card( child: Card(
clipBehavior: Clip.antiAliasWithSaveLayer, clipBehavior: Clip.antiAliasWithSaveLayer,
color: FlutterFlowTheme.of(context) color: FlutterFlowTheme.of(context).secondaryBackground,
.secondaryBackground,
elevation: 5.0, elevation: 5.0,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0), borderRadius: BorderRadius.circular(8.0),
@ -240,32 +304,26 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
width: 350.0, width: 350.0,
height: 115.0, height: 115.0,
decoration: BoxDecoration( decoration: BoxDecoration(
color: FlutterFlowTheme.of(context) color: FlutterFlowTheme.of(context).secondaryBackground,
.secondaryBackground,
), ),
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Padding( Padding(
padding: const EdgeInsetsDirectional padding:
.fromSTEB(0.0, 0.0, 10.0, 0.0), const EdgeInsetsDirectional.fromSTEB(0.0, 0.0, 10.0, 0.0),
child: ClipRRect( child: ClipRRect(
borderRadius: borderRadius: BorderRadius.circular(100.0),
BorderRadius.circular(100.0),
child: CachedNetworkImage( child: CachedNetworkImage(
fadeInDuration: const Duration( fadeInDuration: const Duration(milliseconds: 500),
milliseconds: 500), fadeOutDuration: const Duration(milliseconds: 500),
fadeOutDuration: const Duration( imageUrl: valueOrDefault<String>(
milliseconds: 500), "https://freaccess.com.br/freaccess/getImage.php?&cliID=${FFAppState().cliUUID}&atividade=getFoto&Documento=${getJsonField(
imageUrl:
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,
@ -281,91 +339,61 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: [ children: [
Row( Row(
mainAxisSize: mainAxisSize: MainAxisSize.max,
MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment
.center,
children: [ children: [
Align( Align(
alignment: alignment: const AlignmentDirectional(-1.0, -1.0),
const AlignmentDirectional(
-1.0, -1.0),
child: Text( child: Text(
getJsonField( getJsonField(
liberationHistoryItem, liberationHistoryItem,
r'''$.VTE_NOME''', r'''$.VTE_NOME''',
).toString(), ).toString(),
style: FlutterFlowTheme style: FlutterFlowTheme.of(context)
.of(context)
.bodyMedium .bodyMedium
.override( .override(
fontFamily: FlutterFlowTheme.of( fontFamily: FlutterFlowTheme.of(context)
context)
.bodyMediumFamily, .bodyMediumFamily,
fontSize: 12.5, fontSize: 12.5,
letterSpacing: letterSpacing: 0.0,
0.0, fontWeight: FontWeight.bold,
fontWeight: useGoogleFonts: GoogleFonts.asMap()
FontWeight .containsKey(FlutterFlowTheme.of(context)
.bold,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey(
FlutterFlowTheme.of(context)
.bodyMediumFamily), .bodyMediumFamily),
), ),
), ),
), ),
] ]
.addToStart( .addToStart(const SizedBox(width: 10.0))
const SizedBox( .addToEnd(const SizedBox(width: 10.0)),
width: 10.0))
.addToEnd(
const SizedBox(
width: 10.0)),
), ),
Row( Row(
mainAxisSize: mainAxisSize: MainAxisSize.max,
MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Text( Text(
FFLocalizations.of( FFLocalizations.of(context).getText(
context)
.getText(
'dkzewokx' /* Date: */, 'dkzewokx' /* Date: */,
), ),
style: style: FlutterFlowTheme.of(context)
FlutterFlowTheme.of(
context)
.bodyMedium .bodyMedium
.override( .override(
fontFamily: FlutterFlowTheme.of( fontFamily: FlutterFlowTheme.of(context)
context)
.bodyMediumFamily, .bodyMediumFamily,
fontSize: fontSize: 12.5,
12.5, letterSpacing: 0.0,
letterSpacing: fontWeight: FontWeight.bold,
0.0, useGoogleFonts: GoogleFonts.asMap().containsKey(
fontWeight:
FontWeight
.bold,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.bodyMediumFamily), .bodyMediumFamily),
), ),
), ),
Text( Text(
(functions.jsonToStr( (functions.jsonToStr(getJsonField(
getJsonField(
liberationHistoryItem, liberationHistoryItem,
r'''$.NOT_STATUS''', r'''$.NOT_STATUS''',
)) == )) ==
'\"L\"' '"L"'
? getJsonField( ? getJsonField(
liberationHistoryItem, liberationHistoryItem,
r'''$.NOT_DTRESPOSTA''', r'''$.NOT_DTRESPOSTA''',
@ -375,62 +403,39 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
r'''$.NOT_DTENVIO''', r'''$.NOT_DTENVIO''',
)) ))
.toString(), .toString(),
style: style: FlutterFlowTheme.of(context)
FlutterFlowTheme.of(
context)
.bodyMedium .bodyMedium
.override( .override(
fontFamily: FlutterFlowTheme.of( fontFamily: FlutterFlowTheme.of(context)
context)
.bodyMediumFamily, .bodyMediumFamily,
fontSize: fontSize: 12.5,
12.5, letterSpacing: 0.0,
letterSpacing: useGoogleFonts: GoogleFonts.asMap().containsKey(
0.0,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.bodyMediumFamily), .bodyMediumFamily),
), ),
), ),
] ]
.divide(const SizedBox( .divide(const SizedBox(width: 10.0))
width: 10.0)) .addToStart(const SizedBox(width: 10.0)),
.addToStart(
const SizedBox(
width: 10.0)),
), ),
Row( Row(
mainAxisSize: mainAxisSize: MainAxisSize.max,
MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Text( Text(
FFLocalizations.of( FFLocalizations.of(context).getText(
context)
.getText(
'2s9avwbq' /* Motivo: */, '2s9avwbq' /* Motivo: */,
), ),
style: style: FlutterFlowTheme.of(context)
FlutterFlowTheme.of(
context)
.bodyMedium .bodyMedium
.override( .override(
fontFamily: FlutterFlowTheme.of( fontFamily: FlutterFlowTheme.of(context)
context)
.bodyMediumFamily, .bodyMediumFamily,
fontSize: fontSize: 12.5,
12.5, letterSpacing: 0.0,
letterSpacing: fontWeight: FontWeight.bold,
0.0, useGoogleFonts: GoogleFonts.asMap().containsKey(
fontWeight:
FontWeight
.bold,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.bodyMediumFamily), .bodyMediumFamily),
), ),
@ -440,175 +445,95 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
liberationHistoryItem, liberationHistoryItem,
r'''$.NOT_MOTIVO''', r'''$.NOT_MOTIVO''',
).toString(), ).toString(),
style: style: FlutterFlowTheme.of(context)
FlutterFlowTheme.of(
context)
.bodyMedium .bodyMedium
.override( .override(
fontFamily: FlutterFlowTheme.of( fontFamily: FlutterFlowTheme.of(context)
context)
.bodyMediumFamily, .bodyMediumFamily,
fontSize: fontSize: 12.5,
12.5, letterSpacing: 0.0,
letterSpacing: useGoogleFonts: GoogleFonts.asMap().containsKey(
0.0,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.bodyMediumFamily), .bodyMediumFamily),
), ),
), ),
] ]
.divide(const SizedBox( .divide(const SizedBox(width: 10.0))
width: 10.0)) .addToStart(const SizedBox(width: 10.0)),
.addToStart(
const SizedBox(
width: 10.0)),
), ),
Align( Align(
alignment: alignment: const AlignmentDirectional(-1.0, 0.0),
const AlignmentDirectional(
-1.0, 0.0),
child: Padding( child: Padding(
padding: padding: const EdgeInsetsDirectional.fromSTEB(
const EdgeInsetsDirectional 10.0, 0.0, 0.0, 0.0),
.fromSTEB(10.0,
0.0, 0.0, 0.0),
child: Container( child: Container(
width: 200.0, width: 200.0,
height: 27.0, height: 27.0,
decoration: decoration: BoxDecoration(
BoxDecoration( color: valueOrDefault<Color>(
color: valueOrDefault<
Color>(
() { () {
if (functions if (liberationHistoryItem["NOT_STATUS"] ==
.jsonToStr( 'L') {
getJsonField( return FlutterFlowTheme.of(context).success;
liberationHistoryItem, } else if (liberationHistoryItem[
r'''$.VAW_STATUS''', "NOT_STATUS"] ==
)) == 'B') {
'\"L\"') { return FlutterFlowTheme.of(context).error;
return FlutterFlowTheme.of( } else if (liberationHistoryItem[
context) "NOT_STATUS"] ==
.success; 'S') {
} else if (functions return FlutterFlowTheme.of(context).warning;
.jsonToStr(
getJsonField(
liberationHistoryItem,
r'''$.VAW_STATUS''',
)) ==
'\"B\"') {
return FlutterFlowTheme.of(
context)
.error;
} else if (functions
.jsonToStr(
getJsonField(
liberationHistoryItem,
r'''$.VAW_STATUS''',
)) ==
'\"S\"') {
return FlutterFlowTheme.of(
context)
.warning;
} else { } else {
return FlutterFlowTheme.of( return FlutterFlowTheme.of(context).primary;
context)
.primary;
} }
}(), }(),
FlutterFlowTheme.of( FlutterFlowTheme.of(context).primary,
context)
.primary,
), ),
borderRadius: borderRadius: BorderRadius.circular(5.0),
BorderRadius
.circular(
5.0),
), ),
child: Align( child: Align(
alignment: alignment: const AlignmentDirectional(0.0, 0.0),
const AlignmentDirectional(
0.0, 0.0),
child: Text( child: Text(
'${FFLocalizations.of(context).getVariableText( "${() {
ptText: if (liberationHistoryItem["NOT_STATUS"] ==
'Liberação', 'L') {
enText: return FFLocalizations.of(context)
'Liberation',
)}${() {
if (functions
.jsonToStr(
getJsonField(
liberationHistoryItem,
r'''$.NOT_STATUS''',
)) ==
'\"L\"') {
return FFLocalizations.of(
context)
.getVariableText( .getVariableText(
ptText: ptText: 'Ativa',
'Ativa', enText: 'Active',
enText:
'Active',
); );
} else if (functions } else if (liberationHistoryItem[
.jsonToStr( "NOT_STATUS"] ==
getJsonField( 'B') {
liberationHistoryItem, return FFLocalizations.of(context)
r'''$.NOT_STATUS''',
)) ==
'\"B\"') {
return FFLocalizations.of(
context)
.getVariableText( .getVariableText(
ptText: ptText: 'Bloqueada',
'Bloqueada', enText: 'Blocked',
enText:
'Blocked',
); );
} else if (functions } else if (liberationHistoryItem[
.jsonToStr( "NOT_STATUS"] ==
getJsonField( 'S') {
liberationHistoryItem, return FFLocalizations.of(context)
r'''$.NOT_STATUS''',
)) ==
'\"S\"') {
return FFLocalizations.of(
context)
.getVariableText( .getVariableText(
ptText: ptText: 'Pendente',
'Pendente', enText: 'Pending',
enText:
'Warning',
); );
} else { } else {
return FFLocalizations.of( return FFLocalizations.of(context)
context)
.getVariableText( .getVariableText(
ptText: ptText: 'Desconhecida',
'Desconhecida', enText: 'Unknow',
enText:
'Unknow',
); );
} }
}()}', }()}",
style: FlutterFlowTheme style: FlutterFlowTheme.of(context)
.of(context)
.bodyMedium .bodyMedium
.override( .override(
fontFamily: FlutterFlowTheme.of( fontFamily: FlutterFlowTheme.of(context)
context)
.bodyMediumFamily, .bodyMediumFamily,
color: FlutterFlowTheme.of( color: FlutterFlowTheme.of(context).info,
context) letterSpacing: 0.0,
.info, useGoogleFonts: GoogleFonts.asMap()
letterSpacing:
0.0,
useGoogleFonts: GoogleFonts
.asMap()
.containsKey( .containsKey(
FlutterFlowTheme.of(context) FlutterFlowTheme.of(context)
.bodyMediumFamily), .bodyMediumFamily),
@ -618,8 +543,7 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
), ),
), ),
), ),
].divide(const SizedBox( ].divide(const SizedBox(height: 3.0)),
height: 3.0)),
), ),
), ),
), ),
@ -628,19 +552,4 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
), ),
), ),
); );
}),
),
);
},
);
},
),
),
),
].addToStart(const SizedBox(height: 30.0)),
),
),
),
);
}
} }