android release 1

This commit is contained in:
2025-01-13 10:10:05 +06:30
parent d422761e51
commit 21cf7a2517
8 changed files with 92 additions and 18 deletions

3
.gitignore vendored
View File

@@ -43,9 +43,7 @@ app.*.map.json
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
android/key.properties
android/key.jks
android/app/src/prod/AndroidManifest.xml
android/app/src/prod/google-services.json
android/app/src/prod/res/values/strings.xml
.gradle/5.6.2/gc.properties
.gradle/5.6.2/executionHistory/executionHistory.bin
.gradle/5.6.2/executionHistory/executionHistory.lock
@@ -59,4 +57,3 @@ android/dev-key.properties
ios/Runner/GoogleService-Info.plist
android/app/google-services.json
ios/Runner/GoogleService-Info.plist
ios/Runner/GoogleService-Info.plist

View File

@@ -67,16 +67,16 @@ android {
}
flavorDimensions "app"
flavorDimensions "fcs"
productFlavors {
prod {
dimension "app"
dimension "fcs"
applicationId "com.mokkon.fcs"
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
dev {
dimension "app"
dimension "fcs"
applicationId "com.mokkon.fcs.dev"
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
@@ -100,11 +100,21 @@ android {
// useProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationVariants.all { variant ->
variant.outputs.all {
def newName
// if (buildType == 'debug'){
// newName = "app-${variant.getFlavorName()}-debug.apk"
// } else {
newName = "${variant.productFlavors[0].dimension}_${variant.productFlavors[0].name}_v${defaultConfig.versionName}+${defaultConfig.versionCode}.apk"
// }
outputFileName = newName
}
}
}
debug {
debuggable true
}
}
}

View File

@@ -0,0 +1,38 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
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. -->
<application
android:name=".Application"
android:exported="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:hardwareAccelerated="true"
android:exported="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">FCS Logistics</string>
</resources>

1
firebase.json Normal file
View File

@@ -0,0 +1 @@
{"flutter":{"platforms":{"android":{"default":{"projectId":"fcs-dev1","appId":"1:944560757353:android:d21ae04e44e82f10fa60f8","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"fcs-dev1","appId":"1:944560757353:ios:de037244faea4173fa60f8","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"fcs-dev1","configurations":{"android":"1:944560757353:android:d21ae04e44e82f10fa60f8","ios":"1:944560757353:ios:de037244faea4173fa60f8"}}}}}}

View File

@@ -1,5 +1,5 @@
import 'package:fcs/data/provider/messaging_fcm.dart';
import 'package:fcs/firebase_options.dart';
import 'package:fcs/firebase_options_prod.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
@@ -20,5 +20,5 @@ Future<void> main() async {
color: Colors.blue,
apiURL: "https://asia-northeast1-fcs-prod1.cloudfunctions.net/API13",
level: Level.ALL);
runApp(App(title: "FCS"));
runApp(App(title: "FCS Logistics"));
}

24
lib/main.dart Normal file
View File

@@ -0,0 +1,24 @@
import 'package:fcs/data/provider/messaging_fcm.dart';
import 'package:fcs/firebase_options_prod.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
import 'package:logging/logging.dart';
import 'app.dart';
import 'config.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);
Config(
flavor: Flavor.PRODUCTION,
color: Colors.blue,
apiURL: "https://asia-northeast1-fcs-prod1.cloudfunctions.net/API13",
level: Level.ALL);
runApp(App(title: "FCS"));
}

View File

@@ -352,19 +352,19 @@ class _HomePageState extends State<HomePage> {
if (user.joined) {
widgets.add(packagesBtn);
// widgets.add(shipmentBtn);
widgets.add(invoicesBtn);
// widgets.add(invoicesBtn);
if (user.hasAdmin() || user.hasSupport()) widgetsFcs.add(rateBtnFcs);
if (user.hasPackages()) widgetsFcs.add(packagesBtnFcs);
// if (user.hasShipment()) widgetsFcs.add(shipmentBtnFcs);
if (user.hasShipment()) widgetsFcs.add(pickupBtnFcs);
if (user.hasInvoices()) widgetsFcs.add(invoicesBtnFcs);
// if (user.hasShipment()) widgetsFcs.add(pickupBtnFcs);
// if (user.hasInvoices()) widgetsFcs.add(invoicesBtnFcs);
if (user.hasFcsShipments()) widgetsFcs.add(fcsShipmentBtn);
if (user.hasReceiving()) widgetsFcs.add(receivingBtn);
if (user.hasProcessing()) widgetsFcs.add(processingBtn);
if (user.hasCarton()) widgetsFcs.add(cartonBtn);
if (user.hasDeliveries()) widgetsFcs.add(deliveryBtn);
// if (user.hasFcsShipments()) widgetsFcs.add(fcsShipmentBtn);
// if (user.hasReceiving()) widgetsFcs.add(receivingBtn);
// if (user.hasProcessing()) widgetsFcs.add(processingBtn);
// if (user.hasCarton()) widgetsFcs.add(cartonBtn);
// if (user.hasDeliveries()) widgetsFcs.add(deliveryBtn);
if (user.hasCustomers()) widgetsFcs.add(customersBtn);
if (user.hasAdmin()) widgetsFcs.add(discountBtn);
if (user.hasStaffs()) widgetsFcs.add(staffBtn);
@@ -512,7 +512,7 @@ class _HomePageState extends State<HomePage> {
profileBtn,
]
: <Widget>[
mainModel.isPinLogin ? pinLogoutBtn : pinLoginBtn,
// mainModel.isPinLogin ? pinLogoutBtn : pinLoginBtn,
fcsToggle,
profileBtn,
]