@@ -24,9 +24,9 @@ Future<void> main() async {
2424 runApp (
2525 MaterialApp (
2626 theme: ThemeData (
27- // primaryColor: Colors.pink,
28- // TODO: Add more theme colors here if you would like Inbox to automatically inherit styles
29- ),
27+ // primaryColor: Colors.pink,
28+ // TODO: Add more theme colors here if you would like Inbox to automatically inherit styles
29+ ),
3030 home: const MyApp (),
3131 ),
3232 );
@@ -63,30 +63,20 @@ class _MyAppState extends State<MyApp> {
6363 }
6464
6565 Future _start () async {
66-
6766 // Set the brand of the inbox
6867 await Courier .shared.setBrandId (id: 'AR1TTFKXSA49G2PGEKQ81Q9R9PT5' );
6968
70- _inboxListener = await Courier .shared.addInboxListener (onMessagesChanged: (messages, unreadMessageCount, totalMessageCount, canPaginate) async {
71-
72- setState (() {
73- _unreadMessageCount = unreadMessageCount;
74- });
75-
69+ _inboxListener = await Courier .shared.addInboxListener (onMessagesChanged: (messages, unreadMessageCount, totalMessageCount, canPaginate) {
70+ setState (() => _unreadMessageCount = unreadMessageCount);
7671 });
7772
7873 _pushListener = Courier .shared.addPushListener (
79- onPushClicked: (push) {
80- showAlert (context, 'Push Clicked' , push.toString ());
81- },
82- onPushDelivered: (push) {
83- showAlert (context, 'Push Delivered' , push.toString ());
84- },
74+ onPushClicked: (push) => showAlert (context, 'Push Clicked' , push.toString ()),
75+ onPushDelivered: (push) => showAlert (context, 'Push Delivered' , push.toString ()),
8576 );
8677
8778 try {
8879 final token = await FirebaseMessaging .instance.getToken ();
89-
9080 if (token != null ) {
9181 Courier .shared.setTokenForProvider (provider: CourierPushProvider .firebaseFcm, token: token);
9282 }
0 commit comments