fix: labelText do campo de data foi alterado para representar melhor o fluxo
This commit is contained in:
parent
3dadb48fe8
commit
1aab95869c
|
@ -1 +0,0 @@
|
|||
|
|
@ -281,7 +281,10 @@ class _ScheduleProvisionalVisitPageWidgetState extends State<ScheduleProvisional
|
|||
obscureText: false,
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
labelText: FFLocalizations.of(context).getText('8zgsw5so'),
|
||||
labelText: FFLocalizations.of(context).getVariableText(
|
||||
ptText: "Data de Validade da Visita",
|
||||
enText: "Visit Validity Date",
|
||||
),
|
||||
labelStyle: FlutterFlowTheme.of(context).bodyMedium.override(
|
||||
fontFamily: FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||
letterSpacing: 0.0,
|
||||
|
|
|
@ -24,7 +24,6 @@ export 'dart:typed_data' show Uint8List;
|
|||
export 'package:intl/intl.dart';
|
||||
export 'package:page_transition/page_transition.dart';
|
||||
|
||||
export '/app_state.dart';
|
||||
export 'custom_icons.dart' show FFIcons;
|
||||
export 'flutter_flow_model.dart';
|
||||
export 'internationalization.dart' show FFLocalizations;
|
||||
|
@ -33,8 +32,7 @@ export 'lat_lng.dart';
|
|||
export 'place.dart';
|
||||
export 'uploaded_file.dart';
|
||||
|
||||
T valueOrDefault<T>(T? value, T defaultValue) =>
|
||||
(value is String && value.isEmpty) || value == null ? defaultValue : value;
|
||||
T valueOrDefault<T>(T? value, T defaultValue) => (value is String && value.isEmpty) || value == null ? defaultValue : value;
|
||||
|
||||
void _setTimeagoLocales() {
|
||||
timeago.setLocaleMessages('pt', timeago.PtBrMessages());
|
||||
|
@ -68,8 +66,7 @@ Theme wrapInMaterialDatePickerTheme(
|
|||
required double iconSize,
|
||||
}) {
|
||||
final baseTheme = Theme.of(context);
|
||||
final dateTimeMaterialStateForegroundColor =
|
||||
WidgetStateProperty.resolveWith((states) {
|
||||
final dateTimeMaterialStateForegroundColor = WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.disabled)) {
|
||||
return pickerForegroundColor.withOpacity(0.60);
|
||||
}
|
||||
|
@ -82,8 +79,7 @@ Theme wrapInMaterialDatePickerTheme(
|
|||
return null;
|
||||
});
|
||||
|
||||
final dateTimeMaterialStateBackgroundColor =
|
||||
WidgetStateProperty.resolveWith((states) {
|
||||
final dateTimeMaterialStateBackgroundColor = WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.selected)) {
|
||||
return selectedDateTimeBackgroundColor;
|
||||
}
|
||||
|
@ -152,8 +148,7 @@ Theme wrapInMaterialDatePickerTheme(
|
|||
if (states.contains(WidgetState.hovered)) {
|
||||
return actionButtonForegroundColor.withOpacity(0.04);
|
||||
}
|
||||
if (states.contains(WidgetState.focused) ||
|
||||
states.contains(WidgetState.pressed)) {
|
||||
if (states.contains(WidgetState.focused) || states.contains(WidgetState.pressed)) {
|
||||
return actionButtonForegroundColor.withOpacity(0.12);
|
||||
}
|
||||
return null;
|
||||
|
@ -252,8 +247,7 @@ Theme wrapInMaterialTimePickerTheme(
|
|||
if (states.contains(WidgetState.hovered)) {
|
||||
return actionButtonForegroundColor.withOpacity(0.04);
|
||||
}
|
||||
if (states.contains(WidgetState.focused) ||
|
||||
states.contains(WidgetState.pressed)) {
|
||||
if (states.contains(WidgetState.focused) || states.contains(WidgetState.pressed)) {
|
||||
return actionButtonForegroundColor.withOpacity(0.12);
|
||||
}
|
||||
return null;
|
||||
|
@ -264,21 +258,12 @@ Theme wrapInMaterialTimePickerTheme(
|
|||
backgroundColor: pickerBackgroundColor,
|
||||
hourMinuteTextColor: pickerForegroundColor,
|
||||
dialHandColor: selectedDateTimeBackgroundColor,
|
||||
dialTextColor: WidgetStateColor.resolveWith((states) =>
|
||||
states.contains(WidgetState.selected)
|
||||
? selectedDateTimeForegroundColor
|
||||
: pickerDialForegroundColor),
|
||||
dialTextColor: WidgetStateColor.resolveWith((states) => states.contains(WidgetState.selected) ? selectedDateTimeForegroundColor : pickerDialForegroundColor),
|
||||
dayPeriodBorderSide: BorderSide(
|
||||
color: pickerForegroundColor,
|
||||
),
|
||||
dayPeriodTextColor: WidgetStateColor.resolveWith((states) =>
|
||||
states.contains(WidgetState.selected)
|
||||
? selectedDateTimeForegroundColor
|
||||
: pickerForegroundColor),
|
||||
dayPeriodColor: WidgetStateColor.resolveWith((states) =>
|
||||
states.contains(WidgetState.selected)
|
||||
? selectedDateTimeBackgroundColor
|
||||
: Colors.transparent),
|
||||
dayPeriodTextColor: WidgetStateColor.resolveWith((states) => states.contains(WidgetState.selected) ? selectedDateTimeForegroundColor : pickerForegroundColor),
|
||||
dayPeriodColor: WidgetStateColor.resolveWith((states) => states.contains(WidgetState.selected) ? selectedDateTimeBackgroundColor : Colors.transparent),
|
||||
entryModeIconColor: pickerForegroundColor,
|
||||
),
|
||||
),
|
||||
|
@ -361,8 +346,7 @@ String formatNumber(
|
|||
break;
|
||||
case FormatType.custom:
|
||||
final hasLocale = locale != null && locale.isNotEmpty;
|
||||
formattedValue =
|
||||
NumberFormat(format, hasLocale ? locale : null).format(value);
|
||||
formattedValue = NumberFormat(format, hasLocale ? locale : null).format(value);
|
||||
}
|
||||
|
||||
if (formattedValue.isEmpty) {
|
||||
|
@ -370,9 +354,7 @@ String formatNumber(
|
|||
}
|
||||
|
||||
if (currency != null) {
|
||||
final currencySymbol = currency.isNotEmpty
|
||||
? currency
|
||||
: NumberFormat.simpleCurrency().format(0.0).substring(0, 1);
|
||||
final currencySymbol = currency.isNotEmpty ? currency : NumberFormat.simpleCurrency().format(0.0).substring(0, 1);
|
||||
formattedValue = '$currencySymbol$formattedValue';
|
||||
}
|
||||
|
||||
|
@ -430,9 +412,7 @@ dynamic getJsonField(
|
|||
}
|
||||
final value = field.first.value;
|
||||
if (isForList) {
|
||||
return value is! Iterable
|
||||
? [value]
|
||||
: (value is List ? value : value.toList());
|
||||
return value is! Iterable ? [value] : (value is List ? value : value.toList());
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
@ -453,8 +433,7 @@ bool get isWeb => kIsWeb;
|
|||
const kBreakpointSmall = 479.0;
|
||||
const kBreakpointMedium = 767.0;
|
||||
const kBreakpointLarge = 991.0;
|
||||
bool isMobileWidth(BuildContext context) =>
|
||||
MediaQuery.sizeOf(context).width < kBreakpointSmall;
|
||||
bool isMobileWidth(BuildContext context) => MediaQuery.sizeOf(context).width < kBreakpointSmall;
|
||||
bool responsiveVisibility({
|
||||
required BuildContext context,
|
||||
bool phone = true,
|
||||
|
@ -478,8 +457,7 @@ const kTextValidatorUsernameRegex = r'^[a-zA-Z][a-zA-Z0-9_-]{2,16}$';
|
|||
// https://stackoverflow.com/a/201378
|
||||
const kTextValidatorEmailRegex =
|
||||
"^(?:[a-zA-Z0-9!#\$%&\'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#\$%&\'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])\$";
|
||||
const kTextValidatorWebsiteRegex =
|
||||
r'(https?:\/\/)?(www\.)[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,10}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)|(https?:\/\/)?(www\.)?(?!ww)[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,10}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)';
|
||||
const kTextValidatorWebsiteRegex = r'(https?:\/\/)?(www\.)[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,10}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)|(https?:\/\/)?(www\.)?(?!ww)[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,10}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)';
|
||||
|
||||
extension FFTextEditingControllerExt on TextEditingController? {
|
||||
String get text => this == null ? '' : this!.text;
|
||||
|
@ -487,28 +465,20 @@ extension FFTextEditingControllerExt on TextEditingController? {
|
|||
}
|
||||
|
||||
extension IterableExt<T> on Iterable<T> {
|
||||
List<T> sortedList<S extends Comparable>(
|
||||
{S Function(T)? keyOf, bool desc = false}) {
|
||||
final sortedAscending = toList()
|
||||
..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b))));
|
||||
List<T> sortedList<S extends Comparable>({S Function(T)? keyOf, bool desc = false}) {
|
||||
final sortedAscending = toList()..sort(keyOf == null ? null : ((a, b) => keyOf(a).compareTo(keyOf(b))));
|
||||
if (desc) {
|
||||
return sortedAscending.reversed.toList();
|
||||
}
|
||||
return sortedAscending;
|
||||
}
|
||||
|
||||
List<S> mapIndexed<S>(S Function(int, T) func) => toList()
|
||||
.asMap()
|
||||
.map((index, value) => MapEntry(index, func(index, value)))
|
||||
.values
|
||||
.toList();
|
||||
List<S> mapIndexed<S>(S Function(int, T) func) => toList().asMap().map((index, value) => MapEntry(index, func(index, value))).values.toList();
|
||||
}
|
||||
|
||||
void setAppLanguage(BuildContext context, String language) =>
|
||||
App.of(context).setLocale(language);
|
||||
void setAppLanguage(BuildContext context, String language) => App.of(context).setLocale(language);
|
||||
|
||||
void setDarkModeSetting(BuildContext context, ThemeMode themeMode) =>
|
||||
App.of(context).setThemeMode(themeMode);
|
||||
void setDarkModeSetting(BuildContext context, ThemeMode themeMode) => App.of(context).setThemeMode(themeMode);
|
||||
|
||||
void showSnackbar(
|
||||
BuildContext context,
|
||||
|
@ -542,9 +512,7 @@ void showSnackbar(
|
|||
],
|
||||
),
|
||||
duration: Duration(seconds: duration),
|
||||
backgroundColor: error
|
||||
? FlutterFlowTheme.of(context).error
|
||||
: FlutterFlowTheme.of(context).success,
|
||||
backgroundColor: error ? FlutterFlowTheme.of(context).error : FlutterFlowTheme.of(context).success,
|
||||
behavior: SnackBarBehavior.floating,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(30),
|
||||
|
@ -553,8 +521,7 @@ void showSnackbar(
|
|||
);
|
||||
}
|
||||
|
||||
void showAlertDialog(BuildContext context, String title, String content,
|
||||
Future<void> Function() action) {
|
||||
void showAlertDialog(BuildContext context, String title, String content, Future<void> Function() action) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
|
@ -619,10 +586,7 @@ void showAlertDialog(BuildContext context, String title, String content,
|
|||
}
|
||||
|
||||
extension FFStringExt on String {
|
||||
String maybeHandleOverflow({int? maxChars, String replacement = ''}) =>
|
||||
maxChars != null && length > maxChars
|
||||
? replaceRange(maxChars, null, replacement)
|
||||
: this;
|
||||
String maybeHandleOverflow({int? maxChars, String replacement = ''}) => maxChars != null && length > maxChars ? replaceRange(maxChars, null, replacement) : this;
|
||||
}
|
||||
|
||||
extension ListFilterExt<T> on Iterable<T?> {
|
||||
|
@ -631,40 +595,26 @@ extension ListFilterExt<T> on Iterable<T?> {
|
|||
|
||||
extension MapFilterExtensions<T> on Map<String, T?> {
|
||||
Map<String, T> get withoutNulls => Map.fromEntries(
|
||||
entries
|
||||
.where((e) => e.value != null)
|
||||
.map((e) => MapEntry(e.key, e.value as T)),
|
||||
entries.where((e) => e.value != null).map((e) => MapEntry(e.key, e.value as T)),
|
||||
);
|
||||
}
|
||||
|
||||
extension MapListContainsExt on List<dynamic> {
|
||||
bool containsMap(dynamic map) => map is Map
|
||||
? any((e) => e is Map && const DeepCollectionEquality().equals(e, map))
|
||||
: contains(map);
|
||||
bool containsMap(dynamic map) => map is Map ? any((e) => e is Map && const DeepCollectionEquality().equals(e, map)) : contains(map);
|
||||
}
|
||||
|
||||
extension ListDivideExt<T extends Widget> on Iterable<T> {
|
||||
Iterable<MapEntry<int, Widget>> get enumerate => toList().asMap().entries;
|
||||
|
||||
List<Widget> divide(Widget t, {bool Function(int)? filterFn}) => isEmpty
|
||||
? []
|
||||
: (enumerate
|
||||
.map((e) => [e.value, if (filterFn == null || filterFn(e.key)) t])
|
||||
.expand((i) => i)
|
||||
.toList()
|
||||
..removeLast());
|
||||
List<Widget> divide(Widget t, {bool Function(int)? filterFn}) => isEmpty ? [] : (enumerate.map((e) => [e.value, if (filterFn == null || filterFn(e.key)) t]).expand((i) => i).toList()..removeLast());
|
||||
|
||||
List<Widget> around(Widget t) => addToStart(t).addToEnd(t);
|
||||
|
||||
List<Widget> addToStart(Widget t) =>
|
||||
enumerate.map((e) => e.value).toList()..insert(0, t);
|
||||
List<Widget> addToStart(Widget t) => enumerate.map((e) => e.value).toList()..insert(0, t);
|
||||
|
||||
List<Widget> addToEnd(Widget t) =>
|
||||
enumerate.map((e) => e.value).toList()..add(t);
|
||||
List<Widget> addToEnd(Widget t) => enumerate.map((e) => e.value).toList()..add(t);
|
||||
|
||||
List<Padding> paddingTopEach(double val) =>
|
||||
map((w) => Padding(padding: EdgeInsets.only(top: val), child: w))
|
||||
.toList();
|
||||
List<Padding> paddingTopEach(double val) => map((w) => Padding(padding: EdgeInsets.only(top: val), child: w)).toList();
|
||||
}
|
||||
|
||||
extension StatefulWidgetExtensions on State<StatefulWidget> {
|
||||
|
|
Loading…
Reference in New Issue