Feat: Ajuste na tela de home, visita provisória e visita completa
This commit is contained in:
parent
c22e1bff5e
commit
8ce59f3f2b
|
@ -8,7 +8,6 @@ import 'package:hub/shared/utils/storage_util.dart';
|
||||||
import '../../../shared/extensions/dialog_extensions.dart';
|
import '../../../shared/extensions/dialog_extensions.dart';
|
||||||
import '../../../shared/services/localization/localization_service.dart';
|
import '../../../shared/services/localization/localization_service.dart';
|
||||||
|
|
||||||
|
|
||||||
class MenuButtonWidget extends MenuEntry {
|
class MenuButtonWidget extends MenuEntry {
|
||||||
const MenuButtonWidget({
|
const MenuButtonWidget({
|
||||||
super.key,
|
super.key,
|
||||||
|
@ -32,19 +31,26 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
get action => action;
|
get action => action;
|
||||||
bool _isProcessing = false;
|
bool _isProcessing = false;
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final textScaler = MediaQuery.textScalerOf(context);
|
||||||
|
final double baseFontSize = 10;
|
||||||
|
final double scaledFontSize = baseFontSize * textScaler.scale(1);
|
||||||
|
final double limitedFontSize = scaledFontSize > 22 ? 10 : baseFontSize;
|
||||||
|
|
||||||
return InkWell(
|
return InkWell(
|
||||||
splashColor: Colors.transparent,
|
splashColor: Colors.transparent,
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: _isProcessing ? null : () async {
|
onTap: _isProcessing
|
||||||
|
? null
|
||||||
|
: () async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isProcessing = true;
|
_isProcessing = true;
|
||||||
});
|
});
|
||||||
await LocalizationService.processLocals(context).then((value) async {
|
await LocalizationService.processLocals(context)
|
||||||
|
.then((value) async {
|
||||||
if (value) {
|
if (value) {
|
||||||
await widget.action?.call();
|
await widget.action?.call();
|
||||||
} else {
|
} else {
|
||||||
|
@ -58,8 +64,8 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0),
|
padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 120.0,
|
width: 300,
|
||||||
height: 100.0,
|
height: 280,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FlutterFlowTheme.of(context).primaryBackground,
|
color: FlutterFlowTheme.of(context).primaryBackground,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
|
@ -107,7 +113,7 @@ class _MenuButtonWidgetState extends State<MenuButtonWidget> {
|
||||||
style: FlutterFlowTheme.of(context).titleLarge.override(
|
style: FlutterFlowTheme.of(context).titleLarge.override(
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color: FlutterFlowTheme.of(context).primaryText,
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
fontSize: 14.0,
|
fontSize: limitedFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts:
|
||||||
|
|
|
@ -36,11 +36,14 @@ class _MenuCardItemState extends State<MenuCardItem> {
|
||||||
focusColor: Colors.transparent,
|
focusColor: Colors.transparent,
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: _isProcessing ? null : () async {
|
onTap: _isProcessing
|
||||||
|
? null
|
||||||
|
: () async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isProcessing = true;
|
_isProcessing = true;
|
||||||
});
|
});
|
||||||
await LocalizationService.processLocals(context).then((value) async {
|
await LocalizationService.processLocals(context)
|
||||||
|
.then((value) async {
|
||||||
if (value) {
|
if (value) {
|
||||||
await widget.action?.call();
|
await widget.action?.call();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -39,8 +39,8 @@ class _LocalProfileComponentWidgetState
|
||||||
//
|
//
|
||||||
// WidgetsBinding.instance
|
// WidgetsBinding.instance
|
||||||
// .addPostFrameCallback((_) async => await LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null));
|
// .addPostFrameCallback((_) async => await LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null));
|
||||||
LocalizationService.processLocals(context).then((value) => value == true ? onUpdate() : null);
|
LocalizationService.processLocals(context)
|
||||||
|
.then((value) => value == true ? onUpdate() : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -57,10 +57,13 @@ class _LocalProfileComponentWidgetState
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final textScaler = MediaQuery.textScalerOf(context);
|
||||||
|
final double baseFontSize = 14.0;
|
||||||
|
final double scaledFontSize = baseFontSize * textScaler.scale(1);
|
||||||
|
final double limitedFontSize = scaledFontSize > 14.0 ? 9 : scaledFontSize;
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
decoration: const BoxDecoration(),
|
decoration: const BoxDecoration(),
|
||||||
child: Align(
|
child: Align(
|
||||||
|
@ -90,7 +93,8 @@ class _LocalProfileComponentWidgetState
|
||||||
hoverColor: Colors.transparent,
|
hoverColor: Colors.transparent,
|
||||||
highlightColor: Colors.transparent,
|
highlightColor: Colors.transparent,
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
await LocalizationService.selectLocal(context).then((value) => value == true ? onUpdate() : null);
|
await LocalizationService.selectLocal(context).then(
|
||||||
|
(value) => value == true ? onUpdate() : null);
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(200.0),
|
borderRadius: BorderRadius.circular(200.0),
|
||||||
|
@ -120,7 +124,16 @@ class _LocalProfileComponentWidgetState
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Expanded(
|
||||||
|
child: Tooltip(
|
||||||
|
message: valueOrDefault<String>(
|
||||||
|
functions.convertToUppercase(_model.cliName),
|
||||||
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
ptText: 'SEM LOCAL VINCULADO',
|
||||||
|
enText: 'NO LINKED LOCAL',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
valueOrDefault<String>(
|
valueOrDefault<String>(
|
||||||
functions.convertToUppercase(_model.cliName),
|
functions.convertToUppercase(_model.cliName),
|
||||||
FFLocalizations.of(context).getVariableText(
|
FFLocalizations.of(context).getVariableText(
|
||||||
|
@ -128,16 +141,20 @@ class _LocalProfileComponentWidgetState
|
||||||
enText: 'NO LINKED LOCAL',
|
enText: 'NO LINKED LOCAL',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
maxLines: 1,
|
||||||
style: FlutterFlowTheme.of(context).labelMedium.override(
|
style: FlutterFlowTheme.of(context).labelMedium.override(
|
||||||
fontFamily: 'Nunito',
|
fontFamily: 'Nunito',
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
fontSize: 14.0,
|
fontSize: limitedFontSize,
|
||||||
letterSpacing: 0.0,
|
letterSpacing: 0.0,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
useGoogleFonts:
|
useGoogleFonts:
|
||||||
GoogleFonts.asMap().containsKey('Nunito'),
|
GoogleFonts.asMap().containsKey('Nunito'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
]
|
]
|
||||||
.divide(const SizedBox(width: 20.0))
|
.divide(const SizedBox(width: 20.0))
|
||||||
.addToStart(const SizedBox(width: 20.0))
|
.addToStart(const SizedBox(width: 20.0))
|
||||||
|
|
|
@ -52,12 +52,16 @@ class _MenuStaggeredViewComponentWidgetState
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final textScaler = MediaQuery.textScalerOf(context);
|
||||||
|
final double scaledFontSize = 14 * textScaler.scale(1);
|
||||||
|
final int crossAxisCount = scaledFontSize > 20 ? 2 : 3;
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
GridView.builder(
|
GridView.builder(
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisCount: 3,
|
crossAxisCount: crossAxisCount,
|
||||||
crossAxisSpacing: 10.0,
|
crossAxisSpacing: 10.0,
|
||||||
mainAxisSpacing: 10.0,
|
mainAxisSpacing: 10.0,
|
||||||
childAspectRatio: 1,
|
childAspectRatio: 1,
|
||||||
|
|
|
@ -165,12 +165,16 @@ class _ScheduleProvisionalVisitPageWidgetState
|
||||||
memCacheHeight: 35,
|
memCacheHeight: 35,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsetsDirectional
|
padding: const EdgeInsetsDirectional
|
||||||
.fromSTEB(15.0, 0.0, 0.0, 0.0),
|
.fromSTEB(15.0, 0.0, 0.0, 0.0),
|
||||||
child: Text(
|
child: Text(
|
||||||
model.cliName,
|
model.cliName,
|
||||||
style: FlutterFlowTheme.of(context)
|
overflow: TextOverflow.ellipsis,
|
||||||
|
maxLines: 1,
|
||||||
|
style:
|
||||||
|
FlutterFlowTheme.of(context)
|
||||||
.bodyMedium
|
.bodyMedium
|
||||||
.override(
|
.override(
|
||||||
fontFamily:
|
fontFamily:
|
||||||
|
@ -187,6 +191,7 @@ class _ScheduleProvisionalVisitPageWidgetState
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -193,6 +193,12 @@ Theme wrapInMaterialTimePickerTheme(
|
||||||
required double iconSize,
|
required double iconSize,
|
||||||
}) {
|
}) {
|
||||||
final baseTheme = Theme.of(context);
|
final baseTheme = Theme.of(context);
|
||||||
|
|
||||||
|
final textScaler = MediaQuery.textScalerOf(context);
|
||||||
|
final double baseFontSize = 14.0;
|
||||||
|
final double scaledFontSize = baseFontSize * textScaler.scale(1);
|
||||||
|
final double limitedFontSize = scaledFontSize > 14.0 ? 8 : scaledFontSize;
|
||||||
|
|
||||||
return Theme(
|
return Theme(
|
||||||
data: baseTheme.copyWith(
|
data: baseTheme.copyWith(
|
||||||
focusColor: headerBackgroundColor,
|
focusColor: headerBackgroundColor,
|
||||||
|
@ -271,6 +277,10 @@ Theme wrapInMaterialTimePickerTheme(
|
||||||
dayPeriodBorderSide: BorderSide(
|
dayPeriodBorderSide: BorderSide(
|
||||||
color: pickerForegroundColor,
|
color: pickerForegroundColor,
|
||||||
),
|
),
|
||||||
|
dialTextStyle: baseTheme.textTheme.headlineMedium!.copyWith(
|
||||||
|
color: pickerDialForegroundColor,
|
||||||
|
fontSize: limitedFontSize,
|
||||||
|
),
|
||||||
dayPeriodTextColor: WidgetStateColor.resolveWith((states) =>
|
dayPeriodTextColor: WidgetStateColor.resolveWith((states) =>
|
||||||
states.contains(WidgetState.selected)
|
states.contains(WidgetState.selected)
|
||||||
? selectedDateTimeForegroundColor
|
? selectedDateTimeForegroundColor
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
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';
|
||||||
|
@ -30,13 +29,14 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
_localProfileComponentWidget = LocalProfileComponentWidget();
|
_localProfileComponentWidget = LocalProfileComponentWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override void dispose() {
|
@override
|
||||||
|
void dispose() {
|
||||||
super.dispose();
|
super.dispose();
|
||||||
_model.dispose();
|
_model.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override void initState() {
|
@override
|
||||||
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
_model = createModel(context, () => HomePageModel());
|
_model = createModel(context, () => HomePageModel());
|
||||||
|
@ -48,9 +48,8 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
_model.textFieldFocusNode ??= FocusNode();
|
_model.textFieldFocusNode ??= FocusNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
@override Widget build(BuildContext context) {
|
|
||||||
StorageUtil().context = context;
|
StorageUtil().context = context;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
|
@ -109,10 +108,6 @@ class _HomePageWidgetState extends State<HomePageWidget> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Container buildPage(BuildContext context) {
|
Container buildPage(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue