Skip to content

Commit ac69878

Browse files
authored
[various] bumped maximum Dart SDK constraint (#1990)
* bumped maximum Dart SDK constraint * updated example app to iOS 11 * add changelog entry on example app update * recreated macOS side of example app * fix up macOS example app * add Podfile to source control * removed unnecessary parenthesis * recreated iOS side of example app * fix integration tests * fixed deprecation warnings with setMockMethodCallHandler calls * Revert "fixed deprecation warnings with setMockMethodCallHandler calls" This reverts commit c950758.
1 parent a749289 commit ac69878

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+679
-157
lines changed

flutter_local_notifications/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# [14.0.0+2]
2+
3+
* Bumped maximum Dart SDK constraint
4+
* Recreated iOS and macOS side of the example app so they would build and run with Flutter 3.10 having landed on stable channel
5+
6+
17
# [14.0.0+1]
28

39
* Updated cavaet on scheduling Android notifications where a link to https://dontkillmyapp.com has been added as it contains instructions on how to configure various devices to bypass the battery optimisations that prevent background processes from working e.g. scheduled notifications
Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
# This file tracks properties of this Flutter project.
22
# Used by Flutter tool to assess capabilities and perform upgrades etc.
33
#
4-
# This file should be version controlled and should not be manually edited.
4+
# This file should be version controlled.
55

66
version:
7-
revision: 3ea4d06340a97a1e9d7cae97567c64e0569dcaa2
8-
channel: beta
7+
revision: 84a1e904f44f9b0e9c4510138010edcc653163f8
8+
channel: stable
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8
17+
base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8
18+
- platform: macos
19+
create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8
20+
base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

flutter_local_notifications/example/integration_test/flutter_local_notifications_test.dart

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// @dart = 2.9
2-
31
import 'dart:io';
42

53
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
@@ -24,13 +22,13 @@ void main() {
2422
iOS: initializationSettingsIOS,
2523
macOS: initializationSettingsMacOS,
2624
linux: initializationSettingsLinux);
27-
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
25+
late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
2826
group('initialize()', () {
2927
setUpAll(() async {
3028
flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
3129
});
3230
testWidgets('can initialise', (WidgetTester tester) async {
33-
final bool initialised = await flutterLocalNotificationsPlugin
31+
final bool? initialised = await flutterLocalNotificationsPlugin
3432
.initialize(initializationSettings);
3533
expect(initialised, isTrue);
3634
});
@@ -40,29 +38,26 @@ void main() {
4038
'should throw an ArgumentError', (WidgetTester tester) async {
4139
const InitializationSettings initializationSettings =
4240
InitializationSettings();
43-
try {
44-
await flutterLocalNotificationsPlugin
45-
.initialize(initializationSettings);
46-
// ignore: avoid_catches_without_on_clauses
47-
} catch (e) {
48-
expect(e, isArgumentError);
49-
if (Platform.isAndroid) {
50-
expect(e.message,
51-
'Android settings must be set when targeting Android platform.');
52-
}
53-
if (Platform.isIOS) {
54-
expect(e.message,
55-
'iOS settings must be set when targeting iOS platform.');
56-
}
57-
if (Platform.isLinux) {
58-
expect(e.message,
59-
'Linux settings must be set when targeting Linux platform.');
60-
}
61-
if (Platform.isMacOS) {
62-
expect(e.message,
63-
'macOS settings must be set when targeting macOS platform.');
64-
}
41+
late Matcher errorMessageMatcher;
42+
if (Platform.isAndroid) {
43+
errorMessageMatcher = equals(
44+
'Android settings must be set when targeting Android platform.');
45+
} else if (Platform.isIOS) {
46+
errorMessageMatcher =
47+
equals('iOS settings must be set when targeting iOS platform.');
48+
} else if (Platform.isLinux) {
49+
equals('Linux settings must be set when targeting Linux platform.');
50+
} else if (Platform.isMacOS) {
51+
errorMessageMatcher =
52+
equals('macOS settings must be set when targeting macOS platform.');
53+
} else {
54+
errorMessageMatcher = anything;
6555
}
56+
expect(
57+
() async => await flutterLocalNotificationsPlugin
58+
.initialize(initializationSettings),
59+
throwsA(isArgumentError.having(
60+
(ArgumentError e) => e.message, 'message', errorMessageMatcher)));
6661
});
6762
});
6863
group('resolvePlatformSpecificImplementation()', () {

flutter_local_notifications/example/ios/.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
**/dgph
12
*.mode1v3
23
*.mode2v3
34
*.moved-aside
@@ -18,6 +19,7 @@ Flutter/App.framework
1819
Flutter/Flutter.framework
1920
Flutter/Flutter.podspec
2021
Flutter/Generated.xcconfig
22+
Flutter/ephemeral/
2123
Flutter/app.flx
2224
Flutter/app.zip
2325
Flutter/flutter_assets/
@@ -31,5 +33,4 @@ Runner/GeneratedPluginRegistrant.*
3133
!default.pbxuser
3234
!default.perspectivev3
3335

34-
Podfile
35-
Podfile.lock
36+
Podfile.lock

flutter_local_notifications/example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>9.0</string>
24+
<string>11.0</string>
2525
</dict>
2626
</plist>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
22
#include "Generated.xcconfig"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
22
#include "Generated.xcconfig"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Uncomment this line to define a global platform for your project
2+
# platform :ios, '11.0'
3+
4+
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5+
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6+
7+
project 'Runner', {
8+
'Debug' => :debug,
9+
'Profile' => :release,
10+
'Release' => :release,
11+
}
12+
13+
def flutter_root
14+
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15+
unless File.exist?(generated_xcode_build_settings_path)
16+
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17+
end
18+
19+
File.foreach(generated_xcode_build_settings_path) do |line|
20+
matches = line.match(/FLUTTER_ROOT\=(.*)/)
21+
return matches[1].strip if matches
22+
end
23+
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24+
end
25+
26+
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27+
28+
flutter_ios_podfile_setup
29+
30+
target 'Runner' do
31+
use_frameworks!
32+
use_modular_headers!
33+
34+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35+
target 'RunnerTests' do
36+
inherit! :search_paths
37+
end
38+
end
39+
40+
post_install do |installer|
41+
installer.pods_project.targets.each do |target|
42+
flutter_additional_ios_build_settings(target)
43+
end
44+
end

0 commit comments

Comments
 (0)