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