Skip to content

Commit

Permalink
first android prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
iqfareez committed Aug 14, 2020
1 parent f12ec95 commit 8ae3f01
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ https://bmi-flutter-2e776.web.app/
## Download app (coming soon)

1. Google Play Store
2. APK
2. [APK](https://github.com/fareezMaple/bmi_calculator-Flutter/releases)

## Legalese

Expand Down
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ gradle-wrapper.jar
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
key.properties
27 changes: 20 additions & 7 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
compileSdkVersion 28

Expand All @@ -40,14 +45,22 @@ android {
versionName flutterVersionName
}

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.debug
}
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}

}
}

flutter {
source '../..'
Expand Down
3 changes: 3 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->

<uses-permission android:name="android.permission.INTERNET" />

<application
android:name="io.flutter.app.FlutterApplication"
android:label="bmicalculator"
Expand Down
3 changes: 2 additions & 1 deletion lib/AppBody.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class _AppBodyState extends State<AppBody> {
counter: Offstage(),
border: OutlineInputBorder(),
labelText: "Height",
hintText: "Eg: 1.7",
hintText: "Eg: 1.73",
suffixText: "m",
alignLabelWithHint: false,
filled: true),
Expand All @@ -141,6 +141,7 @@ class _AppBodyState extends State<AppBody> {
),
color: Colors.green,
onPressed: () {
FocusManager.instance.primaryFocus.unfocus();
print('Button calculate pressed');
print('height is ' + heightController.text);
print('weight is ' + weightController.text);
Expand Down
14 changes: 12 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:share/share.dart';

import 'AppBody.dart';

Expand All @@ -11,7 +12,7 @@ class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'BMI Calculator ',
title: 'BMI Calculator',
theme: ThemeData(
primarySwatch: Colors.deepOrange,
visualDensity: VisualDensity.adaptivePlatformDensity,
Expand All @@ -33,14 +34,23 @@ class MyHomePage extends StatelessWidget {
icon: Icon(Icons.share),
onPressed: () {
print('Pressed');
Share.share('Not implemented yet :")');
},
tooltip: 'Share your current BMI',
),
IconButton(
icon: Icon(Icons.info),
onPressed: () {
print('Info');
showAboutDialog(context: context);
showAboutDialog(
context: context,
applicationName: 'BMI Calculator Lite',
applicationVersion: '1.0.0-pre+1',
applicationIcon: Image.network(
'https://firebasestorage.googleapis.com/v0/b/bmi-flutter-2e776.appspot.com/o/logounnamed%20(Custom).png?alt=media&token=b22b53f7-bfc6-4a9b-89f3-92e681d1fe6c',
width: 50,
),
applicationLegalese: '© maplerr aka fareez');
},
tooltip: 'View some info',
)
Expand Down
7 changes: 7 additions & 0 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.4.4"
share:
dependency: "direct main"
description:
name: share
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.4+3"
sky_engine:
dependency: transitive
description: flutter
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
version: 1.0.0-pre+1

environment:
sdk: ">=2.7.0 <3.0.0"
Expand All @@ -24,6 +24,7 @@ dependencies:
google_fonts: ^1.1.0
url_launcher: ^5.4.11
flutter_linkify: ^3.1.3
share: ^0.6.4+3

flutter:
sdk: flutter
Expand Down

0 comments on commit 8ae3f01

Please sign in to comment.