Skip to content

Commit d0944c6

Browse files
committed
🔨 build release apk
1 parent cdfd420 commit d0944c6

File tree

6 files changed

+33
-22
lines changed

6 files changed

+33
-22
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences","path":"/Users/parthmaniar/development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+1/","dependencies":[]}],"android":[{"name":"shared_preferences","path":"/Users/parthmaniar/development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+1/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/parthmaniar/development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+8/","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"/Users/parthmaniar/development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+5/","dependencies":[]}]},"dependencyGraph":[{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]}],"date_created":"2020-05-08 15:38:46.475248","version":"1.17.0"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"shared_preferences","path":"/Users/parthmaniar/development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+1/","dependencies":[]}],"android":[{"name":"shared_preferences","path":"/Users/parthmaniar/development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.7+1/","dependencies":[]}],"macos":[{"name":"shared_preferences_macos","path":"/Users/parthmaniar/development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_macos-0.0.1+8/","dependencies":[]}],"linux":[],"windows":[],"web":[{"name":"shared_preferences_web","path":"/Users/parthmaniar/development/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_web-0.1.2+5/","dependencies":[]}]},"dependencyGraph":[{"name":"shared_preferences","dependencies":["shared_preferences_macos","shared_preferences_web"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]}],"date_created":"2020-05-08 16:15:01.367320","version":"1.17.0"}

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
**/android/gradlew
3737
**/android/gradlew.bat
3838
**/android/local.properties
39+
**/android/key.properties
3940
**/android/**/GeneratedPluginRegistrant.java
4041

4142
# iOS/XCode related

‎android/app/build.gradle‎

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ if (localPropertiesFile.exists()) {
66
}
77
}
88

9+
def keystoreProperties = new Properties()
10+
def keystorePropertiesFile = rootProject.file('key.properties')
11+
if (keystorePropertiesFile.exists()) {
12+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
13+
}
14+
915
def flutterRoot = localProperties.getProperty('flutter.sdk')
1016
if (flutterRoot == null) {
1117
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
@@ -38,20 +44,28 @@ android {
3844

3945
defaultConfig {
4046
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41-
applicationId "com.example.theme_provider"
47+
applicationId "com.officialpm.theme_provider"
4248
minSdkVersion 16
4349
targetSdkVersion 28
4450
versionCode flutterVersionCode.toInteger()
4551
versionName flutterVersionName
4652
}
4753

48-
buildTypes {
49-
release {
50-
// TODO: Add your own signing config for the release build.
51-
// Signing with the debug keys for now, so `flutter run --release` works.
52-
signingConfig signingConfigs.debug
53-
}
54-
}
54+
signingConfigs {
55+
release {
56+
keyAlias keystoreProperties['keyAlias']
57+
keyPassword keystoreProperties['keyPassword']
58+
storeFile file(keystoreProperties['storeFile'])
59+
storePassword keystoreProperties['storePassword']
60+
}
61+
}
62+
63+
buildTypes {
64+
release {
65+
signingConfig signingConfigs.release
66+
// signingConfig signingConfigs.debug
67+
}
68+
}
5569
}
5670

5771
flutter {

‎lib/screens/home.dart‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import 'package:flutter/material.dart';
22
import 'package:theme_provider/screens/settings.dart';
33

4-
54
class HomePage extends StatefulWidget {
65
@override
76
_HomePageState createState() => _HomePageState();
87
}
98

109
class _HomePageState extends State<HomePage> {
11-
1210
@override
1311
void initState() {
1412
super.initState();
@@ -21,7 +19,7 @@ class _HomePageState extends State<HomePage> {
2119
preferredSize: Size.fromHeight(50.0), // here the desired height
2220
child: AppBar(
2321
title: Text("Theme Provider"),
24-
centerTitle: true,
22+
centerTitle: true,
2523
// ...
2624
)),
2725
extendBody: true,
@@ -32,13 +30,11 @@ class _HomePageState extends State<HomePage> {
3230
children: <Widget>[
3331
Text(
3432
"Parth Maniar",
35-
style: TextStyle(
36-
fontSize: 22.0,
37-
letterSpacing: 2.0
38-
),
33+
style: TextStyle(fontSize: 22.0, letterSpacing: 2.0),
3934
),
4035
],
41-
),),
36+
),
37+
),
4238
floatingActionButton: Container(
4339
height: 56.0,
4440
child: Card(
@@ -53,7 +49,7 @@ class _HomePageState extends State<HomePage> {
5349
color: Theme.of(context).accentColor,
5450
child: Row(
5551
mainAxisSize: MainAxisSize.min,
56-
children: <Widget>[
52+
children: <Widget>[
5753
Padding(
5854
padding: const EdgeInsets.only(top: 8.0, bottom: 8.0),
5955
child: Container(
@@ -85,4 +81,4 @@ class _HomePageState extends State<HomePage> {
8581
),
8682
);
8783
}
88-
}
84+
}

‎lib/screens/settings.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class _SettingsPageState extends State<SettingsPage> {
2424
preferredSize: Size.fromHeight(50.0), // here the desired height
2525
child: AppBar(
2626
title: Text(Strings.titleSettings),
27-
centerTitle: true,
27+
centerTitle: true,
2828
// ...
2929
)),
3030
body: ListView(
@@ -57,4 +57,4 @@ class _SettingsPageState extends State<SettingsPage> {
5757
var prefs = await SharedPreferences.getInstance();
5858
prefs.setBool('darkMode', value);
5959
}
60-
}
60+
}

‎lib/values/strings.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
class Strings {
22
static const String titleSettings = 'Settings';
3-
}
3+
}

0 commit comments

Comments
 (0)