Skip to content

fix: replace deprecated API and bump FlutterFire dependencies #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,16 @@ jobs:
npm i
npm run build
../scripts/start-firebase-emulator.sh
- uses: futureware-tech/simulator-action@bde6805eedaeaba7775a9959970edc7d8bf10c4d
id: simulator
with:
# List of available simulators: https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md#installed-simulators
model: "iPhone 15"
- name: "E2E Tests"
working-directory: tests
env:
SIMULATOR: ${{ steps.simulator.outputs.udid }}
run: |
# Boot simulator and wait for System app to be ready.
# List of available simulators: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#installed-simulators
SIMULATOR="iPhone 14"
xcrun simctl bootstatus "$SIMULATOR" -b
xcrun simctl logverbose "$SIMULATOR" enable
# Sleep to allow simulator to settle.
sleep 15
# Uncomment following line to have simulator logs printed out for debugging purposes.
# xcrun simctl spawn booted log stream --predicate 'eventMessage contains "flutter"' &
flutter test ./integration_test/firebase_ui_test.dart -d "$SIMULATOR" --dart-define=CI=true
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase_ui_auth/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ environment:

dependencies:
cupertino_icons: ^1.0.6
firebase_auth: ^5.3.2
firebase_core: ^3.7.0
firebase_auth: ^5.4.0
firebase_core: ^3.10.0
flutter:
sdk: flutter
flutter_localizations:
Expand Down
6 changes: 3 additions & 3 deletions packages/firebase_ui_auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ environment:

dependencies:
email_validator: ^2.1.17
firebase_auth: ^5.3.2
firebase_core: ^3.7.0
firebase_dynamic_links: ^6.0.9
firebase_auth: ^5.4.0
firebase_core: ^3.10.0
firebase_dynamic_links: ^6.1.0
firebase_ui_localizations: ^1.13.0
firebase_ui_oauth: ^1.6.0
firebase_ui_shared: ^1.4.1
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase_ui_database/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.6
firebase_core: ^3.7.0
firebase_database: ^11.1.5
firebase_core: ^3.10.0
firebase_database: ^11.3.0
dev_dependencies:
drive: ^1.0.0-1.0.nullsafety.5
flutter_test:
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ui_database/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:

dependencies:
collection: ^1.18.0
firebase_database: ^11.1.5
firebase_database: ^11.3.0
firebase_ui_localizations: ^1.13.0
flutter:
sdk: flutter
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase_ui_firestore/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ dependencies:
flutter:
sdk: flutter
firebase_ui_firestore: ^1.7.0
cloud_firestore: ^5.4.5
cloud_firestore: ^5.6.1
cupertino_icons: ^1.0.6
firebase_core: ^3.7.0
firebase_core: ^3.10.0
dev_dependencies:
drive: ^1.0.0-1.0.nullsafety.5
flutter_test:
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ui_firestore/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
flutter: ">=3.3.0"

dependencies:
cloud_firestore: ^5.4.5
cloud_firestore: ^5.6.1
firebase_ui_localizations: ^1.13.0
firebase_ui_shared: ^1.4.1
flutter:
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ui_localizations/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ environment:
dependencies:
cupertino_icons: ^1.0.6

firebase_core: ^3.7.0
firebase_core: ^3.10.0
firebase_ui_auth: ^1.16.0
firebase_ui_localizations: ^1.13.0
flutter:
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase_ui_oauth/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.6
firebase_auth: ^5.3.2
firebase_core: ^3.7.0
firebase_auth: ^5.4.0
firebase_core: ^3.10.0
firebase_ui_oauth: ^1.6.0
firebase_ui_oauth_apple: ^1.3.0
firebase_ui_oauth_facebook: ^1.3.0
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ui_oauth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:

dependencies:
desktop_webview_auth: ^0.0.14
firebase_auth: ^5.3.2
firebase_auth: ^5.4.0
firebase_ui_auth: ^1.16.0
firebase_ui_shared: ^1.4.1
flutter_svg: ^2.0.9
Expand Down
10 changes: 7 additions & 3 deletions packages/firebase_ui_oauth/test/flutterfire_ui_oauth_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ void main() {
final expectedColor = style.backgroundColor.getValue(Brightness.dark);

final containerFinder = find.byWidgetPredicate((widget) {
return widget is Material && widget.color!.value == expectedColor.value;
return widget is Material &&
widget.color!.r == expectedColor.r &&
widget.color!.g == expectedColor.g &&
widget.color!.b == expectedColor.b;
});

expect(containerFinder, findsOneWidget);
Expand All @@ -150,8 +153,9 @@ void main() {
final textFinder = find.byWidgetPredicate(
(widget) =>
widget is Text &&
widget.style!.color!.value ==
style.color.getValue(Brightness.dark).value,
widget.style!.color!.r == style.color.getValue(Brightness.dark).r &&
widget.style!.color!.g == style.color.getValue(Brightness.dark).g &&
widget.style!.color!.b == style.color.getValue(Brightness.dark).b,
);

expect(textFinder, findsOneWidget);
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ui_oauth_apple/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
flutter: ">=3.3.0"

dependencies:
firebase_auth: ^5.3.2
firebase_auth: ^5.4.0
firebase_ui_oauth: ^1.6.0
flutter:
sdk: flutter
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ui_oauth_facebook/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
flutter: ">=3.3.0"

dependencies:
firebase_auth: ^5.3.2
firebase_auth: ^5.4.0
firebase_ui_oauth: ^1.6.0
flutter:
sdk: flutter
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ui_oauth_google/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ environment:
flutter: ">=3.3.0"

dependencies:
firebase_auth: ^5.3.2
firebase_auth: ^5.4.0
firebase_ui_oauth: ^1.6.0
flutter:
sdk: flutter
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ui_oauth_twitter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
firebase_auth: ^5.3.2
firebase_auth: ^5.4.0
firebase_ui_oauth: ^1.6.0
twitter_login: ^4.4.2

Expand Down
4 changes: 2 additions & 2 deletions packages/firebase_ui_storage/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ environment:
dependencies:
cupertino_icons: ^1.0.6
file_picker: ^6.1.1
firebase_core: ^3.7.0
firebase_storage: ^12.3.5
firebase_core: ^3.10.0
firebase_storage: ^12.4.0
firebase_ui_storage: ^2.1.0
firebase_ui_shared: ^1.4.1

Expand Down
24 changes: 21 additions & 3 deletions packages/firebase_ui_storage/lib/src/widgets/image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,13 @@ class _SolidColorLoadingStateVariantPlaceholder extends StatelessWidget {
return color!;
}

return Theme.of(context).colorScheme.surfaceTint.withOpacity(0.12);
final themeColor = Theme.of(context).colorScheme.surfaceTint;
return themeColor.withValues(
red: themeColor.r,
green: themeColor.g,
blue: themeColor.b,
alpha: (0.12 * 255),
);
}

@override
Expand Down Expand Up @@ -588,8 +594,20 @@ class __ShimmerLoadingStateVariantPlaceholderState

@override
Widget build(BuildContext context) {
final a = Theme.of(context).colorScheme.surfaceTint.withOpacity(0.12);
final b = Theme.of(context).colorScheme.surfaceTint.withOpacity(0.24);
final themeColor = Theme.of(context).colorScheme.surfaceTint;
final a = themeColor.withValues(
red: themeColor.r,
green: themeColor.g,
blue: themeColor.b,
alpha: (0.12 * 255),
);

final b = themeColor.withValues(
red: themeColor.r,
green: themeColor.g,
blue: themeColor.b,
alpha: (0.24 * 255),
);

final (lighter, darker) = switch (Theme.of(context).brightness) {
Brightness.light => (a, b),
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_ui_storage/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ false_secrets:
dependencies:
flutter:
sdk: flutter
firebase_storage: ^12.3.5
firebase_storage: ^12.4.0
firebase_ui_localizations: ^1.13.0
firebase_ui_shared: ^1.4.1
path: ^1.8.3
Expand Down
57 changes: 18 additions & 39 deletions tests/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,67 +1,46 @@
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
id "com.google.gms.google-services"
}

android {
namespace "io.flutter.plugins.firebase.tests"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
namespace = "io.flutter.plugins.firebase.tests"
// use "flutter.compileSdkVersion" and bump AGP once twitter_login has released v4.4.3: https://github.com/0maru/twitter_login/issues/139
compileSdkVersion 34
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
jvmTarget = JavaVersion.VERSION_1_8
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "io.flutter.plugins.firebase.tests"
applicationId = "io.flutter.plugins.firebase.tests"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = 23
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
signingConfig = signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {}
source = "../.."
}
22 changes: 3 additions & 19 deletions tests/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,34 +1,18 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
// START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.3.10'
// END: FlutterFire Configuration
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.buildDir = '../build'
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
delete rootProject.buildDir
}
}
20 changes: 13 additions & 7 deletions tests/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ pluginManagement {
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()
}()

includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

plugins {
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

include ":app"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
id "com.google.gms.google-services" version "4.4.2" apply false
}

apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
include ":app"
Loading
Loading