init method

dynamic init({
  1. Future<bool?> confirmDialog({
    1. required BuildContext context,
    2. required String message,
    3. required String? title,
    })?,
  2. Future<bool?> errorDialog({
    1. required BuildContext context,
    2. required String message,
    3. required String? title,
    })?,
  3. Future<void> alertDialog({
    1. required BuildContext context,
    2. required String message,
    3. required String? title,
    })?,
  4. Future<String?> inputDialog({
    1. required BuildContext context,
    2. required String hintText,
    3. required String? initialValue,
    4. required int? maxLines,
    5. required int? minLines,
    6. required String? subtitle,
    7. required String title,
    })?,
})

Implementation

init({
  // String? cloudFunctionRegion,
  // Color? toastBackgroundColor,
  // Color? toastForegroundColor,
  // BuildContext Function()? globalContext,
  Future<bool?> Function({
    required BuildContext context,
    required String? title,
    required String message,
  })? confirmDialog,
  Future<bool?> Function({
    required BuildContext context,
    required String? title,
    required String message,
  })? errorDialog,
  Future<void> Function({
    required BuildContext context,
    required String? title,
    required String message,
  })? alertDialog,
  Future<String?> Function({
    required BuildContext context,
    required String title,
    required String? subtitle,
    required String hintText,
    required String? initialValue,
    required int? minLines,
    required int? maxLines,
  })? inputDialog,
}) {
  // _globalContext = globalContext;
  this.confirmDialog = confirmDialog;
  this.errorDialog = errorDialog;
  this.alertDialog = alertDialog;
  this.inputDialog = inputDialog;
}