Skip to content

Commit

Permalink
make nicer for log of created channels, too
Browse files Browse the repository at this point in the history
  • Loading branch information
gnprice committed Oct 12, 2023
1 parent 483712a commit a0eb3dc
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/model/binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit a0eb3dc

Please sign in to comment.