diff --git a/sample/android/.gitignore b/sample/android/.gitignore index 0a741cb4..6fd19d60 100644 --- a/sample/android/.gitignore +++ b/sample/android/.gitignore @@ -8,4 +8,5 @@ GeneratedPluginRegistrant.java # Remember to never publicly share your keystore. # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app -key.properties +signing.properties +config/release.keystore diff --git a/sample/android/app/build.gradle b/sample/android/app/build.gradle index 7d71e363..41cc0787 100644 --- a/sample/android/app/build.gradle +++ b/sample/android/app/build.gradle @@ -6,6 +6,12 @@ if (localPropertiesFile.exists()) { } } +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('signing.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + 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.") @@ -26,10 +32,10 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" project.ext.envConfigFiles = [ - stagingdebug: ".env.staging", - stagingrelease: ".env.staging", - productiondebug: ".env", - productionrelease: ".env" + stagingdebug : ".env.staging", + stagingrelease : ".env.staging", + productiondebug : ".env", + productionrelease: ".env" ] apply from: project(':flutter_config').projectDir.getPath() + "/dotenv.gradle" @@ -61,10 +67,32 @@ android { resValue "string", "build_config_package", "co.nimblehq.flutter.template" } + signingConfigs { + release { + storeFile file('../config/release.keystore') + storePassword keystoreProperties['KEYSTORE_PASSWORD'] + keyAlias keystoreProperties['KEY_ALIAS'] + keyPassword keystoreProperties['KEY_PASSWORD'] + } + + debug { + storeFile file('../config/debug.keystore') + storePassword 'android' + keyAlias 'androiddebugkey' + keyPassword 'android' + } + } + 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.release + minifyEnabled true + shrinkResources true + debuggable false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + + debug { signingConfig signingConfigs.debug } } diff --git a/sample/android/config/debug.keystore b/sample/android/config/debug.keystore new file mode 100644 index 00000000..cc8985c6 Binary files /dev/null and b/sample/android/config/debug.keystore differ diff --git a/sample/assets/colors/colors.xml b/sample/assets/colors/colors.xml deleted file mode 100644 index 29ab3010..00000000 --- a/sample/assets/colors/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #201547 - diff --git a/sample/lib/main.dart b/sample/lib/main.dart index 5c3a518f..3b14fac4 100644 --- a/sample/lib/main.dart +++ b/sample/lib/main.dart @@ -6,7 +6,7 @@ import 'package:go_router/go_router.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:sample/di/di.dart'; import 'package:sample/gen/assets.gen.dart'; -import 'package:sample/gen/colors.gen.dart'; +import 'package:sample/resources/app_colors.dart'; import 'package:sample/usecases/user/get_users_use_case.dart'; import 'home_view_model.dart'; @@ -117,7 +117,7 @@ class HomeScreenState extends ConsumerState { Text( FlutterConfig.get('SECRET'), style: const TextStyle( - color: ColorName.nimblePrimaryBlue, + color: AppColors.nimblePrimaryBlue, fontSize: 24, ), ), diff --git a/sample/lib/resources/app_colors.dart b/sample/lib/resources/app_colors.dart new file mode 100644 index 00000000..267e483d --- /dev/null +++ b/sample/lib/resources/app_colors.dart @@ -0,0 +1,5 @@ +import 'package:flutter/material.dart'; + +class AppColors { + static const Color nimblePrimaryBlue = Color(0xFF201547); +} diff --git a/sample/pubspec.yaml b/sample/pubspec.yaml index bc06b707..59e6ca74 100644 --- a/sample/pubspec.yaml +++ b/sample/pubspec.yaml @@ -95,7 +95,3 @@ flutter: flutter_gen: integrations: flutter_svg: true - - colors: - inputs: - - assets/colors/colors.xml