feat: update user
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../common/theme/theme.dart';
|
||||
import '../../../domain/auth/auth.dart';
|
||||
import '../../../domain/user/user.dart';
|
||||
|
||||
class AppFlushbar {
|
||||
static void showSuccess(BuildContext context, String message) {
|
||||
@@ -51,4 +52,15 @@ class AppFlushbar {
|
||||
unexpectedError: (value) => 'Error has eccoured',
|
||||
),
|
||||
);
|
||||
|
||||
static void showUserFailureToast(BuildContext context, UserFailure failure) =>
|
||||
showError(
|
||||
context,
|
||||
failure.map(
|
||||
serverError: (value) => value.failure.toStringFormatted(context),
|
||||
dynamicErrorMessage: (value) => value.erroMessage,
|
||||
unexpectedError: (value) => 'Error has eccoured',
|
||||
empty: (value) => 'Data not found',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user