flarenotify

How to use

Step 1: Add to pubspec.yaml

flutter pub add flarenotify

Step 2: Wrap your MaterialApp to FlareBody

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return FlareBody( // Wrap your app by ToastaContainer
      child: MaterialApp(
        ...
      ),
    );
  }
}

Step 3: Start using

void flarenotifyfunction(BuildContext context,
    {String? title, required String subtitle, required String toastertype}) {
  final toast = Flare(
    height: title == null ? 30 : null,
    duration: const Duration(seconds: 5),
    title: (title != null && title.isNotEmpty) ? title : null,
    subtitle: (subtitle != null && subtitle.isNotEmpty) ? subtitle : null,
    status: (toastertype == 'S')
        ? FlareNotifyStatus.success
        : (toastertype == 'F')
        ? FlareNotifyStatus.failed
        : (toastertype == 'W')
        ? FlareNotifyStatus.warning
        : FlareNotifyStatus.info,
    darkMode: darkMode,
  );
  FlareNotify(context).toast(toast);
}