Skip to content

Commit

Permalink
[various] bumped maximum Dart SDK constraint (#1990)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
MaikuB committed May 11, 2023
1 parent a749289 commit ac69878
Show file tree
Hide file tree
Showing 52 changed files with 679 additions and 157 deletions.
6 changes: 6 additions & 0 deletions flutter_local_notifications/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# [14.0.0+2]

* Bumped maximum Dart SDK constraint
* Recreated iOS and macOS side of the example app so they would build and run with Flutter 3.10 having landed on stable channel


# [14.0.0+1]

* 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
Expand Down
28 changes: 25 additions & 3 deletions flutter_local_notifications/example/.metadata
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
# This file should be version controlled.

version:
revision: 3ea4d06340a97a1e9d7cae97567c64e0569dcaa2
channel: beta
revision: 84a1e904f44f9b0e9c4510138010edcc653163f8
channel: stable

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8
base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8
- platform: macos
create_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8
base_revision: 84a1e904f44f9b0e9c4510138010edcc653163f8

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @dart = 2.9

import 'dart:io';

import 'package:flutter_local_notifications/flutter_local_notifications.dart';
Expand All @@ -24,13 +22,13 @@ void main() {
iOS: initializationSettingsIOS,
macOS: initializationSettingsMacOS,
linux: initializationSettingsLinux);
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
late FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
group('initialize()', () {
setUpAll(() async {
flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
});
testWidgets('can initialise', (WidgetTester tester) async {
final bool initialised = await flutterLocalNotificationsPlugin
final bool? initialised = await flutterLocalNotificationsPlugin
.initialize(initializationSettings);
expect(initialised, isTrue);
});
Expand All @@ -40,29 +38,26 @@ void main() {
'should throw an ArgumentError', (WidgetTester tester) async {
const InitializationSettings initializationSettings =
InitializationSettings();
try {
await flutterLocalNotificationsPlugin
.initialize(initializationSettings);
// ignore: avoid_catches_without_on_clauses
} catch (e) {
expect(e, isArgumentError);
if (Platform.isAndroid) {
expect(e.message,
'Android settings must be set when targeting Android platform.');
}
if (Platform.isIOS) {
expect(e.message,
'iOS settings must be set when targeting iOS platform.');
}
if (Platform.isLinux) {
expect(e.message,
'Linux settings must be set when targeting Linux platform.');
}
if (Platform.isMacOS) {
expect(e.message,
'macOS settings must be set when targeting macOS platform.');
}
late Matcher errorMessageMatcher;
if (Platform.isAndroid) {
errorMessageMatcher = equals(
'Android settings must be set when targeting Android platform.');
} else if (Platform.isIOS) {
errorMessageMatcher =
equals('iOS settings must be set when targeting iOS platform.');
} else if (Platform.isLinux) {
equals('Linux settings must be set when targeting Linux platform.');
} else if (Platform.isMacOS) {
errorMessageMatcher =
equals('macOS settings must be set when targeting macOS platform.');
} else {
errorMessageMatcher = anything;
}
expect(
() async => await flutterLocalNotificationsPlugin
.initialize(initializationSettings),
throwsA(isArgumentError.having(
(ArgumentError e) => e.message, 'message', errorMessageMatcher)));
});
});
group('resolvePlatformSpecificImplementation()', () {
Expand Down
5 changes: 3 additions & 2 deletions flutter_local_notifications/example/ios/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/dgph
*.mode1v3
*.mode2v3
*.moved-aside
Expand All @@ -18,6 +19,7 @@ Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/ephemeral/
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Expand All @@ -31,5 +33,4 @@ Runner/GeneratedPluginRegistrant.*
!default.pbxuser
!default.perspectivev3

Podfile
Podfile.lock
Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
44 changes: 44 additions & 0 deletions flutter_local_notifications/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
Loading

0 comments on commit ac69878

Please sign in to comment.