custom_dialog.dart

mail@pastecode.io avatar
unknown
dart
2 years ago
615 B
1
Indexable
Never
// ignore: import_of_legacy_library_into_null_safe
import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:flutter/material.dart';

// ignore: non_constant_identifier_names
Future CustomDialog(context, text, okPress, okText, cancelPress, cancelText,
    DialogType dialogType) {
  return AwesomeDialog(
    width: MediaQuery.of(context).size.width * 0.7,
    context: context,
    dialogType: dialogType,
    animType: AnimType.BOTTOMSLIDE,
    title: text,
    desc: '',
    btnOkOnPress: okPress,
    btnCancelText: cancelText,
    btnOkText: okText,
    btnCancelOnPress: cancelPress,
  ).show();
}