step 4 : listing data rekaman audio
This commit is contained in:
@@ -33,8 +33,6 @@ class LoginScreen extends HookConsumerWidget {
|
||||
final isLoading = useState(false);
|
||||
final isSuccess = useState(false);
|
||||
|
||||
ToastificationItem? toastItem;
|
||||
|
||||
void showLongToast(
|
||||
String title,
|
||||
String message,
|
||||
@@ -42,7 +40,7 @@ class LoginScreen extends HookConsumerWidget {
|
||||
Duration waktu,
|
||||
) {
|
||||
if (typeToast == "success") {
|
||||
toastItem = toastification.show(
|
||||
toastification.show(
|
||||
context: context,
|
||||
title: Text(title),
|
||||
description: Text(message),
|
||||
@@ -50,7 +48,7 @@ class LoginScreen extends HookConsumerWidget {
|
||||
type: ToastificationType.success,
|
||||
);
|
||||
} else if (typeToast == "error") {
|
||||
toastItem = toastification.show(
|
||||
toastification.show(
|
||||
context: context,
|
||||
title: Text(title),
|
||||
description: Text(message),
|
||||
@@ -61,12 +59,6 @@ class LoginScreen extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
void hideToast() {
|
||||
if (toastItem != null) {
|
||||
toastification.dismissAll();
|
||||
}
|
||||
}
|
||||
|
||||
// proses login
|
||||
ref.listen(loginProvider, (prev, next) {
|
||||
if (next is LoginStateLoading) {
|
||||
@@ -81,7 +73,6 @@ class LoginScreen extends HookConsumerWidget {
|
||||
Duration(seconds: 3),
|
||||
);
|
||||
} else if (next is LoginStateDone) {
|
||||
hideToast();
|
||||
isLoading.value = false;
|
||||
isSuccess.value = true;
|
||||
ref.read(currentUserProvider.notifier).state = next.model;
|
||||
|
||||
Reference in New Issue
Block a user