diff --git a/android/build.gradle b/android/build.gradle index 2b20a81..d9c777f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,14 +2,14 @@ group 'io.customer.customer_io' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.6.10' + ext.kotlin_version = '1.7.21' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.2' + classpath 'com.android.tools.build:gradle:7.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -26,7 +26,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 31 + compileSdkVersion 33 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -58,7 +58,7 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" // Customer.io SDK - def cioVersion = "3.8.0" + def cioVersion = "3.9.2" implementation "io.customer.android:tracking:$cioVersion" implementation "io.customer.android:messaging-push-fcm:$cioVersion" implementation "io.customer.android:messaging-in-app:$cioVersion" diff --git a/apps/amiapp_flutter/android/app/build.gradle b/apps/amiapp_flutter/android/app/build.gradle index 1b3a2c3..76dd6ce 100644 --- a/apps/amiapp_flutter/android/app/build.gradle +++ b/apps/amiapp_flutter/android/app/build.gradle @@ -1,21 +1,10 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" + id "com.google.gms.google-services" // Google Services plugin } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" -apply plugin: 'com.google.gms.google-services' // Google Services plugin - android { compileSdkVersion 33 ndkVersion flutter.ndkVersion @@ -69,6 +58,7 @@ android { // Caution! In production, you need to generate your own keystore file. // see https://reactnative.dev/docs/signed-apk-android. signingConfig signingConfigs.debug + minifyEnabled true } } } @@ -78,7 +68,7 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.21" // Adding customer.io android sdk dependencies so we can use them in native code // These are not generally needed and should be avoided implementation "io.customer.android:tracking" diff --git a/apps/amiapp_flutter/android/build.gradle b/apps/amiapp_flutter/android/build.gradle index 66d1aaa..133c863 100644 --- a/apps/amiapp_flutter/android/build.gradle +++ b/apps/amiapp_flutter/android/build.gradle @@ -1,17 +1,3 @@ -buildscript { - ext.kotlin_version = '1.7.20' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.1.3' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.google.gms:google-services:4.3.14' // Google Services plugin - } -} - allprojects { repositories { google() diff --git a/apps/amiapp_flutter/android/settings.gradle b/apps/amiapp_flutter/android/settings.gradle index 44e62bc..d3bcc7b 100644 --- a/apps/amiapp_flutter/android/settings.gradle +++ b/apps/amiapp_flutter/android/settings.gradle @@ -1,11 +1,26 @@ -include ':app' +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.2.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.21" apply false + id "com.google.gms.google-services" version "4.3.15" apply false +} + +include ':app' \ No newline at end of file diff --git a/apps/amiapp_flutter/lib/src/app.dart b/apps/amiapp_flutter/lib/src/app.dart index 7c85e3a..951f278 100644 --- a/apps/amiapp_flutter/lib/src/app.dart +++ b/apps/amiapp_flutter/lib/src/app.dart @@ -193,7 +193,6 @@ class _AmiAppState extends State { } return theme.copyWith( - useMaterial3: true, colorScheme: colorScheme, appBarTheme: theme.appBarTheme.copyWith( systemOverlayStyle: systemOverlayStyle, diff --git a/apps/amiapp_flutter/lib/src/screens/dashboard.dart b/apps/amiapp_flutter/lib/src/screens/dashboard.dart index 9997b70..8eb9990 100644 --- a/apps/amiapp_flutter/lib/src/screens/dashboard.dart +++ b/apps/amiapp_flutter/lib/src/screens/dashboard.dart @@ -1,9 +1,7 @@ import 'dart:async'; -import 'dart:developer'; import 'package:customer_io/customer_io.dart'; import 'package:customer_io/customer_io_inapp.dart'; -import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; diff --git a/apps/amiapp_flutter/lib/src/screens/settings.dart b/apps/amiapp_flutter/lib/src/screens/settings.dart index 54630b8..39da909 100644 --- a/apps/amiapp_flutter/lib/src/screens/settings.dart +++ b/apps/amiapp_flutter/lib/src/screens/settings.dart @@ -126,14 +126,11 @@ class _SettingsScreenState extends State { Widget build(BuildContext context) { final Sizes sizes = Theme.of(context).extension()!; - return WillPopScope( - onWillPop: () { + return PopScope( + onPopInvoked: (bool didPop) { if (widget.auth.signedIn == false) { context.go(Screen.login.location); - return Future.value(false); } - - return Future.value(true); }, child: AppContainer( resizeToAvoidBottomInset: true, diff --git a/pubspec.yaml b/pubspec.yaml index 0ce30dd..c63eea1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.0 + flutter_lints: ^3.0.2 build_runner: ^2.2.0 mockito: ^5.0.15