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