Commit ee52f03d authored by Faizol's avatar Faizol

update version , added seting layout balance & ticket

parent c273ad77
...@@ -30,4 +30,5 @@ This project is a starting point for a Flutter application. ...@@ -30,4 +30,5 @@ This project is a starting point for a Flutter application.
** remove icon printer ✅ ** remove icon printer ✅
** change icon reload ✅ ** change icon reload ✅
** add datetime in history saldo & ticket ✅ ** add datetime in history saldo & ticket ✅
** add scrollable effect to table history ✅ ** add scrollable effect to table history ✅
\ No newline at end of file ** added setting prefix history balance and ticket ✅
\ No newline at end of file
...@@ -59,6 +59,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> ...@@ -59,6 +59,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
List<Map<String, dynamic>> ticketHistoryData = []; List<Map<String, dynamic>> ticketHistoryData = [];
ScrollController _scrollController = ScrollController(); ScrollController _scrollController = ScrollController();
bool showShimmer = false; bool showShimmer = false;
bool shouldShowBalanceAndTicketSections = false;
@override @override
void initState() { void initState() {
...@@ -349,9 +350,10 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> ...@@ -349,9 +350,10 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
print('APP VERSION SELFSERVICE: $appVersion'); print('APP VERSION SELFSERVICE: $appVersion');
RegExp regExp = RegExp(r'www', caseSensitive: false); RegExp regExp = RegExp(r'www', caseSensitive: false);
String imageLogoShowTap = String imageLogoShowTap = regExp.hasMatch(appVersion) ? 'assets/wahoo.png' : '';
regExp.hasMatch(appVersion) ? 'assets/wahoo.png' : '';
print('imageLogoShowTap: $imageLogoShowTap'); print('imageLogoShowTap: $imageLogoShowTap');
shouldShowBalanceAndTicketSections = !regExp.hasMatch(appVersion);
return imageLogoShowTap; return imageLogoShowTap;
} }
...@@ -591,6 +593,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> ...@@ -591,6 +593,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
Widget build(BuildContext context) { Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width; double screenWidth = MediaQuery.of(context).size.width;
double screenHeight = MediaQuery.of(context).size.height; double screenHeight = MediaQuery.of(context).size.height;
_getImageLogoShowTap();
return Listener( return Listener(
onPointerDown: (details) { onPointerDown: (details) {
if (timer != null) timer?.cancel(); if (timer != null) timer?.cancel();
...@@ -616,66 +620,69 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> ...@@ -616,66 +620,69 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
Column( Column(
children: [ children: [
Container( Container(
width: screenWidth * width: screenWidth * 0.10,
0.10, // Container untuk spasi di kiri
), ),
Container( Container(
width: screenWidth * 0.70, width: screenWidth * 0.70,
height: screenHeight * 0.80, height: screenHeight * 0.80,
child: showShimmer child: showShimmer
? Shimmer( ? Shimmer(
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.centerLeft, begin: Alignment.centerLeft,
end: Alignment.centerRight, end: Alignment.centerRight,
colors: [ colors: [
Colors.white, Colors.white,
veryLightTextColor, veryLightTextColor,
Colors.white, Colors.white,
], ],
), ),
child: buildWalletSection() child: buildWalletSection(),
) )
: buildWalletSection(), : buildWalletSection(),
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(30, 0, 0, 0), margin: EdgeInsets.fromLTRB(30, 0, 0, 0),
width: screenWidth * 0.95, width: screenWidth * 0.95,
height: screenHeight * 0.70, height: screenHeight * 0.70,
// Container untuk "balance section" child: shouldShowBalanceAndTicketSections
child:showShimmer ? (showShimmer
? Shimmer( ? Shimmer(
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.centerLeft, begin: Alignment.centerLeft,
end: Alignment.centerRight, end: Alignment.centerRight,
colors: [ colors: [
Colors.white, Colors.white,
veryLightTextColor, veryLightTextColor,
Colors.white,// Ivory (Putih Kuning Muda) Colors.white,
], ],
), ),
child: buildBalanceSection() child: buildBalanceSection(),
) )
: buildBalanceSection(), : buildBalanceSection())
: SizedBox(), // Hide balance section
), ),
SizedBox(height: 20), SizedBox(height: 20),
Container( Container(
margin: EdgeInsets.fromLTRB(30, 0, 0, 0), margin: EdgeInsets.fromLTRB(30, 0, 0, 0),
width: screenWidth * 0.95, width: screenWidth * 0.95,
height: screenHeight * 0.70, height: screenHeight * 0.70,
child:showShimmer child: shouldShowBalanceAndTicketSections
? Shimmer( ? (showShimmer
gradient: LinearGradient( ? Shimmer(
begin: Alignment.centerLeft, gradient: LinearGradient(
end: Alignment.centerRight, begin: Alignment.centerLeft,
colors: [ end: Alignment.centerRight,
Colors.white, colors: [
veryLightTextColor, Colors.white,
Colors.white, // Ivory (Putih Kuning Muda) veryLightTextColor,
], Colors.white,
), ],
child: buildTicketSection() ),
) child: buildTicketSection(),
: buildTicketSection()), )
: buildTicketSection())
: SizedBox(), // Hide ticket section
),
SizedBox(height: 20), SizedBox(height: 20),
], ],
), ),
...@@ -683,40 +690,39 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> ...@@ -683,40 +690,39 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
), ),
), ),
Positioned( Positioned(
bottom: 90.0, // Adjust the position as needed bottom: 90.0,
right: 5.0, // Adjust the position as needed right: 5.0,
child:showShimmer child: showShimmer
? Shimmer( ? Shimmer(
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.centerLeft, begin: Alignment.centerLeft,
end: Alignment.centerRight, end: Alignment.centerRight,
colors: [ colors: [
Colors.white, Colors.white,
veryLightTextColor, veryLightTextColor,
Colors.white, // Ivory (Putih Kuning Muda) Colors.white,
], ],
), ),
child: FloatingActionButton( child: FloatingActionButton(
backgroundColor: purpleColor, backgroundColor: purpleColor,
onPressed: () {}, onPressed: () {},
child: Icon( child: Icon(
Icons.sync, Icons.sync,
color: Colors.white, color: Colors.white,
),
), ),
) : FloatingActionButton( ),
)
: FloatingActionButton(
backgroundColor: purpleColor, backgroundColor: purpleColor,
onPressed: () async { onPressed: () {
// Add the action for your floating button
_scrollController.animateTo( _scrollController.animateTo(
0.0, 0.0,
// Ganti dengan posisi yang sesuai (biasanya 0.0 untuk pindah ke atas) duration: Duration(milliseconds: 500),
duration: Duration(milliseconds: 500), // Durasi animasi curve: Curves.easeInOut,
curve: Curves.easeInOut, // Efek animasi
); );
if (timer != null) timer?.cancel();
isShowingDialog = true; isShowingDialog = true;
timer?.cancel(); checkCountZero = false;
_showTap(context); _showTap(context);
tapDial(context); tapDial(context);
}, },
...@@ -726,52 +732,23 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> ...@@ -726,52 +732,23 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
), ),
), ),
), ),
// Positioned(
// bottom: 100.0, // Adjust the position as needed
// right: 20.0, // Adjust the position as needed
// child: FloatingActionButton(
// onPressed: () {
// showToastMessage('Maaf , fitur tidak tersedia');
//Nyalakan kembali jika dibutuhkan
// Konversi data ke JSON
// String jsonBalance = json.encode(balanceHistoryData);
// name;
// cardNumber;
// cardExpirity;
// cardType;
// deposit;
// balance;
// Memanggil metode printHistory dengan data yang sudah diperbarui
// StartService.printHistory(
// jsonBalance,
// name,
// cardNumber,
// cardExpirity,
// cardType,
// deposit,
// balance
// );
// },
// child: Icon(Icons.print),
// ),
// ),
Positioned( Positioned(
bottom: 100.0, // Adjust the position as needed bottom: 100.0,
right: 14.5, // Adjust the position as needed right: 14.5,
child:showShimmer child: showShimmer
? Shimmer( ? Shimmer(
gradient: LinearGradient( gradient: LinearGradient(
begin: Alignment.centerLeft, begin: Alignment.centerLeft,
end: Alignment.centerRight, end: Alignment.centerRight,
colors: [ colors: [
Colors.white, Colors.white,
veryLightTextColor, veryLightTextColor,
Colors.white, // Ivory (Putih Kuning Muda) Colors.white,
], ],
), ),
child: buildTimerSection(context) child: buildTimerSection(context),
): buildTimerSection(context), )
: buildTimerSection(context),
), ),
], ],
), ),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment