fix: reponsividade das novas telas
This commit is contained in:
parent
4de6f215d0
commit
5e10f6cc65
|
@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart';
|
|||
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
||||
import 'package:hub/shared/helpers/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:hub/shared/utils/log_util.dart';
|
||||
import 'package:hub/shared/utils/validator_util.dart';
|
||||
|
||||
|
@ -731,7 +730,7 @@ class LoginCall {
|
|||
late final String token;
|
||||
try {
|
||||
token = await FirebaseMessagingService.getToken();
|
||||
if (token == null || token.isEmpty) throw Exception('Token is empty');
|
||||
if (token == 'null' || token.isEmpty) throw Exception('Token is empty');
|
||||
} catch (e, s) {
|
||||
token = '';
|
||||
log('Error getting token', error: e, stackTrace: s);
|
||||
|
|
|
@ -3,8 +3,6 @@ import 'package:google_fonts/google_fonts.dart';
|
|||
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
|
||||
import '../../../shared/extensions/dialog_extensions.dart';
|
||||
import '../../../shared/services/localization/localization_service.dart';
|
||||
|
||||
class MenuButtonWidget extends MenuEntry {
|
||||
const MenuButtonWidget({
|
||||
|
|
|
@ -3,8 +3,6 @@ import 'package:google_fonts/google_fonts.dart';
|
|||
import 'package:hub/components/molecular_components/menu_item/menu_item.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
|
||||
import '../../../shared/extensions/dialog_extensions.dart';
|
||||
import '../../../shared/services/localization/localization_service.dart';
|
||||
|
||||
class MenuCardItem extends MenuEntry {
|
||||
const MenuCardItem({
|
||||
|
|
|
@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
|
|||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||
import 'package:hub/flutter_flow/upload_data.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import 'package:hub/pages/forgot_password_page/forgot_password_screen.dart';
|
|||
import 'package:hub/shared/helpers/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||
import 'package:hub/shared/services/localization/localization_service.dart';
|
||||
import 'package:hub/shared/utils/device_util.dart';
|
||||
import 'package:responsive_framework/responsive_framework.dart';
|
||||
|
||||
import 'backend/notifications/firebase_messaging_service.dart';
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// ignore_for_file: unused_field
|
||||
|
||||
import 'dart:io' show Platform;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'package:hub/backend/notifications/firebase_messaging_service.dart';
|
||||
import 'package:hub/backend/schema/enums/enums.dart';
|
||||
import 'package:hub/components/organism_components/local_profile_component/local_profile_component_widget.dart';
|
||||
import 'package:hub/components/organism_components/menu_component/menu_component_widget.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_icon_button.dart';
|
||||
|
|
|
@ -412,6 +412,7 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
appBar: _appBar(context),
|
||||
body: _appBody(context),
|
||||
);
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
|||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/pages/people_on_the_property_page/people_on_the_property_page_model.dart';
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||
import 'package:hub/shared/utils/log_util.dart';
|
||||
|
||||
class PeopleOnThePropertyPage extends StatefulWidget {
|
||||
|
@ -23,8 +24,6 @@ class _PeopleOnThePropertyPageState extends State<PeopleOnThePropertyPage> with
|
|||
bool _hasData = false;
|
||||
bool _loading = false;
|
||||
int count = 0;
|
||||
|
||||
|
||||
|
||||
late final PeopleOnThePropertyPageModel model;
|
||||
|
||||
|
@ -35,7 +34,6 @@ class _PeopleOnThePropertyPageState extends State<PeopleOnThePropertyPage> with
|
|||
void initState() {
|
||||
super.initState();
|
||||
model = createModel(context, () => PeopleOnThePropertyPageModel(onRefresh: () => safeSetState(() {})));
|
||||
|
||||
_future = _fetchVisits();
|
||||
|
||||
_scrollController = ScrollController()
|
||||
|
@ -53,67 +51,79 @@ class _PeopleOnThePropertyPageState extends State<PeopleOnThePropertyPage> with
|
|||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
appBar: _appBar(context),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
body: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (_hasData == false && _pageNumber <= 1 && _loading == false)
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Nenhum morador encontrado!", enText: "No residents found!")),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
else if (_hasData == true || _pageNumber >= 1)
|
||||
Expanded(
|
||||
child: FutureBuilder<void>(
|
||||
future: _future,
|
||||
builder: (context, snapshot) {
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
controller: _scrollController,
|
||||
itemCount: _wrap.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
// Add your item here
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(right: 30, top: 10),
|
||||
child: Text(
|
||||
'',
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
final item = _wrap[index - 1];
|
||||
return _item(context, item);
|
||||
}
|
||||
});
|
||||
},
|
||||
)),
|
||||
if (_hasData == true && _loading == true)
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
Widget build(BuildContext context) {
|
||||
late final limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context);
|
||||
|
||||
return Scaffold(
|
||||
appBar: _appBar(context),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
body: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (_hasData == false && _pageNumber <= 1 && _loading == false)
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Nenhum morador encontrado!",
|
||||
enText: "No residents found!",
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Nunito',
|
||||
fontSize: limitedHeaderTextSize,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
else if (_hasData == true || _pageNumber >= 1)
|
||||
Expanded(
|
||||
child: FutureBuilder<void>(
|
||||
future: _future,
|
||||
builder: (context, snapshot) {
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
controller: _scrollController,
|
||||
itemCount: _wrap.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
// Add your item here
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(right: 30, top: 10),
|
||||
child: Text(
|
||||
'',
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
final item = _wrap[index - 1];
|
||||
return _item(context, item);
|
||||
}
|
||||
});
|
||||
},
|
||||
)),
|
||||
if (_hasData == true && _loading == true)
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
),
|
||||
)
|
||||
].addToStart(const SizedBox(height: 0)),
|
||||
),
|
||||
);
|
||||
),
|
||||
)
|
||||
].addToStart(const SizedBox(height: 0)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
PreferredSizeWidget _appBar(BuildContext context) {
|
||||
return AppBar(
|
||||
|
@ -199,15 +209,23 @@ class _PeopleOnThePropertyPageState extends State<PeopleOnThePropertyPage> with
|
|||
void _showNoMoreDataSnackBar(BuildContext context) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content:
|
||||
Text(FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data.")),
|
||||
content: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Não há mais dados.",
|
||||
enText: "No more data.",
|
||||
),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: LimitedFontSizeUtil.getBodyFontSize(context),
|
||||
),
|
||||
),
|
||||
duration: const Duration(seconds: 3),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _item(BuildContext context, dynamic uItem) {
|
||||
Widget _item(BuildContext context, dynamic uItem) {
|
||||
return CardItemTemplateComponentWidget(
|
||||
imagePath:
|
||||
'https://freaccess.com.br/freaccess/getImage.php?devUUID=${model.devUUID}&cliID=${model.cliUUID}&atividade=getFoto&Documento=${uItem['documento']}&tipo=Z',
|
||||
|
|
|
@ -19,7 +19,8 @@ class PetsHistoryScreen extends StatefulWidget {
|
|||
final bool isApp;
|
||||
final PetsPageModel? model;
|
||||
|
||||
@override _PetsHistoryScreenState createState() => _PetsHistoryScreenState();
|
||||
@override
|
||||
_PetsHistoryScreenState createState() => _PetsHistoryScreenState();
|
||||
}
|
||||
|
||||
class _PetsHistoryScreenState extends State<PetsHistoryScreen> with TickerProviderStateMixin {
|
||||
|
@ -31,7 +32,6 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen> with TickerProvid
|
|||
bool _loading = false;
|
||||
int count = 0;
|
||||
late final PetsPageModel model;
|
||||
|
||||
late Future<void> _petsFuture;
|
||||
List<dynamic> _petsWrap = [];
|
||||
|
||||
|
@ -39,10 +39,7 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen> with TickerProvid
|
|||
void initState() {
|
||||
super.initState();
|
||||
model = widget.model ?? createModel(context, () => PetsPageModel());
|
||||
model.petAmountRegister = '0';
|
||||
_petsFuture = _fetchVisits();
|
||||
|
||||
|
||||
_scrollController = ScrollController()
|
||||
..addListener(() {
|
||||
if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) {
|
||||
|
@ -57,81 +54,6 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen> with TickerProvid
|
|||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context);
|
||||
double limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context);
|
||||
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (_hasData == false && _pageNumber <= 1 && _loading == false)
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Nenhum Pet encontrado!",
|
||||
enText: "No pets found"),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Nunito',
|
||||
fontSize: limitedHeaderTextSize,)
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
else if (_hasData == true || _pageNumber >= 1)
|
||||
Expanded(
|
||||
child: FutureBuilder<void>(
|
||||
future: _petsFuture,
|
||||
builder: (context, snapshot) {
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
controller: _scrollController,
|
||||
itemCount: _petsWrap.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
// Add your item here
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(right: 30, top: 10),
|
||||
child: Text(
|
||||
widget.model?.petAmountRegister == '0'
|
||||
? FFLocalizations.of(context).getVariableText(ptText: "Ilimitado", enText: "Unlimited")
|
||||
: "${FFLocalizations.of(context).getVariableText(ptText: "Quantidade de Pets: ", enText: "Amount of Pets: ")}$count/${widget.model?.petAmountRegister}",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Nunito',
|
||||
fontSize: limitedBodyTextSize,
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
final item = _petsWrap[index - 1];
|
||||
return _item(context, item);
|
||||
}
|
||||
});
|
||||
},
|
||||
)),
|
||||
if (_hasData == true && _loading == true)
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
].addToStart(const SizedBox(height: 0)),
|
||||
);
|
||||
}
|
||||
|
||||
PreferredSizeWidget _appBar(BuildContext context) {
|
||||
return AppBar(
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
|
@ -234,76 +156,80 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen> with TickerProvid
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context);
|
||||
double limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context);
|
||||
late final double limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context);
|
||||
late final double limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context);
|
||||
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (_hasData == false && _pageNumber <= 1 && _loading == false)
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Nenhum Pet encontrado!", enText: "No pets found"),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Nunito',
|
||||
fontSize: limitedHeaderTextSize,
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
else if (_hasData == true || _pageNumber >= 1)
|
||||
Expanded(
|
||||
child: FutureBuilder<void>(
|
||||
future: _petsFuture,
|
||||
builder: (context, snapshot) {
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
controller: _scrollController,
|
||||
itemCount: _petsWrap.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
// Add your item here
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(right: 30, top: 10),
|
||||
child: Text(
|
||||
widget.model.petAmountRegister == '0'
|
||||
? FFLocalizations.of(context).getVariableText(ptText: "Ilimitado", enText: "Unlimited")
|
||||
: "${FFLocalizations.of(context).getVariableText(ptText: "Quantidade de Pets: ", enText: "Amount of Pets: ")}$count/${widget.model.petAmountRegister}",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Nunito',
|
||||
fontSize: limitedBodyTextSize,
|
||||
return Scaffold(
|
||||
appBar: widget.isApp ? _appBar(context) : null,
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
body: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (_hasData == false && _pageNumber <= 1 && _loading == false)
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Nenhum Pet encontrado!", enText: "No pets found"),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Nunito',
|
||||
fontSize: limitedHeaderTextSize,
|
||||
)),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
else if (_hasData == true || _pageNumber >= 1)
|
||||
Expanded(
|
||||
child: FutureBuilder<void>(
|
||||
future: _petsFuture,
|
||||
builder: (context, snapshot) {
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
controller: _scrollController,
|
||||
itemCount: _petsWrap.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
// Add your item here
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(right: 30, top: 10),
|
||||
child: Text(
|
||||
model.petAmountRegister == '0'
|
||||
? FFLocalizations.of(context).getVariableText(ptText: "Ilimitado", enText: "Unlimited")
|
||||
: "${FFLocalizations.of(context).getVariableText(ptText: "Quantidade de Pets: ", enText: "Amount of Pets: ")}$count/${model.petAmountRegister}",
|
||||
textAlign: TextAlign.right,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Nunito',
|
||||
fontSize: limitedBodyTextSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
final item = _petsWrap[index - 1];
|
||||
return _item(context, item);
|
||||
}
|
||||
});
|
||||
},
|
||||
)),
|
||||
if (_hasData == true && _loading == true)
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
);
|
||||
} else {
|
||||
final item = _petsWrap[index - 1];
|
||||
return _item(context, item);
|
||||
}
|
||||
});
|
||||
},
|
||||
)),
|
||||
if (_hasData == true && _loading == true)
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
].addToStart(const SizedBox(height: 0)),
|
||||
)
|
||||
].addToStart(const SizedBox(height: 0)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
|||
late final String devUUID;
|
||||
late final String userUUID;
|
||||
late final String cliUUID;
|
||||
late String petAmountRegister;
|
||||
late String petAmountRegister = '0';
|
||||
dynamic item;
|
||||
|
||||
late final TabController tabBarController;
|
||||
|
@ -111,13 +111,14 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
|||
devUUID = (await StorageHelper().get(SQLiteStorageKey.devUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
userUUID = (await StorageHelper().get(SQLiteStorageKey.userUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
cliUUID = (await StorageHelper().get(SQLiteStorageKey.clientUUID.value, Storage.SQLiteStorage)) ?? '';
|
||||
petAmountRegister = (await StorageHelper().get(SQLiteStorageKey.petAmount.value, Storage.SQLiteStorage)) ?? '';
|
||||
petAmountRegister = await StorageHelper().get(SQLiteStorageKey.petAmount.value, Storage.SQLiteStorage) ?? '0';
|
||||
|
||||
safeSetState?.call();
|
||||
}
|
||||
|
||||
@override
|
||||
void initState(BuildContext context) {
|
||||
initAsync();
|
||||
resetInstance();
|
||||
tabBarController = TabController(
|
||||
vsync: Navigator.of(context),
|
||||
|
@ -145,8 +146,6 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
|||
dropDownValueController1 = FormFieldController<String>(dropDownValue1 ??= 'Selecione uma opção');
|
||||
|
||||
dropDownValueController2 = FormFieldController<String>(dropDownValue2 ??= 'Selecione uma opção');
|
||||
|
||||
initAsync();
|
||||
}
|
||||
|
||||
@override
|
||||
|
@ -175,7 +174,6 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
|||
dropDownValueController2?.dispose();
|
||||
}
|
||||
|
||||
|
||||
void setEditForm() {
|
||||
log('item: $item');
|
||||
|
||||
|
@ -395,29 +393,29 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
|||
onPressed: () async {
|
||||
context.pop();
|
||||
|
||||
model.isEditing = true;
|
||||
model.item = item;
|
||||
model.switchTab(0);
|
||||
model.setEditForm();
|
||||
// model.safeSetState!();
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
elevation: 0,
|
||||
textStyle: TextStyle(
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15),
|
||||
),
|
||||
splashColor: const Color.fromARGB(95, 0, 146, 5),
|
||||
borderSide: BorderSide(
|
||||
model.isEditing = true;
|
||||
model.item = item;
|
||||
model.switchTab(0);
|
||||
model.setEditForm();
|
||||
// model.safeSetState!();
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
width: 1,
|
||||
elevation: 0,
|
||||
textStyle: TextStyle(
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15),
|
||||
),
|
||||
splashColor: const Color.fromARGB(95, 0, 146, 5),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
width: 1,
|
||||
),
|
||||
// borderRadius: 12,
|
||||
),
|
||||
// borderRadius: 12,
|
||||
),
|
||||
),
|
||||
|
||||
// DELETE ACTION
|
||||
if (isInteractive)
|
||||
|
@ -448,55 +446,55 @@ class PetsPageModel extends FlutterFlowModel<PetsPageWidget> {
|
|||
context.pop(value);
|
||||
context.pop(value);
|
||||
|
||||
if (value == false) {
|
||||
if (value == false) {
|
||||
showSnackbar(
|
||||
context,
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Erro ao excluir pet',
|
||||
enText: 'Error deleting pet',
|
||||
),
|
||||
true,
|
||||
);
|
||||
} else if (value == true) {
|
||||
showSnackbar(
|
||||
context,
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Success deleting pet',
|
||||
ptText: 'Succeso ao excluir pet',
|
||||
),
|
||||
false,
|
||||
);
|
||||
}
|
||||
}).catchError((err, stack) {
|
||||
context.pop();
|
||||
showSnackbar(
|
||||
context,
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: 'Erro ao excluir pet',
|
||||
enText: 'Error deleting pet',
|
||||
ptText: 'Erro ao excluir pet',
|
||||
),
|
||||
true,
|
||||
);
|
||||
} else if (value == true) {
|
||||
showSnackbar(
|
||||
context,
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Success deleting pet',
|
||||
ptText: 'Succeso ao excluir pet',
|
||||
),
|
||||
false,
|
||||
);
|
||||
}
|
||||
}).catchError((err, stack) {
|
||||
context.pop();
|
||||
showSnackbar(
|
||||
context,
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
enText: 'Error deleting pet',
|
||||
ptText: 'Erro ao excluir pet',
|
||||
),
|
||||
true,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
elevation: 0,
|
||||
textStyle: TextStyle(
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15),
|
||||
),
|
||||
splashColor: const Color.fromARGB(131, 255, 17, 0),
|
||||
borderSide: BorderSide(
|
||||
},
|
||||
options: FFButtonOptions(
|
||||
width: 100,
|
||||
height: 40,
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
width: 1,
|
||||
elevation: 0,
|
||||
textStyle: TextStyle(
|
||||
color: FlutterFlowTheme.of(context).primaryText,
|
||||
fontSize: LimitedFontSizeUtil.getNoResizeFont(context, 15),
|
||||
),
|
||||
splashColor: const Color.fromARGB(131, 255, 17, 0),
|
||||
borderSide: BorderSide(
|
||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||
width: 1,
|
||||
),
|
||||
// borderRadius: 12,
|
||||
),
|
||||
// borderRadius: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
// 'MIN', 'PEQ', 'MED', 'GRA', 'GIG'
|
||||
labelsHashMap: Map<String, String>.from({
|
||||
|
|
|
@ -9,9 +9,7 @@ import 'package:hub/components/atomic_components/shared_components_atoms/atom_im
|
|||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||
import 'package:hub/pages/reception_page/reception_page_model.dart';
|
||||
import 'package:hub/shared/helpers/base_storage.dart';
|
||||
import 'package:hub/shared/helpers/storage_helper.dart';
|
||||
import 'package:hub/shared/services/authentication/authentication_service.dart';
|
||||
import 'package:hub/shared/services/localization/localization_service.dart';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
|
@ -751,12 +750,10 @@ class _ScheduleCompleteVisitPageWidgetState extends State<ScheduleCompleteVisitP
|
|||
padding: MediaQuery.viewInsetsOf(context),
|
||||
child: VisitorSearchModalTemplateComponentWidget(
|
||||
getVisitors: (visitorsParam) async {
|
||||
model.visitorJsonList = visitorsParam!.toList().cast<dynamic>();
|
||||
model.visitorJsonList = visitorsParam!.toList().cast<dynamic>();
|
||||
safeSetState(() {});
|
||||
},
|
||||
getDocs: (docsParam) async {
|
||||
model.visitorStrList = strListToStr(docsParam!.toList());
|
||||
model.visitorStrList = strListToStr(docsParam!.toList());
|
||||
safeSetState(() {});
|
||||
},
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
|||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||
import 'package:hub/pages/vehicles_on_the_property/vehicle_model.dart';
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||
import 'package:hub/shared/utils/log_util.dart';
|
||||
|
||||
class VehicleOnTheProperty extends StatefulWidget {
|
||||
|
@ -33,7 +34,6 @@ class _VehicleOnThePropertyState extends State<VehicleOnTheProperty> with Ticker
|
|||
super.initState();
|
||||
model = createModel(context, () => VehicleModel());
|
||||
_future = _fetchVisits();
|
||||
|
||||
_scrollController = ScrollController()
|
||||
..addListener(() {
|
||||
if (_scrollController.position.atEdge && _scrollController.position.pixels != 0) {
|
||||
|
@ -49,67 +49,79 @@ class _VehicleOnThePropertyState extends State<VehicleOnTheProperty> with Ticker
|
|||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
appBar: _appBar(context),
|
||||
body: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (_hasData == false && _pageNumber <= 1 && _loading == false)
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(FFLocalizations.of(context)
|
||||
.getVariableText(ptText: "Nenhum veículo encontrado!", enText: "No vehicle found")),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
else if (_hasData == true || _pageNumber >= 1)
|
||||
Expanded(
|
||||
child: FutureBuilder<void>(
|
||||
future: _future,
|
||||
builder: (context, snapshot) {
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
controller: _scrollController,
|
||||
itemCount: _wrap.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
// Add your item here
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(right: 30, top: 10),
|
||||
child: Text(
|
||||
'',
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
final item = _wrap[index - 1];
|
||||
return _item(context, item);
|
||||
}
|
||||
});
|
||||
},
|
||||
)),
|
||||
if (_hasData == true && _loading == true)
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
Widget build(BuildContext context) {
|
||||
late final limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context);
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
appBar: _appBar(context),
|
||||
body: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (_hasData == false && _pageNumber <= 1 && _loading == false)
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Nenhum veículo encontrado!",
|
||||
enText: "No vehicle found",
|
||||
),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Nunito',
|
||||
fontSize: limitedHeaderTextSize,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
else if (_hasData == true || _pageNumber >= 1)
|
||||
Expanded(
|
||||
child: FutureBuilder<void>(
|
||||
future: _future,
|
||||
builder: (context, snapshot) {
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
controller: _scrollController,
|
||||
itemCount: _wrap.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
// Add your item here
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(right: 30, top: 10),
|
||||
child: Text(
|
||||
'',
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
final item = _wrap[index - 1];
|
||||
return _item(context, item);
|
||||
}
|
||||
});
|
||||
},
|
||||
)),
|
||||
if (_hasData == true && _loading == true)
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
),
|
||||
)
|
||||
].addToStart(const SizedBox(height: 0)),
|
||||
),
|
||||
);
|
||||
),
|
||||
)
|
||||
].addToStart(const SizedBox(height: 0)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
PreferredSizeWidget _appBar(BuildContext context) {
|
||||
return AppBar(
|
||||
|
@ -195,8 +207,16 @@ class _VehicleOnThePropertyState extends State<VehicleOnTheProperty> with Ticker
|
|||
void _showNoMoreDataSnackBar(BuildContext context) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content:
|
||||
Text(FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data.")),
|
||||
content: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Não há mais dados.",
|
||||
enText: "No more data.",
|
||||
),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: LimitedFontSizeUtil.getBodyFontSize(context),
|
||||
),
|
||||
),
|
||||
duration: const Duration(seconds: 3),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:hub/backend/api_requests/api_manager.dart';
|
||||
import 'package:hub/components/templates_components/details_component/details_component_widget.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_model.dart';
|
||||
import 'package:hub/flutter_flow/flutter_flow_theme.dart';
|
||||
|
|
|
@ -8,6 +8,7 @@ import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
|||
import 'package:hub/pages/visits_on_the_property/model.dart';
|
||||
import 'package:hub/shared/utils/dialog_util.dart';
|
||||
import 'package:hub/shared/utils/log_util.dart';
|
||||
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||
|
||||
class VisitsOnTheProperty extends StatefulWidget {
|
||||
const VisitsOnTheProperty({super.key});
|
||||
|
@ -31,7 +32,7 @@ class _VisitsOnThePropertyState extends State<VisitsOnTheProperty> with TickerPr
|
|||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
model = createModel(context, () => VisitsModel(onRefresh: () => safeSetState((){})));
|
||||
model = createModel(context, () => VisitsModel(onRefresh: () => safeSetState(() {})));
|
||||
_future = _fetchVisits();
|
||||
|
||||
_scrollController = ScrollController()
|
||||
|
@ -49,67 +50,78 @@ class _VisitsOnThePropertyState extends State<VisitsOnTheProperty> with TickerPr
|
|||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
appBar: _appBar(context),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
body: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (_hasData == false && _pageNumber <= 1 && _loading == false)
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Nenhuma visita em aberto encontrada!", enText: "No opened visits found")),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
else if (_hasData == true || _pageNumber >= 1)
|
||||
Expanded(
|
||||
child: FutureBuilder<void>(
|
||||
future: _future,
|
||||
builder: (context, snapshot) {
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
controller: _scrollController,
|
||||
itemCount: _list.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
// Add your item here
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(right: 30, top: 10),
|
||||
child: Text(
|
||||
'',
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
final item = _list[index - 1];
|
||||
return _item(context, item);
|
||||
}
|
||||
});
|
||||
},
|
||||
)),
|
||||
if (_hasData == true && _loading == true)
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
Widget build(BuildContext context) {
|
||||
late final limitedBodyTextSize = LimitedFontSizeUtil.getBodyFontSize(context);
|
||||
late final limitedHeaderTextSize = LimitedFontSizeUtil.getHeaderFontSize(context);
|
||||
|
||||
return Scaffold(
|
||||
appBar: _appBar(context),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primaryBackground,
|
||||
body: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
if (_hasData == false && _pageNumber <= 1 && _loading == false)
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: [
|
||||
Center(
|
||||
child: Text(
|
||||
FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Nenhuma visita em aberto encontrada!", enText: "No opened visits found"),
|
||||
style: TextStyle(
|
||||
fontFamily: 'Nunito',
|
||||
fontSize: limitedHeaderTextSize,
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
else if (_hasData == true || _pageNumber >= 1)
|
||||
Expanded(
|
||||
child: FutureBuilder<void>(
|
||||
future: _future,
|
||||
builder: (context, snapshot) {
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
physics: const BouncingScrollPhysics(),
|
||||
controller: _scrollController,
|
||||
itemCount: _list.length + 1,
|
||||
itemBuilder: (context, index) {
|
||||
if (index == 0) {
|
||||
// Add your item here
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(right: 30, top: 10),
|
||||
child: Text(
|
||||
'',
|
||||
textAlign: TextAlign.right,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
final item = _list[index - 1];
|
||||
return _item(context, item);
|
||||
}
|
||||
});
|
||||
},
|
||||
)),
|
||||
if (_hasData == true && _loading == true)
|
||||
Container(
|
||||
padding: const EdgeInsets.only(top: 15, bottom: 15),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(
|
||||
valueColor: AlwaysStoppedAnimation<Color>(
|
||||
FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
),
|
||||
)
|
||||
].addToStart(const SizedBox(height: 0)),
|
||||
),
|
||||
);
|
||||
),
|
||||
)
|
||||
].addToStart(const SizedBox(height: 0)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
PreferredSizeWidget _appBar(BuildContext context) {
|
||||
return AppBar(
|
||||
|
@ -195,8 +207,13 @@ class _VisitsOnThePropertyState extends State<VisitsOnTheProperty> with TickerPr
|
|||
void _showNoMoreDataSnackBar(BuildContext context) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content:
|
||||
Text(FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data.")),
|
||||
content: Text(
|
||||
FFLocalizations.of(context).getVariableText(ptText: "Não há mais dados.", enText: "No more data."),
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: LimitedFontSizeUtil.getBodyFontSize(context),
|
||||
),
|
||||
),
|
||||
duration: const Duration(seconds: 3),
|
||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||
),
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||
import 'package:hub/shared/helpers/base_storage.dart';
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:hub/shared/helpers/base_storage.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
|
|
Loading…
Reference in New Issue