Skip to content

Commit dab32a5

Browse files
committed
Bump to dart 3, fix android gradle namespace
1 parent fe955f6 commit dab32a5

File tree

8 files changed

+175
-106
lines changed

8 files changed

+175
-106
lines changed

android/build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ rootProject.allprojects {
2424
apply plugin: 'com.android.library'
2525

2626
android {
27+
// Conditional for compatibility with AGP <4.2.
28+
if (project.android.hasProperty("namespace")) {
29+
namespace 'in.jvapps.disable_battery_optimization'
30+
}
31+
2732
compileSdkVersion 31
2833
defaultConfig {
2934
minSdkVersion 21

example/ios/Flutter/Debug.xcconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#include "Generated.xcconfig"
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"

example/ios/Flutter/Release.xcconfig

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
12
#include "Generated.xcconfig"

example/ios/Podfile

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
32+
target 'RunnerTests' do
33+
inherit! :search_paths
34+
end
35+
end
36+
37+
post_install do |installer|
38+
installer.pods_project.targets.each do |target|
39+
flutter_additional_ios_build_settings(target)
40+
end
41+
end

example/pubspec.lock

+63-51
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,48 @@ packages:
55
dependency: transitive
66
description:
77
name: async
8-
url: "https://pub.dartlang.org"
8+
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
9+
url: "https://pub.dev"
910
source: hosted
10-
version: "2.8.2"
11+
version: "2.11.0"
1112
boolean_selector:
1213
dependency: transitive
1314
description:
1415
name: boolean_selector
15-
url: "https://pub.dartlang.org"
16+
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
17+
url: "https://pub.dev"
1618
source: hosted
17-
version: "2.1.0"
19+
version: "2.1.1"
1820
characters:
1921
dependency: transitive
2022
description:
2123
name: characters
22-
url: "https://pub.dartlang.org"
23-
source: hosted
24-
version: "1.2.0"
25-
charcode:
26-
dependency: transitive
27-
description:
28-
name: charcode
29-
url: "https://pub.dartlang.org"
24+
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
25+
url: "https://pub.dev"
3026
source: hosted
31-
version: "1.3.1"
27+
version: "1.3.0"
3228
clock:
3329
dependency: transitive
3430
description:
3531
name: clock
36-
url: "https://pub.dartlang.org"
32+
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
33+
url: "https://pub.dev"
3734
source: hosted
38-
version: "1.1.0"
35+
version: "1.1.1"
3936
collection:
4037
dependency: transitive
4138
description:
4239
name: collection
43-
url: "https://pub.dartlang.org"
40+
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
41+
url: "https://pub.dev"
4442
source: hosted
45-
version: "1.15.0"
43+
version: "1.17.1"
4644
cupertino_icons:
4745
dependency: "direct main"
4846
description:
4947
name: cupertino_icons
50-
url: "https://pub.dartlang.org"
48+
sha256: "1989d917fbe8e6b39806207df5a3fdd3d816cbd090fac2ce26fb45e9a71476e5"
49+
url: "https://pub.dev"
5150
source: hosted
5251
version: "1.0.4"
5352
disable_battery_optimization:
@@ -56,14 +55,15 @@ packages:
5655
path: ".."
5756
relative: true
5857
source: path
59-
version: "1.1.0"
58+
version: "1.1.0+1"
6059
fake_async:
6160
dependency: transitive
6261
description:
6362
name: fake_async
64-
url: "https://pub.dartlang.org"
63+
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
64+
url: "https://pub.dev"
6565
source: hosted
66-
version: "1.2.0"
66+
version: "1.3.1"
6767
flutter:
6868
dependency: "direct main"
6969
description: flutter
@@ -74,34 +74,46 @@ packages:
7474
description: flutter
7575
source: sdk
7676
version: "0.0.0"
77+
js:
78+
dependency: transitive
79+
description:
80+
name: js
81+
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
82+
url: "https://pub.dev"
83+
source: hosted
84+
version: "0.6.7"
7785
matcher:
7886
dependency: transitive
7987
description:
8088
name: matcher
81-
url: "https://pub.dartlang.org"
89+
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
90+
url: "https://pub.dev"
8291
source: hosted
83-
version: "0.12.11"
92+
version: "0.12.15"
8493
material_color_utilities:
8594
dependency: transitive
8695
description:
8796
name: material_color_utilities
88-
url: "https://pub.dartlang.org"
97+
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
98+
url: "https://pub.dev"
8999
source: hosted
90-
version: "0.1.3"
100+
version: "0.2.0"
91101
meta:
92102
dependency: transitive
93103
description:
94104
name: meta
95-
url: "https://pub.dartlang.org"
105+
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
106+
url: "https://pub.dev"
96107
source: hosted
97-
version: "1.7.0"
108+
version: "1.9.1"
98109
path:
99110
dependency: transitive
100111
description:
101112
name: path
102-
url: "https://pub.dartlang.org"
113+
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
114+
url: "https://pub.dev"
103115
source: hosted
104-
version: "1.8.0"
116+
version: "1.8.3"
105117
sky_engine:
106118
dependency: transitive
107119
description: flutter
@@ -111,58 +123,58 @@ packages:
111123
dependency: transitive
112124
description:
113125
name: source_span
114-
url: "https://pub.dartlang.org"
126+
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
127+
url: "https://pub.dev"
115128
source: hosted
116-
version: "1.8.1"
129+
version: "1.9.1"
117130
stack_trace:
118131
dependency: transitive
119132
description:
120133
name: stack_trace
121-
url: "https://pub.dartlang.org"
134+
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
135+
url: "https://pub.dev"
122136
source: hosted
123-
version: "1.10.0"
137+
version: "1.11.0"
124138
stream_channel:
125139
dependency: transitive
126140
description:
127141
name: stream_channel
128-
url: "https://pub.dartlang.org"
142+
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
143+
url: "https://pub.dev"
129144
source: hosted
130-
version: "2.1.0"
145+
version: "2.1.1"
131146
string_scanner:
132147
dependency: transitive
133148
description:
134149
name: string_scanner
135-
url: "https://pub.dartlang.org"
150+
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
151+
url: "https://pub.dev"
136152
source: hosted
137-
version: "1.1.0"
153+
version: "1.2.0"
138154
term_glyph:
139155
dependency: transitive
140156
description:
141157
name: term_glyph
142-
url: "https://pub.dartlang.org"
158+
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
159+
url: "https://pub.dev"
143160
source: hosted
144-
version: "1.2.0"
161+
version: "1.2.1"
145162
test_api:
146163
dependency: transitive
147164
description:
148165
name: test_api
149-
url: "https://pub.dartlang.org"
166+
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
167+
url: "https://pub.dev"
150168
source: hosted
151-
version: "0.4.8"
152-
typed_data:
153-
dependency: transitive
154-
description:
155-
name: typed_data
156-
url: "https://pub.dartlang.org"
157-
source: hosted
158-
version: "1.3.0"
169+
version: "0.5.1"
159170
vector_math:
160171
dependency: transitive
161172
description:
162173
name: vector_math
163-
url: "https://pub.dartlang.org"
174+
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
175+
url: "https://pub.dev"
164176
source: hosted
165-
version: "2.1.1"
177+
version: "2.1.4"
166178
sdks:
167-
dart: ">=2.14.0 <3.0.0"
179+
dart: ">=3.0.0 <4.0.0"
168180
flutter: ">=1.12.0"

example/pubspec.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: disable_battery_optimization_example
22
description: Demonstrates how to use the disable_battery_optimization plugin.
3-
publish_to: 'none'
3+
publish_to: "none"
44

55
environment:
6-
sdk: ">=2.1.0 <3.0.0"
6+
sdk: ">=3.0.0"
77

88
dependencies:
99
flutter:
@@ -25,7 +25,6 @@ dev_dependencies:
2525

2626
# The following section is specific to Flutter.
2727
flutter:
28-
2928
# The following line ensures that the Material Icons font is
3029
# included with your application, so that you can use the icons in
3130
# the material Icons class.

0 commit comments

Comments
 (0)