loading static method

GlobalKey<FlushbarState<Object?>> loading({
  1. required BuildContext context,
  2. required String title,
  3. required Widget icon,
  4. String? description,
  5. Function? onUndo,
})

Implementation

static GlobalKey<FlushbarState> loading({
  required BuildContext context,
  required String title,
  required Widget icon,
  String? description,
  Function? onUndo,
}) {
  GlobalKey<FlushbarState> key = GlobalKey();

  Flushbar flushbar = baseToast(
    key: key,
    title: TodayText(
      title,
      style: TodayTextStyle.tdsFontRegularPlus,
      color: TodayTextColor.fullWhite,
    ),
    description: description != null
        ? TodayText(
            description,
            style: TodayTextStyle.tdsFontSmall,
            color: TodayTextColor.fullWhite,
          )
        : null,
    icon: icon,
    onUndo: onUndo,
    backgroundColor: const Color.fromRGBO(23, 23, 23, 1),
    duration: 10000,
    isDismissible: false,
  );

  flushbar.show(context);

  return key;
}