update flow after print back to home

This commit is contained in:
2026-02-11 18:59:12 +07:00
parent 34ee0c3c01
commit 9ccecce196
41 changed files with 108 additions and 85 deletions

View File

@@ -8,7 +8,7 @@
<application <application
android:label="POSPro" android:label="Kulakpos"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:enableOnBackInvokedCallback="true"> android:enableOnBackInvokedCallback="true">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -4,9 +4,9 @@
<item android:drawable="@android:color/white" /> <item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here --> <!-- You can insert your own image assets here -->
<!-- <item> <item>
<bitmap <bitmap
android:gravity="center" android:gravity="center"
android:src="@mipmap/launch_image" /> android:src="@drawable/launch_image" />
</item> --> </item>
</layer-list> </layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 30 KiB

BIN
images/logo.xcf Normal file

Binary file not shown.

BIN
images/logokulakpos.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
images/splashkulakpos.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
images/splashkulakpos.xcf Normal file

Binary file not shown.

View File

@@ -2,117 +2,115 @@
"images": [ "images": [
{ {
"filename": "Icon-App-20x20@2x.png", "filename": "Icon-App-20x20@2x.png",
"idiom": "iphone", "idiom": "universal",
"scale": "2x", "scale": "2x",
"size": "20x20" "size": "20x20",
"platform": "ios"
}, },
{ {
"filename": "Icon-App-20x20@3x.png", "filename": "Icon-App-20x20@3x.png",
"idiom": "iphone", "idiom": "universal",
"scale": "3x", "scale": "3x",
"size": "20x20" "size": "20x20",
}, "platform": "ios"
{
"filename": "Icon-App-29x29@1x.png",
"idiom": "iphone",
"scale": "1x",
"size": "29x29"
}, },
{ {
"filename": "Icon-App-29x29@2x.png", "filename": "Icon-App-29x29@2x.png",
"idiom": "iphone", "idiom": "universal",
"scale": "2x", "scale": "2x",
"size": "29x29" "size": "29x29",
"platform": "ios"
}, },
{ {
"filename": "Icon-App-29x29@3x.png", "filename": "Icon-App-29x29@3x.png",
"idiom": "iphone", "idiom": "universal",
"scale": "3x", "scale": "3x",
"size": "29x29" "size": "29x29",
"platform": "ios"
},
{
"filename": "Icon-App-38x38@2x.png",
"idiom": "universal",
"scale": "2x",
"size": "38x38",
"platform": "ios"
},
{
"filename": "Icon-App-38x38@3x.png",
"idiom": "universal",
"scale": "3x",
"size": "38x38",
"platform": "ios"
}, },
{ {
"filename": "Icon-App-40x40@2x.png", "filename": "Icon-App-40x40@2x.png",
"idiom": "iphone", "idiom": "universal",
"scale": "2x", "scale": "2x",
"size": "40x40" "size": "40x40",
"platform": "ios"
}, },
{ {
"filename": "Icon-App-40x40@3x.png", "filename": "Icon-App-40x40@3x.png",
"idiom": "iphone", "idiom": "universal",
"scale": "3x", "scale": "3x",
"size": "40x40" "size": "40x40",
"platform": "ios"
}, },
{ {
"filename": "Icon-App-60x60@2x.png", "filename": "Icon-App-60x60@2x.png",
"idiom": "iphone", "idiom": "universal",
"scale": "2x", "scale": "2x",
"size": "60x60" "size": "60x60",
"platform": "ios"
}, },
{ {
"filename": "Icon-App-60x60@3x.png", "filename": "Icon-App-60x60@3x.png",
"idiom": "iphone", "idiom": "universal",
"scale": "3x", "scale": "3x",
"size": "60x60" "size": "60x60",
"platform": "ios"
}, },
{ {
"filename": "Icon-App-20x20@1x.png", "filename": "Icon-App-64x64@2x.png",
"idiom": "ipad", "idiom": "universal",
"scale": "1x",
"size": "20x20"
},
{
"filename": "Icon-App-20x20@2x.png",
"idiom": "ipad",
"scale": "2x", "scale": "2x",
"size": "20x20" "size": "64x64",
"platform": "ios"
}, },
{ {
"filename": "Icon-App-29x29@1x.png", "filename": "Icon-App-64x64@3x.png",
"idiom": "ipad", "idiom": "universal",
"scale": "1x", "scale": "3x",
"size": "29x29" "size": "64x64",
"platform": "ios"
}, },
{ {
"filename": "Icon-App-29x29@2x.png", "filename": "Icon-App-68x68@2x.png",
"idiom": "ipad", "idiom": "universal",
"scale": "2x", "scale": "2x",
"size": "29x29" "size": "68x68",
}, "platform": "ios"
{
"filename": "Icon-App-40x40@1x.png",
"idiom": "ipad",
"scale": "1x",
"size": "40x40"
},
{
"filename": "Icon-App-40x40@2x.png",
"idiom": "ipad",
"scale": "2x",
"size": "40x40"
},
{
"filename": "Icon-App-76x76@1x.png",
"idiom": "ipad",
"scale": "1x",
"size": "76x76"
}, },
{ {
"filename": "Icon-App-76x76@2x.png", "filename": "Icon-App-76x76@2x.png",
"idiom": "ipad", "idiom": "universal",
"scale": "2x", "scale": "2x",
"size": "76x76" "size": "76x76",
"platform": "ios"
}, },
{ {
"filename": "Icon-App-83.5x83.5@2x.png", "filename": "Icon-App-83.5x83.5@2x.png",
"idiom": "ipad", "idiom": "universal",
"scale": "2x", "scale": "2x",
"size": "83.5x83.5" "size": "83.5x83.5",
"platform": "ios"
}, },
{ {
"filename": "Icon-App-1024x1024@1x.png", "filename": "Icon-App-1024x1024@1x.png",
"idiom": "ios-marketing", "idiom": "universal",
"scale": "1x", "scale": "1x",
"size": "1024x1024" "size": "1024x1024",
"platform": "ios"
} }
], ],
"info": { "info": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -15,14 +15,16 @@ import '../../Provider/profile_provider.dart';
import '../../service/check_actions_when_no_branch.dart'; import '../../service/check_actions_when_no_branch.dart';
class Home extends StatefulWidget { class Home extends StatefulWidget {
const Home({super.key}); const Home({super.key, this.initialIndex = 0});
final int initialIndex;
@override @override
_HomeState createState() => _HomeState(); _HomeState createState() => _HomeState();
} }
class _HomeState extends State<Home> { class _HomeState extends State<Home> {
int _tabIndex = 0; late int _tabIndex = widget.initialIndex;
late final PageController pageController = PageController(initialPage: _tabIndex); late final PageController pageController = PageController(initialPage: _tabIndex);
@override @override

View File

@@ -26,6 +26,7 @@ import '../../widgets/universal_image.dart';
import '../Products/add product/modle/create_product_model.dart'; import '../Products/add product/modle/create_product_model.dart';
import '../language/language_provider.dart'; import '../language/language_provider.dart';
import '../../Provider/product_provider.dart'; import '../../Provider/product_provider.dart';
import '../Home/home.dart';
class SalesInvoiceDetails extends StatefulWidget { class SalesInvoiceDetails extends StatefulWidget {
const SalesInvoiceDetails({ const SalesInvoiceDetails({
@@ -165,7 +166,7 @@ class _SalesInvoiceDetailsState extends State<SalesInvoiceDetails> {
businessSettingData.when( businessSettingData.when(
data: (business) { data: (business) {
final isSvg = business.data?.thermalInvoiceLogo?.endsWith('.svg'); final isSvg = business.data?.thermalInvoiceLogo?.endsWith('.svg');
final imageUrl = '${APIConfig.domain}${business.data?.thermalInvoiceLogo}'; final imageUrl = '${APIConfig.domain}${business.data?.thermalInvoiceLogo ?? ""}';
const placeholder = AssetImage(mainConstant.logo); const placeholder = AssetImage(mainConstant.logo);
return (business.data?.thermalInvoiceLogo?.isEmptyOrNull ?? true) return (business.data?.thermalInvoiceLogo?.isEmptyOrNull ?? true)
? buildInvoiceLogo(image: placeholder) ? buildInvoiceLogo(image: placeholder)
@@ -1217,7 +1218,7 @@ class _SalesInvoiceDetailsState extends State<SalesInvoiceDetails> {
color: const Color(0xffF5F3F3), color: const Color(0xffF5F3F3),
image: DecorationImage( image: DecorationImage(
image: NetworkImage( image: NetworkImage(
'${APIConfig.domain}${widget.saleTransaction.image}', '${APIConfig.domain}${widget.saleTransaction.image ?? ""}',
), ),
fit: BoxFit.contain), fit: BoxFit.contain),
), ),
@@ -1247,12 +1248,14 @@ class _SalesInvoiceDetailsState extends State<SalesInvoiceDetails> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
if (widget.businessInfo.data?.showInvoiceScannerLogo == 1) if (widget.businessInfo.data?.showInvoiceScannerLogo == 1 &&
widget.businessInfo.data?.invoiceScannerLogo != null)
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 10), padding: const EdgeInsets.symmetric(vertical: 10),
child: Center( child: Center(
child: UniversalImage( child: UniversalImage(
imagePath: '${APIConfig.domain}${widget.businessInfo.data?.invoiceScannerLogo}', imagePath:
'${APIConfig.domain}${widget.businessInfo.data?.invoiceScannerLogo ?? ""}',
height: 120, height: 120,
width: 120, width: 120,
), ),
@@ -1314,12 +1317,21 @@ class _SalesInvoiceDetailsState extends State<SalesInvoiceDetails> {
PrintSalesTransactionModel model = PrintSalesTransactionModel( PrintSalesTransactionModel model = PrintSalesTransactionModel(
transitionModel: widget.saleTransaction, transitionModel: widget.saleTransaction,
personalInformationModel: widget.businessInfo); personalInformationModel: widget.businessInfo);
await printerData.printSalesThermalInvoiceNow( bool printed = await printerData.printSalesThermalInvoiceNow(
transaction: model, transaction: model,
productList: model.transitionModel!.salesDetails, productList: model.transitionModel!.salesDetails,
context: context, context: context,
products: products.value, products: products.value,
); );
if (printed && context.mounted) {
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(
builder: (context) => const Home(initialIndex: 1),
),
(route) => false,
);
}
// final defould = true; // final defould = true;
// if (defould) { // if (defould) {

View File

@@ -42,14 +42,14 @@ String noProductImageUrl = 'images/no_product_image.png';
///---------update information--------------- ///---------update information---------------
const String splashLogo = 'images/splashLogo.png'; const String splashLogo = 'images/splashkulakpos.png';
const String onboard1 = 'images/onbord1.png'; const String onboard1 = 'images/onbord1.png';
const String onboard2 = 'images/onbord2.png'; const String onboard2 = 'images/onbord2.png';
const String onboard3 = 'images/onbord3.png'; const String onboard3 = 'images/onbord3.png';
const String logo = 'images/logo.png'; const String logo = 'images/logokulakpos.png';
const String appsName = 'POSpro'; const String appsName = 'KULAKPOS';
const String companyWebsite = 'https://acnoo.com'; const String companyWebsite = 'https://kulakpos.id';
const String companyName = 'Acnoo'; const String companyName = 'KULAKPOS';
bool connected = false; bool connected = false;

View File

@@ -129,16 +129,27 @@ class ThermalPrinter extends ChangeNotifier {
); );
} }
Future<void> printSalesThermalInvoiceNow( Future<bool> printSalesThermalInvoiceNow(
{required PrintSalesTransactionModel transaction, {required PrintSalesTransactionModel transaction,
required List<SalesDetails>? productList, required List<SalesDetails>? productList,
required BuildContext context, required BuildContext context,
List<Product>? products}) async { List<Product>? products}) async {
await getBluetooth(); await getBluetooth();
isBluetoothConnected if (isBluetoothConnected) {
? SalesThermalPrinterInvoice().printSalesTicket( await SalesThermalPrinterInvoice().printSalesTicket(
printTransactionModel: transaction, productList: productList, context: context, products: products) printTransactionModel: transaction, productList: productList, context: context, products: products);
: listOfBluDialog(context: context); return true;
} else {
if (context.mounted) {
await listOfBluDialog(context: context);
}
if (isBluetoothConnected) {
await SalesThermalPrinterInvoice().printSalesTicket(
printTransactionModel: transaction, productList: productList, context: context, products: products);
return true;
}
return false;
}
} }
Future<void> printPurchaseThermalInvoiceNow( Future<void> printPurchaseThermalInvoiceNow(

View File

@@ -135,14 +135,14 @@ flutter_intl:
icons_launcher: icons_launcher:
image_path: "images/appIcon.png" image_path: "images/logokulakpos.png"
platforms: platforms:
android: android:
enable: true enable: true
ios: ios:
enable: true enable: true
image_path: "images/appIcon.png" image_path: "images/logokulakpos.png"
dependency_overrides: dependency_overrides:
vector_math: ^2.2.0 vector_math: ^2.2.0