feat: release to playstore configuration

This commit is contained in:
Supan Adit Pratama 2025-02-04 19:41:53 +07:00
parent 3f9a75ec73
commit f3d7ad2db0
2 changed files with 20 additions and 4 deletions

View File

@ -5,6 +5,12 @@ plugins {
id "dev.flutter.flutter-gradle-plugin" id "dev.flutter.flutter-gradle-plugin"
} }
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android { android {
namespace = "com.supanadit.geosmart" namespace = "com.supanadit.geosmart"
compileSdk = flutter.compileSdkVersion compileSdk = flutter.compileSdkVersion
@ -30,11 +36,20 @@ android {
versionName = flutter.versionName versionName = flutter.versionName
} }
signingConfigs {
release {
keyAlias = keystoreProperties['keyAlias']
keyPassword = keystoreProperties['keyPassword']
storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword = keystoreProperties['storePassword']
}
}
buildTypes { buildTypes {
release { release {
// TODO: Add your own signing config for the release build. // TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works. // Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug signingConfig = signingConfigs.release
} }
} }
} }

View File

@ -37,6 +37,7 @@ class _MapPageState extends State<MapPage> {
} }
}); });
}); });
Geolocator.getPositionStream().listen((Position position) { Geolocator.getPositionStream().listen((Position position) {
if (isTracking && isGranted) { if (isTracking && isGranted) {
BlocProvider.of<PositionBloc>(context).add( BlocProvider.of<PositionBloc>(context).add(
@ -85,13 +86,15 @@ class _MapPageState extends State<MapPage> {
}, },
), ),
Container( Container(
child: Image.asset("assets/images/logo.png"),
width: 70, width: 70,
height: 70, height: 70,
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
margin: EdgeInsets.only(left: 10.0), margin: EdgeInsets.only(left: 10.0),
child: Image.asset("assets/images/logo.png"),
), ),
Container( Container(
margin: EdgeInsets.only(bottom: 50.0),
alignment: Alignment.bottomCenter,
child: TextButton( child: TextButton(
style: TextButton.styleFrom( style: TextButton.styleFrom(
backgroundColor: (state is PositionTrackingStarted) backgroundColor: (state is PositionTrackingStarted)
@ -119,8 +122,6 @@ class _MapPageState extends State<MapPage> {
style: TextStyle(color: Colors.white), style: TextStyle(color: Colors.white),
), ),
), ),
margin: EdgeInsets.only(bottom: 50.0),
alignment: Alignment.bottomCenter,
) )
], ],
); );