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();
|
unfocusNode.dispose();
|
||||||
textFieldFocusNode?.dispose();
|
textFieldFocusNode?.dispose();
|
||||||
textController?.dispose();
|
textController?.dispose();
|
||||||
|
tabBarController?.dispose();
|
||||||
|
|
||||||
|
|
||||||
/// Dispose query cache managers for this widget.
|
/// Dispose query cache managers for this widget.
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,8 @@ class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget> wit
|
||||||
|
|
||||||
_model.tabBarController = TabController(
|
_model.tabBarController = TabController(
|
||||||
vsync: this,
|
vsync: this,
|
||||||
length: 2,
|
length: 4,
|
||||||
initialIndex: 0,
|
initialIndex: 1,
|
||||||
)..addListener(() => setState(() {}));
|
)..addListener(() => setState(() {}));
|
||||||
|
|
||||||
_model.textController ??= TextEditingController();
|
_model.textController ??= TextEditingController();
|
||||||
|
@ -140,13 +140,21 @@ Widget bodyMessage(
|
||||||
padding: const EdgeInsets.all(4.0),
|
padding: const EdgeInsets.all(4.0),
|
||||||
tabs: [
|
tabs: [
|
||||||
Tab(
|
Tab(
|
||||||
text: FFLocalizations.of(context).getText(
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
'ueth1f4g' /* Cadastrar Visita */,
|
ptText: 'Pessoal',
|
||||||
|
enText: 'Personal',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Tab(
|
Tab(
|
||||||
text: FFLocalizations.of(context).getText(
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
'k4uraqam' /* Histórico de Visitas */,
|
enText: 'All',
|
||||||
|
ptText: 'Todos',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Tab(
|
||||||
|
text: FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'Global',
|
||||||
|
enText: 'Global',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
@ -159,8 +167,9 @@ Widget bodyMessage(
|
||||||
Expanded(child: TabBarView(
|
Expanded(child: TabBarView(
|
||||||
controller: _model.tabBarController,
|
controller: _model.tabBarController,
|
||||||
children: [
|
children: [
|
||||||
liberationDynamicListView(context, _model),
|
liberationDynamicListView(context, _model, 'P'),
|
||||||
Container(),
|
liberationDynamicListView(context, _model, 'A'),
|
||||||
|
liberationDynamicListView(context, _model, 'A'),
|
||||||
]
|
]
|
||||||
)),
|
)),
|
||||||
].addToStart(const SizedBox(height: 0)),
|
].addToStart(const SizedBox(height: 0)),
|
||||||
|
@ -174,6 +183,7 @@ Widget bodyMessage(
|
||||||
Widget liberationDynamicListView(
|
Widget liberationDynamicListView(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
MessageHistoryPageModel _model,
|
MessageHistoryPageModel _model,
|
||||||
|
String DestIndex
|
||||||
) {
|
) {
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
|
@ -187,7 +197,7 @@ Widget liberationDynamicListView(
|
||||||
atividade: 'getMensagens',
|
atividade: 'getMensagens',
|
||||||
pageSize: '100',
|
pageSize: '100',
|
||||||
pageNumber: '1',
|
pageNumber: '1',
|
||||||
tipoDestino: 'A',
|
tipoDestino: DestIndex,
|
||||||
),
|
),
|
||||||
|
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
|
@ -258,6 +268,7 @@ Widget liberationDynamicListView(
|
||||||
|
|
||||||
Widget messageHistoryItem(
|
Widget messageHistoryItem(
|
||||||
BuildContext context, dynamic jsonBody) {
|
BuildContext context, dynamic jsonBody) {
|
||||||
|
log(jsonBody.toString());
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
child: Card(
|
child: Card(
|
||||||
|
@ -274,8 +285,13 @@ Widget messageHistoryItem(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15.0),
|
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()),
|
Text(jsonBody['MSG_TEXTO'].toString()),
|
||||||
|
|
Loading…
Reference in New Issue