From 87ca72bf2355ac19d42fc6b497c51232be0a7de1 Mon Sep 17 00:00:00 2001 From: Seungsoo Lee Date: Thu, 25 Jun 2026 12:28:43 +0900 Subject: [PATCH 1/7] [tizen_notification] Fix null check error when show() is called without details Fix a TypeError caused by a null check operator (!) on the 'properties' key in the details map when no TizenNotificationDetails is provided. The default value of 0 is now used when properties is absent. Co-Authored-By: Claude Sonnet 4.6 --- packages/tizen_notification/CHANGELOG.md | 3 ++- packages/tizen_notification/lib/tizen_notification.dart | 2 +- packages/tizen_notification/pubspec.yaml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/tizen_notification/CHANGELOG.md b/packages/tizen_notification/CHANGELOG.md index 6fa1292fb..f95dca8f3 100644 --- a/packages/tizen_notification/CHANGELOG.md +++ b/packages/tizen_notification/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.2.1 +* Fix null check error when calling show() without TizenNotificationDetails. * Update minimum Flutter and Dart version to 3.13 and 3.1. * Update code format. diff --git a/packages/tizen_notification/lib/tizen_notification.dart b/packages/tizen_notification/lib/tizen_notification.dart index 3555a66b7..75d9b8e1b 100644 --- a/packages/tizen_notification/lib/tizen_notification.dart +++ b/packages/tizen_notification/lib/tizen_notification.dart @@ -30,7 +30,7 @@ class TizenNotificationPlugin { // Set disableAppLaunch automatically if appControl is unset. if (notificationDetails?.appControl == null) { - final int properties = details['properties']! as int; + final int properties = (details['properties'] as int?) ?? 0; details['properties'] = properties | NotificationProperty.disableAppLaunch; } diff --git a/packages/tizen_notification/pubspec.yaml b/packages/tizen_notification/pubspec.yaml index 26797b185..5ab4bf091 100644 --- a/packages/tizen_notification/pubspec.yaml +++ b/packages/tizen_notification/pubspec.yaml @@ -2,7 +2,7 @@ name: tizen_notification description: Tizen notification APIs. Used to show and delete notifications on a Tizen device. homepage: https://github.com/flutter-tizen/plugins repository: https://github.com/flutter-tizen/plugins/tree/master/packages/tizen_notification -version: 0.2.0 +version: 0.2.1 environment: sdk: ">=3.1.0 <4.0.0" From 32826f8cac2057c234ea04ae36568e3ca22868f3 Mon Sep 17 00:00:00 2001 From: Seungsoo Lee Date: Thu, 25 Jun 2026 12:28:53 +0900 Subject: [PATCH 2/7] [tizen_notification] Add regression integration tests Add 5 Tizen regression test cases for the TizenNotificationPlugin API: - show notification with title and body does not throw - show notification with default title and body does not throw - cancel notification does not throw - cancelAll does not throw - show notification with TizenNotificationDetails does not throw Note: cancel() with a non-existent ID throws PlatformException (expected native API behavior), so that case is not tested here. The show() bug fix (null check) kept all show-related tests passing. Co-Authored-By: Claude Sonnet 4.6 --- packages/tizen_notification/CHANGELOG.md | 1 + .../tizen_notification_test.dart | 54 +++++++++++++++++++ .../tizen_notification/example/pubspec.yaml | 10 ++++ .../example/test_driver/integration_test.dart | 7 +++ 4 files changed, 72 insertions(+) create mode 100644 packages/tizen_notification/example/integration_test/tizen_notification_test.dart create mode 100644 packages/tizen_notification/example/test_driver/integration_test.dart diff --git a/packages/tizen_notification/CHANGELOG.md b/packages/tizen_notification/CHANGELOG.md index f95dca8f3..c87a699c1 100644 --- a/packages/tizen_notification/CHANGELOG.md +++ b/packages/tizen_notification/CHANGELOG.md @@ -1,5 +1,6 @@ ## 0.2.1 +* Add regression integration tests. * Fix null check error when calling show() without TizenNotificationDetails. * Update minimum Flutter and Dart version to 3.13 and 3.1. * Update code format. diff --git a/packages/tizen_notification/example/integration_test/tizen_notification_test.dart b/packages/tizen_notification/example/integration_test/tizen_notification_test.dart new file mode 100644 index 000000000..48144b391 --- /dev/null +++ b/packages/tizen_notification/example/integration_test/tizen_notification_test.dart @@ -0,0 +1,54 @@ +// Copyright 2024 Samsung Electronics Co., Ltd. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter_test/flutter_test.dart'; +import 'package:integration_test/integration_test.dart'; +import 'package:tizen_notification/tizen_notification.dart'; + +void main() { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + late TizenNotificationPlugin plugin; + + setUp(() { + plugin = TizenNotificationPlugin(); + }); + + group('TizenNotificationPlugin', () { + testWidgets('show notification does not throw', (tester) async { + await plugin.show(1, title: 'Test Title', body: 'Test Body'); + }); + + testWidgets('show notification with default title and body does not throw', + (tester) async { + await plugin.show(2); + }); + + testWidgets('cancel notification does not throw', (tester) async { + await plugin.show(3, title: 'To Cancel'); + await plugin.cancel(3); + }); + + testWidgets('cancelAll does not throw', (tester) async { + await plugin.show(4, title: 'Notification 1'); + await plugin.show(5, title: 'Notification 2'); + await plugin.cancelAll(); + }); + + testWidgets('show notification with TizenNotificationDetails does not throw', + (tester) async { + final TizenNotificationDetails details = TizenNotificationDetails( + properties: NotificationProperty.disableAutoDelete, + style: NotificationStyle.tray, + ); + await plugin.show( + 6, + title: 'Detailed', + body: 'With details', + notificationDetails: details, + ); + await plugin.cancel(6); + }); + }); +} diff --git a/packages/tizen_notification/example/pubspec.yaml b/packages/tizen_notification/example/pubspec.yaml index 212ca9530..1957782f8 100644 --- a/packages/tizen_notification/example/pubspec.yaml +++ b/packages/tizen_notification/example/pubspec.yaml @@ -12,5 +12,15 @@ dependencies: tizen_notification: path: ../ +dev_dependencies: + flutter_driver: + sdk: flutter + flutter_test: + sdk: flutter + integration_test: + sdk: flutter + integration_test_tizen: + path: ../../integration_test/ + flutter: uses-material-design: true diff --git a/packages/tizen_notification/example/test_driver/integration_test.dart b/packages/tizen_notification/example/test_driver/integration_test.dart new file mode 100644 index 000000000..4f10f2a52 --- /dev/null +++ b/packages/tizen_notification/example/test_driver/integration_test.dart @@ -0,0 +1,7 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:integration_test/integration_test_driver.dart'; + +Future main() => integrationDriver(); From 99c2d9d9829a56ad8c8fc324fd71d2a6a434b1fe Mon Sep 17 00:00:00 2001 From: Seungsoo Lee Date: Thu, 25 Jun 2026 17:38:47 +0900 Subject: [PATCH 3/7] [tizen_notification] Update README version to 0.2.1 Co-Authored-By: Claude Sonnet 4.6 --- packages/tizen_notification/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tizen_notification/README.md b/packages/tizen_notification/README.md index e0c418df1..781fe03e3 100644 --- a/packages/tizen_notification/README.md +++ b/packages/tizen_notification/README.md @@ -10,7 +10,7 @@ To use this plugin, add `tizen_notification` as a dependency in your `pubspec.ya ```yaml dependencies: - tizen_notification: ^0.2.0 + tizen_notification: ^0.2.1 ``` Then you can import `tizen_notification` in your Dart code: From 35f51bf52d9c94a1c651cd47e58b66f49465ef4a Mon Sep 17 00:00:00 2001 From: Seungsoo Lee Date: Thu, 25 Jun 2026 17:41:07 +0900 Subject: [PATCH 4/7] [tizen_notification] Fix copyright year in newly created file Co-Authored-By: Claude Sonnet 4.6 --- .../example/integration_test/tizen_notification_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tizen_notification/example/integration_test/tizen_notification_test.dart b/packages/tizen_notification/example/integration_test/tizen_notification_test.dart index 48144b391..6688cca34 100644 --- a/packages/tizen_notification/example/integration_test/tizen_notification_test.dart +++ b/packages/tizen_notification/example/integration_test/tizen_notification_test.dart @@ -1,4 +1,4 @@ -// Copyright 2024 Samsung Electronics Co., Ltd. All rights reserved. +// Copyright 2026 Samsung Electronics Co., Ltd. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. From 09dc7458949a603f6b2632e526b3516afa54c6d3 Mon Sep 17 00:00:00 2001 From: Seungsoo Lee Date: Thu, 25 Jun 2026 17:49:00 +0900 Subject: [PATCH 5/7] [tizen_notification] Fix missing WidgetTester type annotations in tests Co-Authored-By: Claude Sonnet 4.6 --- .../integration_test/tizen_notification_test.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/tizen_notification/example/integration_test/tizen_notification_test.dart b/packages/tizen_notification/example/integration_test/tizen_notification_test.dart index 6688cca34..256284917 100644 --- a/packages/tizen_notification/example/integration_test/tizen_notification_test.dart +++ b/packages/tizen_notification/example/integration_test/tizen_notification_test.dart @@ -16,28 +16,28 @@ void main() { }); group('TizenNotificationPlugin', () { - testWidgets('show notification does not throw', (tester) async { + testWidgets('show notification does not throw', (WidgetTester tester) async { await plugin.show(1, title: 'Test Title', body: 'Test Body'); }); testWidgets('show notification with default title and body does not throw', - (tester) async { + (WidgetTester tester) async { await plugin.show(2); }); - testWidgets('cancel notification does not throw', (tester) async { + testWidgets('cancel notification does not throw', (WidgetTester tester) async { await plugin.show(3, title: 'To Cancel'); await plugin.cancel(3); }); - testWidgets('cancelAll does not throw', (tester) async { + testWidgets('cancelAll does not throw', (WidgetTester tester) async { await plugin.show(4, title: 'Notification 1'); await plugin.show(5, title: 'Notification 2'); await plugin.cancelAll(); }); testWidgets('show notification with TizenNotificationDetails does not throw', - (tester) async { + (WidgetTester tester) async { final TizenNotificationDetails details = TizenNotificationDetails( properties: NotificationProperty.disableAutoDelete, style: NotificationStyle.tray, From 665a70103afae921aa89a68d835366672a88489e Mon Sep 17 00:00:00 2001 From: Seungsoo Lee Date: Thu, 9 Jul 2026 10:34:08 +0900 Subject: [PATCH 6/7] [tizen_notification] Fix dart format drift --- .../integration_test/tizen_notification_test.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/tizen_notification/example/integration_test/tizen_notification_test.dart b/packages/tizen_notification/example/integration_test/tizen_notification_test.dart index 256284917..ed6ca1ab7 100644 --- a/packages/tizen_notification/example/integration_test/tizen_notification_test.dart +++ b/packages/tizen_notification/example/integration_test/tizen_notification_test.dart @@ -16,7 +16,8 @@ void main() { }); group('TizenNotificationPlugin', () { - testWidgets('show notification does not throw', (WidgetTester tester) async { + testWidgets('show notification does not throw', + (WidgetTester tester) async { await plugin.show(1, title: 'Test Title', body: 'Test Body'); }); @@ -25,7 +26,8 @@ void main() { await plugin.show(2); }); - testWidgets('cancel notification does not throw', (WidgetTester tester) async { + testWidgets('cancel notification does not throw', + (WidgetTester tester) async { await plugin.show(3, title: 'To Cancel'); await plugin.cancel(3); }); @@ -36,7 +38,8 @@ void main() { await plugin.cancelAll(); }); - testWidgets('show notification with TizenNotificationDetails does not throw', + testWidgets( + 'show notification with TizenNotificationDetails does not throw', (WidgetTester tester) async { final TizenNotificationDetails details = TizenNotificationDetails( properties: NotificationProperty.disableAutoDelete, From 07c69488c53ff5755680229ba721214f06e621c5 Mon Sep 17 00:00:00 2001 From: Seungsoo Lee Date: Fri, 10 Jul 2026 15:25:24 +0900 Subject: [PATCH 7/7] [tizen_notification] Clean up notifications in tearDown Per review: cancel all notifications after each test so nothing is left in the quick panel even when a test fails mid-way. --- .../example/integration_test/tizen_notification_test.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/tizen_notification/example/integration_test/tizen_notification_test.dart b/packages/tizen_notification/example/integration_test/tizen_notification_test.dart index ed6ca1ab7..22f6935d1 100644 --- a/packages/tizen_notification/example/integration_test/tizen_notification_test.dart +++ b/packages/tizen_notification/example/integration_test/tizen_notification_test.dart @@ -15,6 +15,10 @@ void main() { plugin = TizenNotificationPlugin(); }); + tearDown(() async { + await plugin.cancelAll(); + }); + group('TizenNotificationPlugin', () { testWidgets('show notification does not throw', (WidgetTester tester) async {