diff --git a/test/model/binding.dart b/test/model/binding.dart index fce29028ac..9d82daf974 100644 --- a/test/model/binding.dart +++ b/test/model/binding.dart @@ -280,11 +280,20 @@ typedef FlutterLocalNotificationsPluginShowCall = ( ); class FakeAndroidFlutterLocalNotificationsPlugin extends Fake implements AndroidFlutterLocalNotificationsPlugin { - List<AndroidNotificationChannel> createdChannels = []; + /// Consume the log of calls made to [createNotificationChannel]. + /// + /// This returns a list of the arguments to all calls made + /// to [createNotificationChannel] since the last call to this method. + List<AndroidNotificationChannel> takeCreatedChannels() { + final result = _createdChannels; + _createdChannels = []; + return result; + } + List<AndroidNotificationChannel> _createdChannels = []; @override Future<void> createNotificationChannel(AndroidNotificationChannel notificationChannel) async { - createdChannels.add(notificationChannel); + _createdChannels.add(notificationChannel); } }