Refactor QR code generation and error handling
This commit is contained in:
parent
0f41eba57f
commit
f7e85cea0b
|
@ -47,6 +47,8 @@ class MessageHistoryPageModel extends FlutterFlowModel<MessageHistoryPageWidget>
|
|||
unfocusNode.dispose();
|
||||
textFieldFocusNode?.dispose();
|
||||
textController?.dispose();
|
||||
tabBarController?.dispose();
|
||||
|
||||
|
||||
/// Dispose query cache managers for this widget.
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget> wit
|
|||
|
||||
_model.tabBarController = TabController(
|
||||
vsync: this,
|
||||
length: 2,
|
||||
initialIndex: 0,
|
||||
length: 4,
|
||||
initialIndex: 1,
|
||||
)..addListener(() => setState(() {}));
|
||||
|
||||
_model.textController ??= TextEditingController();
|
||||
|
@ -123,7 +123,7 @@ Widget bodyMessage(
|
|||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Align(
|
||||
Align(
|
||||
alignment: const Alignment(0.0, 0),
|
||||
child: TabBar(
|
||||
labelColor: FlutterFlowTheme.of(context).primaryText,
|
||||
|
@ -140,13 +140,21 @@ Widget bodyMessage(
|
|||
padding: const EdgeInsets.all(4.0),
|
||||
tabs: [
|
||||
Tab(
|
||||
text: FFLocalizations.of(context).getText(
|
||||
'ueth1f4g' /* Cadastrar Visita */,
|
||||
text: FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Pessoal',
|
||||
enText: 'Personal',
|
||||
),
|
||||
),
|
||||
Tab(
|
||||
text: FFLocalizations.of(context).getText(
|
||||
'k4uraqam' /* Histórico de Visitas */,
|
||||
text: FFLocalizations.of(context).getVariableText(
|
||||
enText: 'All',
|
||||
ptText: 'Todos',
|
||||
),
|
||||
),
|
||||
Tab(
|
||||
text: FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Global',
|
||||
enText: 'Global',
|
||||
),
|
||||
),
|
||||
],
|
||||
|
@ -159,8 +167,9 @@ Widget bodyMessage(
|
|||
Expanded(child: TabBarView(
|
||||
controller: _model.tabBarController,
|
||||
children: [
|
||||
liberationDynamicListView(context, _model),
|
||||
Container(),
|
||||
liberationDynamicListView(context, _model, 'P'),
|
||||
liberationDynamicListView(context, _model, 'A'),
|
||||
liberationDynamicListView(context, _model, 'A'),
|
||||
]
|
||||
)),
|
||||
].addToStart(const SizedBox(height: 0)),
|
||||
|
@ -174,6 +183,7 @@ Widget bodyMessage(
|
|||
Widget liberationDynamicListView(
|
||||
BuildContext context,
|
||||
MessageHistoryPageModel _model,
|
||||
String DestIndex
|
||||
) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
|
@ -187,7 +197,7 @@ Widget liberationDynamicListView(
|
|||
atividade: 'getMensagens',
|
||||
pageSize: '100',
|
||||
pageNumber: '1',
|
||||
tipoDestino: 'A',
|
||||
tipoDestino: DestIndex,
|
||||
),
|
||||
|
||||
builder: (context, snapshot) {
|
||||
|
@ -258,6 +268,7 @@ Widget liberationDynamicListView(
|
|||
|
||||
Widget messageHistoryItem(
|
||||
BuildContext context, dynamic jsonBody) {
|
||||
log(jsonBody.toString());
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||
child: Card(
|
||||
|
@ -274,8 +285,13 @@ Widget messageHistoryItem(
|
|||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
||||
child: Text(jsonBody['MSG_ORIGEM_DESC'].toString()),
|
||||
child: Text(jsonBody['MSG_ORIGEM_DESC'].toString(), style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
color: FlutterFlowTheme.of(context).primary,
|
||||
),),
|
||||
),
|
||||
Icon(jsonBody['MSG_ORIGEM'] == '20'? Icons.person : Icons.group),
|
||||
],
|
||||
),
|
||||
Text(jsonBody['MSG_TEXTO'].toString()),
|
||||
|
|
Loading…
Reference in New Issue