Commit ee52f03d authored by Faizol's avatar Faizol

update version , added seting layout balance & ticket

parent c273ad77
......@@ -31,3 +31,4 @@ This project is a starting point for a Flutter application.
** change icon reload ✅
** add datetime in history saldo & ticket ✅
** add scrollable effect to table history ✅
** added setting prefix history balance and ticket ✅
\ No newline at end of file
......@@ -59,6 +59,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
List<Map<String, dynamic>> ticketHistoryData = [];
ScrollController _scrollController = ScrollController();
bool showShimmer = false;
bool shouldShowBalanceAndTicketSections = false;
@override
void initState() {
......@@ -349,9 +350,10 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
print('APP VERSION SELFSERVICE: $appVersion');
RegExp regExp = RegExp(r'www', caseSensitive: false);
String imageLogoShowTap =
regExp.hasMatch(appVersion) ? 'assets/wahoo.png' : '';
String imageLogoShowTap = regExp.hasMatch(appVersion) ? 'assets/wahoo.png' : '';
print('imageLogoShowTap: $imageLogoShowTap');
shouldShowBalanceAndTicketSections = !regExp.hasMatch(appVersion);
return imageLogoShowTap;
}
......@@ -591,6 +593,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width;
double screenHeight = MediaQuery.of(context).size.height;
_getImageLogoShowTap();
return Listener(
onPointerDown: (details) {
if (timer != null) timer?.cancel();
......@@ -616,8 +620,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
Column(
children: [
Container(
width: screenWidth *
0.10, // Container untuk spasi di kiri
width: screenWidth * 0.10,
),
Container(
width: screenWidth * 0.70,
......@@ -633,7 +636,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
Colors.white,
],
),
child: buildWalletSection()
child: buildWalletSection(),
)
: buildWalletSection(),
),
......@@ -641,8 +644,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
margin: EdgeInsets.fromLTRB(30, 0, 0, 0),
width: screenWidth * 0.95,
height: screenHeight * 0.70,
// Container untuk "balance section"
child:showShimmer
child: shouldShowBalanceAndTicketSections
? (showShimmer
? Shimmer(
gradient: LinearGradient(
begin: Alignment.centerLeft,
......@@ -650,19 +653,21 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
colors: [
Colors.white,
veryLightTextColor,
Colors.white,// Ivory (Putih Kuning Muda)
Colors.white,
],
),
child: buildBalanceSection()
child: buildBalanceSection(),
)
: buildBalanceSection(),
: buildBalanceSection())
: SizedBox(), // Hide balance section
),
SizedBox(height: 20),
Container(
margin: EdgeInsets.fromLTRB(30, 0, 0, 0),
width: screenWidth * 0.95,
height: screenHeight * 0.70,
child:showShimmer
child: shouldShowBalanceAndTicketSections
? (showShimmer
? Shimmer(
gradient: LinearGradient(
begin: Alignment.centerLeft,
......@@ -670,12 +675,14 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
colors: [
Colors.white,
veryLightTextColor,
Colors.white, // Ivory (Putih Kuning Muda)
Colors.white,
],
),
child: buildTicketSection()
child: buildTicketSection(),
)
: buildTicketSection()),
: buildTicketSection())
: SizedBox(), // Hide ticket section
),
SizedBox(height: 20),
],
),
......@@ -683,9 +690,9 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
),
),
Positioned(
bottom: 90.0, // Adjust the position as needed
right: 5.0, // Adjust the position as needed
child:showShimmer
bottom: 90.0,
right: 5.0,
child: showShimmer
? Shimmer(
gradient: LinearGradient(
begin: Alignment.centerLeft,
......@@ -693,7 +700,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
colors: [
Colors.white,
veryLightTextColor,
Colors.white, // Ivory (Putih Kuning Muda)
Colors.white,
],
),
child: FloatingActionButton(
......@@ -704,19 +711,18 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
color: Colors.white,
),
),
) : FloatingActionButton(
)
: FloatingActionButton(
backgroundColor: purpleColor,
onPressed: () async {
// Add the action for your floating button
onPressed: () {
_scrollController.animateTo(
0.0,
// Ganti dengan posisi yang sesuai (biasanya 0.0 untuk pindah ke atas)
duration: Duration(milliseconds: 500), // Durasi animasi
curve: Curves.easeInOut, // Efek animasi
duration: Duration(milliseconds: 500),
curve: Curves.easeInOut,
);
if (timer != null) timer?.cancel();
isShowingDialog = true;
timer?.cancel();
checkCountZero = false;
_showTap(context);
tapDial(context);
},
......@@ -726,40 +732,10 @@ 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(
bottom: 100.0, // Adjust the position as needed
right: 14.5, // Adjust the position as needed
child:showShimmer
bottom: 100.0,
right: 14.5,
child: showShimmer
? Shimmer(
gradient: LinearGradient(
begin: Alignment.centerLeft,
......@@ -767,11 +743,12 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
colors: [
Colors.white,
veryLightTextColor,
Colors.white, // Ivory (Putih Kuning Muda)
Colors.white,
],
),
child: buildTimerSection(context)
): buildTimerSection(context),
child: 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