Skip to content

Commit 530be48

Browse files
fix: replace deprecated API and bump FlutterFire dependencies (#453)
1 parent 91c982b commit 530be48

File tree

24 files changed

+97
-106
lines changed

24 files changed

+97
-106
lines changed

.github/workflows/e2e.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,16 @@ jobs:
168168
npm i
169169
npm run build
170170
../scripts/start-firebase-emulator.sh
171+
- uses: futureware-tech/simulator-action@bde6805eedaeaba7775a9959970edc7d8bf10c4d
172+
id: simulator
173+
with:
174+
# List of available simulators: https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#installed-simulators
175+
model: "iPhone 15"
171176
- name: "E2E Tests"
172177
working-directory: tests
178+
env:
179+
SIMULATOR: ${{ steps.simulator.outputs.udid }}
173180
run: |
174-
# Boot simulator and wait for System app to be ready.
175-
# List of available simulators: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#installed-simulators
176-
SIMULATOR="iPhone 14"
177-
xcrun simctl bootstatus "$SIMULATOR" -b
178-
xcrun simctl logverbose "$SIMULATOR" enable
179-
# Sleep to allow simulator to settle.
180-
sleep 15
181181
# Uncomment following line to have simulator logs printed out for debugging purposes.
182182
# xcrun simctl spawn booted log stream --predicate 'eventMessage contains "flutter"' &
183183
flutter test ./integration_test/firebase_ui_test.dart -d "$SIMULATOR" --dart-define=CI=true

packages/firebase_ui_auth/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ environment:
2222

2323
dependencies:
2424
cupertino_icons: ^1.0.6
25-
firebase_auth: ^5.3.2
26-
firebase_core: ^3.7.0
25+
firebase_auth: ^5.4.0
26+
firebase_core: ^3.10.0
2727
flutter:
2828
sdk: flutter
2929
flutter_localizations:

packages/firebase_ui_auth/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ environment:
1010

1111
dependencies:
1212
email_validator: ^2.1.17
13-
firebase_auth: ^5.3.2
14-
firebase_core: ^3.7.0
15-
firebase_dynamic_links: ^6.0.9
13+
firebase_auth: ^5.4.0
14+
firebase_core: ^3.10.0
15+
firebase_dynamic_links: ^6.1.0
1616
firebase_ui_localizations: ^1.13.0
1717
firebase_ui_oauth: ^1.6.0
1818
firebase_ui_shared: ^1.4.1

packages/firebase_ui_database/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ dependencies:
3333
# The following adds the Cupertino Icons font to your application.
3434
# Use with the CupertinoIcons class for iOS style icons.
3535
cupertino_icons: ^1.0.6
36-
firebase_core: ^3.7.0
37-
firebase_database: ^11.1.5
36+
firebase_core: ^3.10.0
37+
firebase_database: ^11.3.0
3838
dev_dependencies:
3939
drive: ^1.0.0-1.0.nullsafety.5
4040
flutter_test:

packages/firebase_ui_database/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ environment:
99

1010
dependencies:
1111
collection: ^1.18.0
12-
firebase_database: ^11.1.5
12+
firebase_database: ^11.3.0
1313
firebase_ui_localizations: ^1.13.0
1414
flutter:
1515
sdk: flutter

packages/firebase_ui_firestore/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ dependencies:
3030
flutter:
3131
sdk: flutter
3232
firebase_ui_firestore: ^1.7.0
33-
cloud_firestore: ^5.4.5
33+
cloud_firestore: ^5.6.1
3434
cupertino_icons: ^1.0.6
35-
firebase_core: ^3.7.0
35+
firebase_core: ^3.10.0
3636
dev_dependencies:
3737
drive: ^1.0.0-1.0.nullsafety.5
3838
flutter_test:

packages/firebase_ui_firestore/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ environment:
88
flutter: ">=3.3.0"
99

1010
dependencies:
11-
cloud_firestore: ^5.4.5
11+
cloud_firestore: ^5.6.1
1212
firebase_ui_localizations: ^1.13.0
1313
firebase_ui_shared: ^1.4.1
1414
flutter:

packages/firebase_ui_localizations/example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ environment:
3131
dependencies:
3232
cupertino_icons: ^1.0.6
3333

34-
firebase_core: ^3.7.0
34+
firebase_core: ^3.10.0
3535
firebase_ui_auth: ^1.16.0
3636
firebase_ui_localizations: ^1.13.0
3737
flutter:

packages/firebase_ui_oauth/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ dependencies:
3333
# The following adds the Cupertino Icons font to your application.
3434
# Use with the CupertinoIcons class for iOS style icons.
3535
cupertino_icons: ^1.0.6
36-
firebase_auth: ^5.3.2
37-
firebase_core: ^3.7.0
36+
firebase_auth: ^5.4.0
37+
firebase_core: ^3.10.0
3838
firebase_ui_oauth: ^1.6.0
3939
firebase_ui_oauth_apple: ^1.3.0
4040
firebase_ui_oauth_facebook: ^1.3.0

packages/firebase_ui_oauth/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ environment:
99

1010
dependencies:
1111
desktop_webview_auth: ^0.0.14
12-
firebase_auth: ^5.3.2
12+
firebase_auth: ^5.4.0
1313
firebase_ui_auth: ^1.16.0
1414
firebase_ui_shared: ^1.4.1
1515
flutter_svg: ^2.0.9

packages/firebase_ui_oauth/test/flutterfire_ui_oauth_test.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ void main() {
138138
final expectedColor = style.backgroundColor.getValue(Brightness.dark);
139139

140140
final containerFinder = find.byWidgetPredicate((widget) {
141-
return widget is Material && widget.color!.value == expectedColor.value;
141+
return widget is Material &&
142+
widget.color!.r == expectedColor.r &&
143+
widget.color!.g == expectedColor.g &&
144+
widget.color!.b == expectedColor.b;
142145
});
143146

144147
expect(containerFinder, findsOneWidget);
@@ -150,8 +153,9 @@ void main() {
150153
final textFinder = find.byWidgetPredicate(
151154
(widget) =>
152155
widget is Text &&
153-
widget.style!.color!.value ==
154-
style.color.getValue(Brightness.dark).value,
156+
widget.style!.color!.r == style.color.getValue(Brightness.dark).r &&
157+
widget.style!.color!.g == style.color.getValue(Brightness.dark).g &&
158+
widget.style!.color!.b == style.color.getValue(Brightness.dark).b,
155159
);
156160

157161
expect(textFinder, findsOneWidget);

packages/firebase_ui_oauth_apple/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ environment:
88
flutter: ">=3.3.0"
99

1010
dependencies:
11-
firebase_auth: ^5.3.2
11+
firebase_auth: ^5.4.0
1212
firebase_ui_oauth: ^1.6.0
1313
flutter:
1414
sdk: flutter

packages/firebase_ui_oauth_facebook/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ environment:
88
flutter: ">=3.3.0"
99

1010
dependencies:
11-
firebase_auth: ^5.3.2
11+
firebase_auth: ^5.4.0
1212
firebase_ui_oauth: ^1.6.0
1313
flutter:
1414
sdk: flutter

packages/firebase_ui_oauth_google/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ environment:
88
flutter: ">=3.3.0"
99

1010
dependencies:
11-
firebase_auth: ^5.3.2
11+
firebase_auth: ^5.4.0
1212
firebase_ui_oauth: ^1.6.0
1313
flutter:
1414
sdk: flutter

packages/firebase_ui_oauth_twitter/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ environment:
1010
dependencies:
1111
flutter:
1212
sdk: flutter
13-
firebase_auth: ^5.3.2
13+
firebase_auth: ^5.4.0
1414
firebase_ui_oauth: ^1.6.0
1515
twitter_login: ^4.4.2
1616

packages/firebase_ui_storage/example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ environment:
99
dependencies:
1010
cupertino_icons: ^1.0.6
1111
file_picker: ^6.1.1
12-
firebase_core: ^3.7.0
13-
firebase_storage: ^12.3.5
12+
firebase_core: ^3.10.0
13+
firebase_storage: ^12.4.0
1414
firebase_ui_storage: ^2.1.0
1515
firebase_ui_shared: ^1.4.1
1616

packages/firebase_ui_storage/lib/src/widgets/image.dart

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,13 @@ class _SolidColorLoadingStateVariantPlaceholder extends StatelessWidget {
438438
return color!;
439439
}
440440

441-
return Theme.of(context).colorScheme.surfaceTint.withOpacity(0.12);
441+
final themeColor = Theme.of(context).colorScheme.surfaceTint;
442+
return themeColor.withValues(
443+
red: themeColor.r,
444+
green: themeColor.g,
445+
blue: themeColor.b,
446+
alpha: (0.12 * 255),
447+
);
442448
}
443449

444450
@override
@@ -588,8 +594,20 @@ class __ShimmerLoadingStateVariantPlaceholderState
588594

589595
@override
590596
Widget build(BuildContext context) {
591-
final a = Theme.of(context).colorScheme.surfaceTint.withOpacity(0.12);
592-
final b = Theme.of(context).colorScheme.surfaceTint.withOpacity(0.24);
597+
final themeColor = Theme.of(context).colorScheme.surfaceTint;
598+
final a = themeColor.withValues(
599+
red: themeColor.r,
600+
green: themeColor.g,
601+
blue: themeColor.b,
602+
alpha: (0.12 * 255),
603+
);
604+
605+
final b = themeColor.withValues(
606+
red: themeColor.r,
607+
green: themeColor.g,
608+
blue: themeColor.b,
609+
alpha: (0.24 * 255),
610+
);
593611

594612
final (lighter, darker) = switch (Theme.of(context).brightness) {
595613
Brightness.light => (a, b),

packages/firebase_ui_storage/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ false_secrets:
1313
dependencies:
1414
flutter:
1515
sdk: flutter
16-
firebase_storage: ^12.3.5
16+
firebase_storage: ^12.4.0
1717
firebase_ui_localizations: ^1.13.0
1818
firebase_ui_shared: ^1.4.1
1919
path: ^1.8.3

tests/android/app/build.gradle

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,46 @@
11
plugins {
22
id "com.android.application"
33
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
45
id "dev.flutter.flutter-gradle-plugin"
5-
}
6-
7-
def localProperties = new Properties()
8-
def localPropertiesFile = rootProject.file('local.properties')
9-
if (localPropertiesFile.exists()) {
10-
localPropertiesFile.withReader('UTF-8') { reader ->
11-
localProperties.load(reader)
12-
}
13-
}
14-
15-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16-
if (flutterVersionCode == null) {
17-
flutterVersionCode = '1'
18-
}
19-
20-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
21-
if (flutterVersionName == null) {
22-
flutterVersionName = '1.0'
6+
id "com.google.gms.google-services"
237
}
248

259
android {
26-
namespace "io.flutter.plugins.firebase.tests"
27-
compileSdkVersion flutter.compileSdkVersion
28-
ndkVersion flutter.ndkVersion
10+
namespace = "io.flutter.plugins.firebase.tests"
11+
// use "flutter.compileSdkVersion" and bump AGP once twitter_login has released v4.4.3: https://github.com/0maru/twitter_login/issues/139
12+
compileSdkVersion 34
13+
ndkVersion = flutter.ndkVersion
2914

3015
compileOptions {
31-
sourceCompatibility JavaVersion.VERSION_1_8
32-
targetCompatibility JavaVersion.VERSION_1_8
16+
sourceCompatibility = JavaVersion.VERSION_1_8
17+
targetCompatibility = JavaVersion.VERSION_1_8
3318
}
3419

3520
kotlinOptions {
36-
jvmTarget = '1.8'
37-
}
38-
39-
sourceSets {
40-
main.java.srcDirs += 'src/main/kotlin'
21+
jvmTarget = JavaVersion.VERSION_1_8
4122
}
4223

4324
defaultConfig {
4425
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
45-
applicationId "io.flutter.plugins.firebase.tests"
26+
applicationId = "io.flutter.plugins.firebase.tests"
4627
// You can update the following values to match your application needs.
47-
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
48-
minSdkVersion 23
49-
targetSdkVersion flutter.targetSdkVersion
50-
versionCode flutterVersionCode.toInteger()
51-
versionName flutterVersionName
28+
// For more information, see: https://flutter.dev/to/review-gradle-config.
29+
minSdk = 23
30+
targetSdk = flutter.targetSdkVersion
31+
versionCode = flutter.versionCode
32+
versionName = flutter.versionName
5233
}
5334

5435
buildTypes {
5536
release {
5637
// TODO: Add your own signing config for the release build.
5738
// Signing with the debug keys for now, so `flutter run --release` works.
58-
signingConfig signingConfigs.debug
39+
signingConfig = signingConfigs.debug
5940
}
6041
}
6142
}
6243

6344
flutter {
64-
source '../..'
65-
}
66-
67-
dependencies {}
45+
source = "../.."
46+
}

tests/android/build.gradle

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,18 @@
1-
buildscript {
2-
ext.kotlin_version = '1.7.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.3.0'
10-
// START: FlutterFire Configuration
11-
classpath 'com.google.gms:google-services:4.3.10'
12-
// END: FlutterFire Configuration
13-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14-
}
15-
}
16-
171
allprojects {
182
repositories {
193
google()
204
mavenCentral()
215
}
226
}
237

24-
rootProject.buildDir = '../build'
8+
rootProject.buildDir = "../build"
259
subprojects {
2610
project.buildDir = "${rootProject.buildDir}/${project.name}"
2711
}
2812
subprojects {
29-
project.evaluationDependsOn(':app')
13+
project.evaluationDependsOn(":app")
3014
}
3115

3216
tasks.register("clean", Delete) {
3317
delete rootProject.buildDir
34-
}
18+
}

tests/android/settings.gradle

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@ pluginManagement {
55
def flutterSdkPath = properties.getProperty("flutter.sdk")
66
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
77
return flutterSdkPath
8-
}
9-
settings.ext.flutterSdkPath = flutterSdkPath()
8+
}()
109

11-
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
1211

13-
plugins {
14-
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
1516
}
1617
}
1718

18-
include ":app"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version "7.3.0" apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
23+
id "com.google.gms.google-services" version "4.4.2" apply false
24+
}
1925

20-
apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
26+
include ":app"

0 commit comments

Comments
 (0)