Feat: Ajuste nas SnackBar
This commit is contained in:
parent
33a8b614bc
commit
120b9d7116
|
@ -145,6 +145,7 @@ class _CustomInputUtilState extends State<CustomInputUtil> {
|
||||||
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
useGoogleFonts: GoogleFonts.asMap().containsKey(
|
||||||
FlutterFlowTheme.of(context).bodyMediumFamily,
|
FlutterFlowTheme.of(context).bodyMediumFamily,
|
||||||
),
|
),
|
||||||
|
fontSize: limitedInputTextSize,
|
||||||
),
|
),
|
||||||
maxLines: null,
|
maxLines: null,
|
||||||
maxLength: widget.haveMaxLength ? widget.maxLength : null,
|
maxLength: widget.haveMaxLength ? widget.maxLength : null,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:fluttertoast/fluttertoast.dart';
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
|
|
||||||
class ToastUtil {
|
class ToastUtil {
|
||||||
static void showToast({
|
static void showToast({
|
||||||
|
@ -8,7 +9,7 @@ class ToastUtil {
|
||||||
Toast toastLength = Toast.LENGTH_SHORT,
|
Toast toastLength = Toast.LENGTH_SHORT,
|
||||||
Color backgroundColor = Colors.black,
|
Color backgroundColor = Colors.black,
|
||||||
Color textColor = Colors.white,
|
Color textColor = Colors.white,
|
||||||
double fontSize = 16.0,
|
double fontSize = 16,
|
||||||
}) {
|
}) {
|
||||||
Fluttertoast.showToast(
|
Fluttertoast.showToast(
|
||||||
msg: message,
|
msg: message,
|
||||||
|
|
|
@ -6,6 +6,7 @@ import 'package:hub/flutter_flow/nav/nav.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/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';
|
||||||
|
|
||||||
import '../../../shared/services/authentication/authentication_service.dart';
|
import '../../../shared/services/authentication/authentication_service.dart';
|
||||||
|
@ -52,7 +53,8 @@ class _BottomArrowLinkedLocalsComponentWidgetState extends State<BottomArrowLink
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: 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,
|
||||||
|
|
|
@ -719,6 +719,7 @@ class _RegisiterVistorTemplateComponentWidgetState extends State<RegisiterVistor
|
||||||
ptText: 'Visitante cadastrado com sucesso.',
|
ptText: 'Visitante cadastrado com sucesso.',
|
||||||
enText: 'Visitor successfully registered.'),
|
enText: 'Visitor successfully registered.'),
|
||||||
style: TextStyle(color: FlutterFlowTheme.of(context).info,
|
style: TextStyle(color: FlutterFlowTheme.of(context).info,
|
||||||
|
fontSize: limitedInputFontSize,
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
|
@ -63,17 +63,6 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(0.0, 10.0, 0.0, 0.0),
|
||||||
child: Container(
|
|
||||||
width: MediaQuery.of(context).size.width,
|
|
||||||
decoration: const BoxDecoration(
|
|
||||||
color: Colors.transparent,
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
bottomLeft: Radius.circular(0.0),
|
|
||||||
bottomRight: Radius.circular(0.0),
|
|
||||||
topLeft: Radius.circular(15.0),
|
|
||||||
topRight: Radius.circular(15.0),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.max,
|
mainAxisSize: MainAxisSize.max,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
@ -86,6 +75,9 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Column(children: [
|
||||||
|
|
||||||
|
],),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 25.0, 16.0, 0.0),
|
padding: const EdgeInsetsDirectional.fromSTEB(16.0, 25.0, 16.0, 0.0),
|
||||||
child: TextFormField(
|
child: TextFormField(
|
||||||
|
@ -347,7 +339,6 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
const SizedBox(height: 30.0)
|
const SizedBox(height: 30.0)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -381,7 +372,9 @@ class _VisitorSearchModalTemplateComponentWidgetState extends State<VisitorSearc
|
||||||
message: FFLocalizations.of(context)
|
message: FFLocalizations.of(context)
|
||||||
.getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'),
|
.getVariableText(ptText: 'Visitante já adicionado!', enText: 'Visitor already added!'),
|
||||||
gravity: ToastGravity.TOP,
|
gravity: ToastGravity.TOP,
|
||||||
backgroundColor: Colors.red);
|
backgroundColor: Colors.red,
|
||||||
|
fontSize: LimitedFontSizeUtil.getBodyFontSize(context)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await showAdaptiveDialog(
|
await showAdaptiveDialog(
|
||||||
|
|
|
@ -524,6 +524,7 @@ void showSnackbar(
|
||||||
message,
|
message,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: FlutterFlowTheme.of(context).info,
|
color: FlutterFlowTheme.of(context).info,
|
||||||
|
fontSize: LimitedFontSizeUtil.getBodyFontSize(context),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -7,6 +7,7 @@ import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'package:google_mlkit_face_detection/google_mlkit_face_detection.dart';
|
import 'package:google_mlkit_face_detection/google_mlkit_face_detection.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.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:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
import 'package:mime_type/mime_type.dart';
|
import 'package:mime_type/mime_type.dart';
|
||||||
|
|
||||||
|
@ -557,7 +558,11 @@ void showUploadMessage(
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(message, style: FlutterFlowTheme.of(context).bodyMedium),
|
|
||||||
|
Text(
|
||||||
|
message, style: TextStyle(
|
||||||
|
color: FlutterFlowTheme.of(context).primaryText,
|
||||||
|
fontSize: LimitedFontSizeUtil.getBodyFontSize(context), )),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
backgroundColor: FlutterFlowTheme.of(context).primary,
|
backgroundColor: FlutterFlowTheme.of(context).primary,
|
||||||
|
|
|
@ -11,6 +11,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/acess_history_page/acess_history_page_model.dart';
|
import 'package:hub/pages/acess_history_page/acess_history_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';
|
||||||
import 'package:rxdart/rxdart.dart';
|
import 'package:rxdart/rxdart.dart';
|
||||||
|
|
||||||
|
@ -223,6 +224,7 @@ class _AccessHistoryState extends State<AccessHistoryScreen> {
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: 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,
|
||||||
|
|
|
@ -10,6 +10,7 @@ import 'package:hub/flutter_flow/flutter_flow_widgets.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/pages/liberation_history/liberation_history_model.dart';
|
import 'package:hub/pages/liberation_history/liberation_history_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';
|
||||||
import 'package:hub/shared/utils/validator_util.dart';
|
import 'package:hub/shared/utils/validator_util.dart';
|
||||||
|
|
||||||
|
@ -347,6 +348,10 @@ class _LiberationHistoryWidgetState extends State<LiberationHistoryWidget> {
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: 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,
|
||||||
|
|
|
@ -275,6 +275,10 @@ class _MessageHistoryPageWidgetState extends State<MessageHistoryPageWidget> wit
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: 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,
|
||||||
|
|
|
@ -80,6 +80,10 @@ class _PackageOrderPage extends State<PackageOrderPage> {
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: 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,
|
||||||
|
|
|
@ -105,6 +105,10 @@ class _PetsHistoryScreenState extends State<PetsHistoryScreen> with TickerProvid
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: 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,
|
||||||
|
|
|
@ -906,8 +906,7 @@ class _ScheduleCompleteVisitPageWidgetState extends State<ScheduleCompleteVisitP
|
||||||
.requestFocus(model.unfocusNode)
|
.requestFocus(model.unfocusNode)
|
||||||
: FocusScope.of(context).unfocus(),
|
: FocusScope.of(context).unfocus(),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: MediaQuery.of(context).size.height *
|
height: MediaQuery.of(context).size.height * 0.8,
|
||||||
0.8,
|
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: MediaQuery.viewInsetsOf(context),
|
padding: MediaQuery.viewInsetsOf(context),
|
||||||
|
@ -1548,7 +1547,9 @@ class _ScheduleCompleteVisitPageWidgetState extends State<ScheduleCompleteVisitP
|
||||||
ptText: 'Visitante já adicionado!',
|
ptText: 'Visitante já adicionado!',
|
||||||
enText: 'Visitor already added!'),
|
enText: 'Visitor already added!'),
|
||||||
gravity: ToastGravity.TOP,
|
gravity: ToastGravity.TOP,
|
||||||
backgroundColor: Colors.green);
|
backgroundColor: Colors.green,
|
||||||
|
fontSize: LimitedFontSizeUtil.getBodyFontSize(context),
|
||||||
|
);
|
||||||
|
|
||||||
await ShareUtil.showShare(value.jsonBody);
|
await ShareUtil.showShare(value.jsonBody);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -116,6 +116,10 @@ class _VisitHistoryWidgetState extends State<VisitHistoryWidget> with TickerProv
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: 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,14 +1,17 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hub/shared/utils/limited_text_size.dart';
|
||||||
|
|
||||||
import '../../flutter_flow/flutter_flow_theme.dart';
|
import '../../flutter_flow/flutter_flow_theme.dart';
|
||||||
|
|
||||||
class SnackBarUtil {
|
class SnackBarUtil {
|
||||||
static void showSnackBar(BuildContext context, String text, {bool isError = false}) {
|
static void showSnackBar(BuildContext context, String text, {bool isError = false}) {
|
||||||
|
double limitedBodyFontSize = LimitedFontSizeUtil.getBodyFontSize(context);
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
content: Text(
|
content: Text(
|
||||||
text,
|
text,
|
||||||
style: TextStyle(color: FlutterFlowTheme.of(context).info),
|
overflow: TextOverflow.clip,
|
||||||
|
style: TextStyle(color: FlutterFlowTheme.of(context).info, fontSize: limitedBodyFontSize),
|
||||||
),
|
),
|
||||||
backgroundColor: isError ? FlutterFlowTheme.of(context).error : FlutterFlowTheme.of(context).success,
|
backgroundColor: isError ? FlutterFlowTheme.of(context).error : FlutterFlowTheme.of(context).success,
|
||||||
duration: const Duration(seconds: 3),
|
duration: const Duration(seconds: 3),
|
||||||
|
|
Loading…
Reference in New Issue