30 lines
764 B
Dart
30 lines
764 B
Dart
import 'package:cool_alert/cool_alert.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:unit2/theme-data.dart/colors.dart';
|
|
|
|
confirmAlert(context, Function() yes) {
|
|
CoolAlert.show(
|
|
loopAnimation: true,
|
|
context: context,
|
|
type: CoolAlertType.confirm,
|
|
title: 'LOGOUT!',
|
|
text: 'Are you sure you want to logout?',
|
|
cancelBtnText: 'No',
|
|
confirmBtnText: 'Yes',
|
|
confirmBtnColor: second,
|
|
showCancelBtn: true,
|
|
barrierDismissible: false,
|
|
onConfirmBtnTap: yes);
|
|
}
|
|
|
|
errorAlert(context) {
|
|
CoolAlert.show(
|
|
context: context,
|
|
type: CoolAlertType.error,
|
|
confirmBtnColor: second,
|
|
title: 'Login Failed!',
|
|
text: 'username or password is incorrect.',
|
|
loopAnimation: false,
|
|
);
|
|
}
|