Skip to content

Commit

Permalink
Merge pull request #1 from milind-mevada-stl/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Milind Mevada authored Jan 7, 2020
2 parents 00ba1b0 + e3fe875 commit 25a3875
Show file tree
Hide file tree
Showing 33 changed files with 1,527 additions and 225 deletions.
61 changes: 51 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,57 @@
# flutter_base_project
# Flutter base Scaffold Project

Scaffold project with all basic setup.
This is a base flutter scaffold project that has all configuration & setup created. So we can reduce the efforts of basic project setup & project level boilerplate code.

## Getting Started
## Features

### Flavors (Flutter + Native)
Production, Staging, Development (with abstract properties)
Modes: Debug, Release, Profile.

### Localization
Localization support based on [Easy Localization](https://pub.dev/packages/easy_localization)

### Custom Logger (Default Sentry)
Abstract layer for a custom logger. It has default implementation of [Sentry](https://sentry.io/welcome/).
It can again be replaced with any other services.

### Firebase Crashalytics
Crashalytics that works in Release and Profile Mode.

### Analytics (Default Firebase)
Abstract layer for a Custom event logging. It has default implementation of Firebase Analytics. It can again be replaced with any other services.

### Firebase Performance Monitor
Firebase performance integration to check App freezing, network latency monitoring. (Integrated firebase_performance_interceptor)

### Remote Config
Integration of firebase remote config.

### Pedantic
Analysis_options setup for strict lint checks.

### Flavor-wise installable build
Flavor wise application-id overridden. So that same application with different flavor can be installed simultaneously.

### App Update Prompts (Flexible + Immediate)
Force upgrade setup based on Firebase Remote config.

Currently it has two configuration
1. Latest App Version (Build Number)
2. Latest Stable App Version (Build Number)

If latest app version is greater then current version it will trigger Flexible Update (Snackbar Promot.)

If current app version is below latest stable version, then it will trigger a Immediate (Force) update.

### Other Useful dependencies
- [Connectivity](https://pub.dev/packages/connectivity)
- [Shared Preferences](https://pub.dev/packages/shared_preferences)
- [Path Provider](https://pub.dev/packages/path_provider)
- [Provider](https://pub.dev/packages/provider)
- [Permission Handler](https://pub.dev/packages/permission_handler)
- [Cached Network Image](https://pub.dev/packages/cached_network_image)

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
30 changes: 30 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
include: package:pedantic/analysis_options.yaml

analyzer:
exclude:
- lib/**.g.dart

linter:
rules:
- camel_case_types
- empty_constructor_bodies
- cancel_subscriptions
- close_sinks
- unnecessary_await_in_return
- unnecessary_new
- unnecessary_null_aware_assignments
- no_duplicate_case_values
- throw_in_finally
- avoid_print
- control_flow_in_finally
- unnecessary_statements
- always_declare_return_types
- always_put_control_body_on_new_line
- list_remove_unrelated_type
- avoid_renaming_method_parameters
- avoid_void_async
- empty_catches
- prefer_final_in_for_each
- prefer_is_not_empty
- prefer_is_empty
- unawaited_futures
20 changes: 20 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ android {
signingConfig signingConfigs.debug
}
}
flavorDimensions "api"
productFlavors {
development {
dimension "api"
applicationIdSuffix ".development"
resValue "string", "app_name", "Flutter-Dev"
}
staging {
dimension "api"
applicationIdSuffix ".staging"
resValue "string", "app_name", "Flutter-Staging"
}
production {
dimension "api"
resValue "string", "app_name", "Flutter-Base"
}
}
}

flutter {
Expand All @@ -65,3 +82,6 @@ dependencies {
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
12 changes: 6 additions & 6 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="flutter_base_project"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
Expand Down
5 changes: 5 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.0'
classpath 'io.fabric.tools:gradle:1.26.1'
}
}

Expand Down
139 changes: 139 additions & 0 deletions codemagic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
workflows:
development:
name: Development
environment:
flutter: stable
cache:
cache_paths:
- $FCI_BUILD_DIR/build
scripts:
- |
# fetch codemagic helper scripts
rm -rf ~/codemagic-build-scripts
git clone https://github.com/NevercodeHQ/codemagic-build-scripts.git ~/codemagic-build-scripts/ --depth 1
- |
# set up debug keystore
rm -f ~/.android/debug.keystore
keytool -genkeypair \
-alias androiddebugkey \
-keypass android \
-keystore ~/.android/debug.keystore \
-storepass android \
-dname 'CN=Android Debug,O=Android,C=US' \
-keyalg 'RSA' \
-keysize 2048 \
-validity 10000
- |
# set up local properties
echo "flutter.sdk=$HOME/programs/flutter" > "$FCI_BUILD_DIR/android/local.properties"
- flutter packages pub get
- flutter build appbundle --release -flavor development -t main_dev.dart
- |
# generate universal apk signed with debug key
'~/codemagic-build-scripts/android/generate-universal-apks' \
--ks ~/.android/debug.keystore \
--ks-pass android \
--ks-key-alias androiddebugkey \
--key-pass android \
--pattern 'build/**/outputs/**/*.aab'
artifacts:
- build/**/outputs/**/*.apk
- build/**/outputs/**/*.aab
- build/**/outputs/**/mapping.txt
- flutter_drive.log
publishing:
email:
recipients:
- milind.mevada@solutelabs.com
staging:
name: Staging
environment:
flutter: stable
cache:
cache_paths:
- $FCI_BUILD_DIR/build
scripts:
- |
# fetch codemagic helper scripts
rm -rf ~/codemagic-build-scripts
git clone https://github.com/NevercodeHQ/codemagic-build-scripts.git ~/codemagic-build-scripts/ --depth 1
- |
# set up debug keystore
rm -f ~/.android/debug.keystore
keytool -genkeypair \
-alias androiddebugkey \
-keypass android \
-keystore ~/.android/debug.keystore \
-storepass android \
-dname 'CN=Android Debug,O=Android,C=US' \
-keyalg 'RSA' \
-keysize 2048 \
-validity 10000
- |
# set up local properties
echo "flutter.sdk=$HOME/programs/flutter" > "$FCI_BUILD_DIR/android/local.properties"
- flutter packages pub get
- flutter build appbundle --release -flavor staging -t main_staging.dart
- |
# generate universal apk signed with debug key
'~/codemagic-build-scripts/android/generate-universal-apks' \
--ks ~/.android/debug.keystore \
--ks-pass android \
--ks-key-alias androiddebugkey \
--key-pass android \
--pattern 'build/**/outputs/**/*.aab'
artifacts:
- build/**/outputs/**/*.apk
- build/**/outputs/**/*.aab
- build/**/outputs/**/mapping.txt
- flutter_drive.log
publishing:
email:
recipients:
- milind.mevada@solutelabs.com
production:
name: Production
environment:
flutter: stable
cache:
cache_paths:
- $FCI_BUILD_DIR/build
scripts:
- |
# fetch codemagic helper scripts
rm -rf ~/codemagic-build-scripts
git clone https://github.com/NevercodeHQ/codemagic-build-scripts.git ~/codemagic-build-scripts/ --depth 1
- |
# set up debug keystore
rm -f ~/.android/debug.keystore
keytool -genkeypair \
-alias androiddebugkey \
-keypass android \
-keystore ~/.android/debug.keystore \
-storepass android \
-dname 'CN=Android Debug,O=Android,C=US' \
-keyalg 'RSA' \
-keysize 2048 \
-validity 10000
- |
# set up local properties
echo "flutter.sdk=$HOME/programs/flutter" > "$FCI_BUILD_DIR/android/local.properties"
- flutter packages pub get
- flutter build appbundle --release -flavor production -t main_prod.dart
- |
# generate universal apk signed with debug key
'~/codemagic-build-scripts/android/generate-universal-apks' \
--ks ~/.android/debug.keystore \
--ks-pass android \
--ks-key-alias androiddebugkey \
--key-pass android \
--pattern 'build/**/outputs/**/*.aab'
artifacts:
- build/**/outputs/**/*.apk
- build/**/outputs/**/*.aab
- build/**/outputs/**/mapping.txt
- flutter_drive.log
publishing:
email:
recipients:
- milind.mevada@solutelabs.com
1 change: 1 addition & 0 deletions ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
Loading

0 comments on commit 25a3875

Please sign in to comment.