From a0eb3dcad710d5270cf4b435fe6f669517fba5ed Mon Sep 17 00:00:00 2001 From: Greg Price Date: Thu, 12 Oct 2023 16:47:51 -0700 Subject: [PATCH] make nicer for log of created channels, too --- test/model/binding.dart | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 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 takeCreatedChannels() { + final result = _createdChannels; + _createdChannels = []; + return result; + } + List _createdChannels = []; @override Future createNotificationChannel(AndroidNotificationChannel notificationChannel) async { - createdChannels.add(notificationChannel); + _createdChannels.add(notificationChannel); } }