mo-ah-dawood / fcm_config

10 stars 12 forks source link

How to display my own message widget? #1

Closed NoldyNayoan closed 3 years ago

NoldyNayoan commented 3 years ago

Hi, how to display my own message widget, if my app is in foreground?

mo-ah-dawood commented 3 years ago

The main purpose of this package is to show head up notification while in foreground

any way you still can do what you need as next

class MyScreen extends StatefulWidget {
  @override
  _MyScreenState createState() => _MyScreenState();
}

class _MyScreenState extends State<MyScreen>
    with FCMNotificationMixin {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
     //.....
    );
  }

  @override
  void onNotify(RemoteMessage notification) {
    // here you can show your own widget
  }
}

hope this help you