Last updated:
0 purchases
flutterpop
flutterpop #
How to use #
Step 1: Add to pubspec.yaml
flutter pub add flutterpop
copied to clipboard
Step 2: Wrap your MaterialApp to PopBody
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return PopBody( // Wrap your app by ToastaContainer
child: MaterialApp(
...
),
);
}
}
copied to clipboard
Step 3: Start using
void flarenotifyfunction({
required BuildContext context,
String? title,
bool? animate_subtitle,
required String subtitle,
required PopNotifyStatus toastertype,
}) {
final toast = PopModel(
titleColor: toastertype == PopNotifyStatus.success
? Colors.green
: (toastertype == PopNotifyStatus.failed ||
toastertype == PopNotifyStatus.error)
? Colors.red
: (toastertype == PopNotifyStatus.warning)
? Colors.orange
: Colors.black,
scroll_subtitle: animate_subtitle ?? false,
height: subtitle == null ? 20 : 50,
subtitlesize: 17,
duration: const Duration(seconds: 2),
title: (title != null && title.isNotEmpty) ? title : null,
subtitle: (subtitle != null && subtitle.isNotEmpty) ? subtitle : null,
status: (toastertype == PopNotifyStatus.success)
? PopNotifyStatus.success
: (toastertype == PopNotifyStatus.failed)
? PopNotifyStatus.failed
: (toastertype == PopNotifyStatus.warning)
? PopNotifyStatus.warning
: (toastertype == PopNotifyStatus.error)
? PopNotifyStatus.error
: PopNotifyStatus.info,
darkMode: false,
);
PopNotify(context).toast(toast);
}
copied to clipboard
failed, warning, success, info, error enum added to show prefix icons
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.