Skip to content

Instantly share code, notes, and snippets.

@FlutterWiz
Created October 16, 2022 18:40
Show Gist options
  • Select an option

  • Save FlutterWiz/93abb8cb4830b185063cc0b626241515 to your computer and use it in GitHub Desktop.

Select an option

Save FlutterWiz/93abb8cb4830b185063cc0b626241515 to your computer and use it in GitHub Desktop.
return Consumer(
builder: (context, ref, child) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
NotificationButton(
buttonText: "Send Notification!",
buttonBackgroundColor:
MaterialStateProperty.all(Colors.deepOrange),
onPressed: () {
ref
.read(notificationProvider.notifier)
.mapEventsToState(const SendNormalNotification());
},
),
const SizedBox(height: 30),
NotificationButton(
buttonText: "Send Notification After 3 Seconds!",
buttonBackgroundColor: MaterialStateProperty.all(Colors.indigo),
onPressed: () {
ref
.read(notificationProvider.notifier)
.mapEventsToState(const SendNotificationAfter3Seconds());
},
),
],
),
);
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment