feature: changes on register page / useer model
This commit is contained in:
@@ -1,27 +1,22 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../globals.dart';
|
||||
import 'package:motion_toast/motion_toast.dart';
|
||||
import 'package:motion_toast/resources/arrays.dart';
|
||||
|
||||
class SnackBarService {
|
||||
static void showSnackBar({required String content, bool error = false}) {
|
||||
snackbarKey.currentState?.showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(
|
||||
content,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black,
|
||||
),
|
||||
static void showSnackBar({required BuildContext context, required String message}) {
|
||||
MotionToast.error(
|
||||
title: const Text(
|
||||
"ERRO",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
backgroundColor: error ? Colors.red : Colors.green,
|
||||
duration: const Duration(seconds: 3),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
elevation: 8.0,
|
||||
),
|
||||
);
|
||||
description: Text(message),
|
||||
position: MotionToastPosition.top,
|
||||
barrierColor: Colors.black.withOpacity(0.3),
|
||||
width: 300,
|
||||
height: 80,
|
||||
dismissable: false,
|
||||
).show(context);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user