Skip to content

Commit

Permalink
[Chore] Generate & update sample project
Browse files Browse the repository at this point in the history
  • Loading branch information
bot-nimble committed Jul 31, 2023
1 parent 99e576c commit f1f7075
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 17 deletions.
3 changes: 2 additions & 1 deletion sample/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
40 changes: 34 additions & 6 deletions sample/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand All @@ -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"
Expand Down Expand Up @@ -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
}
}
Expand Down
Binary file added sample/android/config/debug.keystore
Binary file not shown.
4 changes: 0 additions & 4 deletions sample/assets/colors/colors.xml

This file was deleted.

4 changes: 2 additions & 2 deletions sample/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -117,7 +117,7 @@ class HomeScreenState extends ConsumerState<HomeScreen> {
Text(
FlutterConfig.get('SECRET'),
style: const TextStyle(
color: ColorName.nimblePrimaryBlue,
color: AppColors.nimblePrimaryBlue,
fontSize: 24,
),
),
Expand Down
5 changes: 5 additions & 0 deletions sample/lib/resources/app_colors.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'package:flutter/material.dart';

class AppColors {
static const Color nimblePrimaryBlue = Color(0xFF201547);
}
4 changes: 0 additions & 4 deletions sample/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,3 @@ flutter:
flutter_gen:
integrations:
flutter_svg: true

colors:
inputs:
- assets/colors/colors.xml

0 comments on commit f1f7075

Please sign in to comment.