Commit 996c898e authored by Faizol's avatar Faizol

added animated

parent 965e5fff
import 'dart:async'; import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'package:shimmer/shimmer.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
import 'package:awesome_dialog/awesome_dialog.dart'; import 'package:awesome_dialog/awesome_dialog.dart';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
...@@ -28,14 +28,24 @@ class HomePageCheckBalance extends StatefulWidget { ...@@ -28,14 +28,24 @@ class HomePageCheckBalance extends StatefulWidget {
State<HomePageCheckBalance> createState() => _HomePageCheckBalanceState(); State<HomePageCheckBalance> createState() => _HomePageCheckBalanceState();
} }
class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements AlertDialogCallback{ class _HomePageCheckBalanceState extends State<HomePageCheckBalance>
implements AlertDialogCallback {
var regDb,cardUid,balance,cardNumber,name,cardType,cardExpirity,deposit,infoCard,plainCardExpirity,dateTimeCardExpirity; var regDb,
cardUid,
balance,
cardNumber,
name,
cardType,
cardExpirity,
deposit,
infoCard,
plainCardExpirity,
dateTimeCardExpirity;
String? prevBalance, maskedText, getRegDb; String? prevBalance, maskedText, getRegDb;
late Timer? timerPage; late Timer? timerPage;
late Timer? timer; late Timer? timer;
String idle = PreferencesHelper.getString("idle_check_balance"); String idle = PreferencesHelper.getString("idle_check_balance");
int _maxDuration = 0; int _maxDuration = 0;
late ValueNotifier<int> idleDuration; late ValueNotifier<int> idleDuration;
...@@ -48,7 +58,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -48,7 +58,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
List<Map<String, dynamic>> balanceHistoryData = []; List<Map<String, dynamic>> balanceHistoryData = [];
List<Map<String, dynamic>> ticketHistoryData = []; List<Map<String, dynamic>> ticketHistoryData = [];
ScrollController _scrollController = ScrollController(); ScrollController _scrollController = ScrollController();
bool showShimmer = false;
@override @override
void initState() { void initState() {
...@@ -60,6 +70,9 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -60,6 +70,9 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
_showTap(context); _showTap(context);
tapDial(context); tapDial(context);
}); });
_maxDuration = int.parse(idle); _maxDuration = int.parse(idle);
idleDuration = ValueNotifier<int>(_maxDuration); idleDuration = ValueNotifier<int>(_maxDuration);
double _maxDurationPage = 5; // Durasi maksimum (dalam detik) double _maxDurationPage = 5; // Durasi maksimum (dalam detik)
...@@ -75,7 +88,6 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -75,7 +88,6 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
} }
}); });
Connectivity() Connectivity()
.onConnectivityChanged .onConnectivityChanged
.listen((ConnectivityResult connectivityResult) { .listen((ConnectivityResult connectivityResult) {
...@@ -185,8 +197,9 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -185,8 +197,9 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
checkCountZero = false; checkCountZero = false;
}); });
tapIdle(context); tapIdle(context); // Adjust the duration as needed
Navigator.pop(context); Navigator.of(context, rootNavigator: true).pop();
showShimmerEffect();
} }
} catch (e) { } catch (e) {
// Tangani kesalahan saat memproses data // Tangani kesalahan saat memproses data
...@@ -197,7 +210,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -197,7 +210,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
Future<void> _getAuditHistoryBalance(String cardUid, String regDb) async { Future<void> _getAuditHistoryBalance(String cardUid, String regDb) async {
try { try {
var auditHistoryBalance = await ServiceApi.fetchAuditHistory(cardUid, regDb, "balance"); var auditHistoryBalance =
await ServiceApi.fetchAuditHistory(cardUid, regDb, "balance");
print("AUDIT HISTORY BALANCE: $auditHistoryBalance"); print("AUDIT HISTORY BALANCE: $auditHistoryBalance");
setState(() { setState(() {
...@@ -222,7 +236,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -222,7 +236,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
Future<void> _getAuditHistoryTicket(String cardUid, String regDb) async { Future<void> _getAuditHistoryTicket(String cardUid, String regDb) async {
try { try {
var auditHistoryTicket = await ServiceApi.fetchAuditHistory(cardUid, regDb, "ticket"); var auditHistoryTicket =
await ServiceApi.fetchAuditHistory(cardUid, regDb, "ticket");
print("AUDIT HISTORY TICKET: $auditHistoryTicket"); print("AUDIT HISTORY TICKET: $auditHistoryTicket");
setState(() { setState(() {
...@@ -244,8 +259,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -244,8 +259,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
} }
} }
Future<void> tapIdle(BuildContext context) async {
Future <void> tapIdle(BuildContext context) async{
var connectivityResult = Connectivity().checkConnectivity(); var connectivityResult = Connectivity().checkConnectivity();
if (connectivityResult == ConnectivityResult.none) { if (connectivityResult == ConnectivityResult.none) {
...@@ -257,7 +271,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -257,7 +271,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
headerAnimationLoop: true, headerAnimationLoop: true,
title: 'Internet Tidak Tersedia', title: 'Internet Tidak Tersedia',
desc: desc:
'Tidak ada koneksi internet. Pastikan Anda terhubung ke internet untuk melanjutkan.', 'Tidak ada koneksi internet. Pastikan Anda terhubung ke internet untuk melanjutkan.',
btnOkOnPress: () { btnOkOnPress: () {
tapIdle(context); tapIdle(context);
}, },
...@@ -279,8 +293,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -279,8 +293,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
if (duration == 0 && !isShowingDialog) { if (duration == 0 && !isShowingDialog) {
isShowingDialog = true; isShowingDialog = true;
timer.cancel(); timer.cancel();
_showTap(context); _showTap(context);
tapDial(context); tapDial(context);
} }
}); });
} }
...@@ -288,6 +302,13 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -288,6 +302,13 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
Future<void> tapDial(BuildContext context) async { Future<void> tapDial(BuildContext context) async {
var connectivityResult = await Connectivity().checkConnectivity(); var connectivityResult = await Connectivity().checkConnectivity();
_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
);
if (connectivityResult == ConnectivityResult.none) { if (connectivityResult == ConnectivityResult.none) {
AwesomeDialog( AwesomeDialog(
context: context, context: context,
...@@ -297,7 +318,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -297,7 +318,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
headerAnimationLoop: true, headerAnimationLoop: true,
title: 'Internet Tidak Tersedia', title: 'Internet Tidak Tersedia',
desc: desc:
'Tidak ada koneksi internet. Pastikan Anda terhubung ke internet untuk melanjutkan.', 'Tidak ada koneksi internet. Pastikan Anda terhubung ke internet untuk melanjutkan.',
btnOkOnPress: () { btnOkOnPress: () {
tapDial(context); tapDial(context);
}, },
...@@ -328,7 +349,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -328,7 +349,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
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 = regExp.hasMatch(appVersion) ? 'assets/wahoo.png' : ''; String imageLogoShowTap =
regExp.hasMatch(appVersion) ? 'assets/wahoo.png' : '';
print('imageLogoShowTap: $imageLogoShowTap'); print('imageLogoShowTap: $imageLogoShowTap');
return imageLogoShowTap; return imageLogoShowTap;
} }
...@@ -344,7 +366,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -344,7 +366,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
} }
Future<void> _showTap(BuildContext context) async { Future<void> _showTap(BuildContext context) async {
String imageLogoShowTap =await _getImageLogoShowTap(); String imageLogoShowTap = await _getImageLogoShowTap();
String selectMode = await _getSelectMode(); String selectMode = await _getSelectMode();
String wordingTap = await _getWordingTap(selectMode); String wordingTap = await _getWordingTap(selectMode);
print('imageLogoShowTap before _showTap: $imageLogoShowTap'); print('imageLogoShowTap before _showTap: $imageLogoShowTap');
...@@ -535,19 +557,36 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -535,19 +557,36 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
void showToastMessage(String message) { void showToastMessage(String message) {
Fluttertoast.showToast( Fluttertoast.showToast(
msg: message, msg: message,
toastLength: Toast.LENGTH_SHORT, // Durasi toast toastLength: Toast.LENGTH_SHORT,
gravity: ToastGravity.BOTTOM, // Posisi toast (dalam hal ini, di bawah) // Durasi toast
timeInSecForIosWeb: 1, // Durasi untuk iOS (dalam detik) gravity: ToastGravity.BOTTOM,
backgroundColor: Colors.grey, // Warna latar belakang toast // Posisi toast (dalam hal ini, di bawah)
timeInSecForIosWeb: 1,
// Durasi untuk iOS (dalam detik)
backgroundColor: Colors.grey,
// Warna latar belakang toast
textColor: Colors.white, // Warna teks textColor: Colors.white, // Warna teks
); );
} }
Future<bool> onWillPop() { Future<bool> onWillPop() {
return Future.value(false); return Future.value(false);
} }
void showShimmerEffect() {
setState(() {
showShimmer = true;
if (timer != null) timer?.cancel();
});
Future.delayed(Duration(seconds: 2), () {
setState(() {
showShimmer = false;
tapIdle(context);
});
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double screenWidth = MediaQuery.of(context).size.width; double screenWidth = MediaQuery.of(context).size.width;
...@@ -568,6 +607,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -568,6 +607,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
body: Stack( body: Stack(
children: [ children: [
SingleChildScrollView( SingleChildScrollView(
controller: _scrollController,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
...@@ -576,26 +616,66 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -576,26 +616,66 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
Column( Column(
children: [ children: [
Container( Container(
width: screenWidth * 0.10, // Container untuk spasi di kiri width: screenWidth *
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: buildWalletSection(), child: showShimmer
? Shimmer(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Colors.white,
veryLightTextColor,
Colors.white,
],
),
child: 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, // Container untuk "balance section" height: screenHeight * 0.70,
child: buildBalanceSection(), // Container untuk "balance section"
child:showShimmer
? Shimmer(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Colors.white,
veryLightTextColor,
Colors.white,// Ivory (Putih Kuning Muda)
],
),
child: buildBalanceSection()
)
: buildBalanceSection(),
), ),
SizedBox(height: 20), 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: buildTicketSection()), child:showShimmer
? Shimmer(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Colors.white,
veryLightTextColor,
Colors.white, // Ivory (Putih Kuning Muda)
],
),
child: buildTicketSection()
)
: buildTicketSection()),
SizedBox(height: 20), SizedBox(height: 20),
], ],
), ),
...@@ -604,19 +684,46 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -604,19 +684,46 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
), ),
Positioned( Positioned(
bottom: 90.0, // Adjust the position as needed bottom: 90.0, // Adjust the position as needed
right: 5.0, // Adjust the position as needed right: 5.0, // Adjust the position as needed
child: FloatingActionButton( child:showShimmer
? Shimmer(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Colors.white,
veryLightTextColor,
Colors.white, // Ivory (Putih Kuning Muda)
],
),
child: FloatingActionButton(
backgroundColor: purpleColor,
onPressed: () {},
child: Icon(
Icons.sync,
color: Colors.white,
),
),
) : FloatingActionButton(
backgroundColor: purpleColor, backgroundColor: purpleColor,
onPressed: () { onPressed: () async {
// Add the action for your floating button // Add the action for your floating button
_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
);
isShowingDialog = true; isShowingDialog = true;
timer?.cancel(); timer?.cancel();
_showTap(context); _showTap(context);
tapDial(context); tapDial(context);
}, },
child: Icon( child: Icon(
Icons.sync, Icons.sync,
color: Colors.white,), color: Colors.white,
),
), ),
), ),
// Positioned( // Positioned(
...@@ -626,33 +733,45 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -626,33 +733,45 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
// onPressed: () { // onPressed: () {
// showToastMessage('Maaf , fitur tidak tersedia'); // showToastMessage('Maaf , fitur tidak tersedia');
//Nyalakan kembali jika dibutuhkan //Nyalakan kembali jika dibutuhkan
// Konversi data ke JSON // Konversi data ke JSON
// String jsonBalance = json.encode(balanceHistoryData); // String jsonBalance = json.encode(balanceHistoryData);
// name; // name;
// cardNumber; // cardNumber;
// cardExpirity; // cardExpirity;
// cardType; // cardType;
// deposit; // deposit;
// balance; // balance;
// Memanggil metode printHistory dengan data yang sudah diperbarui // Memanggil metode printHistory dengan data yang sudah diperbarui
// StartService.printHistory( // StartService.printHistory(
// jsonBalance, // jsonBalance,
// name, // name,
// cardNumber, // cardNumber,
// cardExpirity, // cardExpirity,
// cardType, // cardType,
// deposit, // deposit,
// balance // balance
// ); // );
// }, // },
// child: Icon(Icons.print), // child: Icon(Icons.print),
// ), // ),
// ), // ),
Positioned( Positioned(
bottom: 100.0, // Adjust the position as needed bottom: 100.0, // Adjust the position as needed
right: 14.5, // Adjust the position as needed right: 14.5, // Adjust the position as needed
child: buildTimerSection(context), child:showShimmer
? Shimmer(
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Colors.white,
veryLightTextColor,
Colors.white, // Ivory (Putih Kuning Muda)
],
),
child: buildTimerSection(context)
): buildTimerSection(context),
), ),
], ],
), ),
...@@ -661,89 +780,6 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -661,89 +780,6 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
); );
} }
buildWellcomeCustomer(){
double screenWidth = MediaQuery.of(context).size.width;
double textScaleFactor = screenWidth / 1700;
return Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Halo ${name != null ? '$name' : 'Teman Dolan'}',
style: TextStyle(
fontSize: 26,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.start,
),
Text(
'Selamat datang di mesin point check balance',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
Column(
children: [
ListTile(
title: Text(
(balance != null) ? 'Saldo $balance' : 'Saldo 0',
style: TextStyle(
fontSize: 28 * textScaleFactor,
fontWeight: FontWeight.w500,
),
),
subtitle: Text(
'balance',
style: TextStyle(
fontSize: 15 * textScaleFactor,
fontStyle: FontStyle.italic,
),
),
),
Divider(),
ListTile(
title: Text('Nama/name'),
subtitle: Text((name != null) ? ': $name' : ': -'),
),
ListTile(
title: Text('Nomor Wristband/wristband no'),
subtitle: Text((maskedText != null) ? ': $maskedText' : ': -'),
),
ListTile(
title: Text('Status'),
subtitle: Text((cardType != null) ? ': $cardType' : ': -'),
),
ListTile(
title: Text('Masa Berlaku/expirity'),
subtitle: Text((cardExpirity != null) ? ': $cardExpirity' : ': -'),
),
ListTile(
title: Text('Deposit'),
subtitle: Text((deposit != null) ? ': $deposit' : ': -'),
),
Divider(),
Text(
'Saldo dan deposit wristband bisa dikembalikan di Refund Center',
style: TextStyle(
fontSize: 16 * textScaleFactor,
fontWeight: FontWeight.w500,
),
),
Text(
'Wristband balance and deposit can be returned at the Refund Center',
style: TextStyle(
fontSize: 12 * textScaleFactor,
fontStyle: FontStyle.italic,
),
),
],
),
],
);
}
buildCardInfoSection() { buildCardInfoSection() {
return Center( return Center(
child: Container( child: Container(
...@@ -759,9 +795,11 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -759,9 +795,11 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
SizedBox( SizedBox(
width: 31, width: 31,
), ),
Column( Column(
children: [ children: [
TimerBuilder.periodic(Duration(seconds: 1), builder: (context) { TimerBuilder.periodic(
Duration(seconds: 1),
builder: (context) {
return Row( return Row(
children: [ children: [
Text( Text(
...@@ -775,18 +813,18 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -775,18 +813,18 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
], ],
); );
}, },
),
SizedBox(height: 2),
Text(
"${getDate()}",
style: TextStyle(
color: blackColor,
fontSize: 20,
fontWeight: semiBold,
), ),
SizedBox(height: 2), ),
Text( ],
"${getDate()}", ),
style: TextStyle(
color: blackColor,
fontSize: 20,
fontWeight: semiBold,
),
),
],
),
SizedBox( SizedBox(
width: 31, width: 31,
), ),
...@@ -805,7 +843,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -805,7 +843,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
buildWalletSection() { buildWalletSection() {
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;
double textScaleFactor = screenHeight / 800; double textScaleFactor = screenHeight / 800;
return Center( return Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
...@@ -829,7 +867,9 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -829,7 +867,9 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
letterSpacing: 3, letterSpacing: 3,
), ),
), ),
SizedBox(height: 20,), SizedBox(
height: 20,
),
Container( Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
...@@ -843,7 +883,9 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -843,7 +883,9 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
SizedBox(height: 10,), SizedBox(
height: 10,
),
Text( Text(
(balance != null) ? 'Saldo $balance' : 'Saldo 0', (balance != null) ? 'Saldo $balance' : 'Saldo 0',
style: whiteTextStyle.copyWith( style: whiteTextStyle.copyWith(
...@@ -884,7 +926,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -884,7 +926,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text( Text(
'Nama/name' , 'Nama/name',
style: whiteTextStyle.copyWith( style: whiteTextStyle.copyWith(
fontSize: 20 * textScaleFactor, fontSize: 20 * textScaleFactor,
fontWeight: medium, fontWeight: medium,
...@@ -1017,165 +1059,295 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -1017,165 +1059,295 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
Widget buildBalanceSection() { Widget buildBalanceSection() {
double screenWidth = MediaQuery.of(context).size.width; double screenWidth = MediaQuery.of(context).size.width;
double textScaleFactor = screenWidth / 1700; double textScaleFactor = screenWidth / 1700;
return Visibility( return Container(
visible: balanceHistoryData.isNotEmpty, width: screenWidth * 40,
child: Container( height: 500,
width: screenWidth * 40, padding: EdgeInsets.only(bottom: 20),
height: 500, margin: EdgeInsets.all(20),
padding: EdgeInsets.only(bottom: 20),// child: Column(
margin: EdgeInsets.all(20), // Add margin to the outer Container crossAxisAlignment: CrossAxisAlignment.start,
child: mainAxisAlignment: MainAxisAlignment.start,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, SizedBox(height: 20),
mainAxisAlignment: MainAxisAlignment.start, Center(
children: [ child: Column(
SizedBox(height: 20), children: [
Center( Text(
child: Column( "Riwayat Saldo Wristband",
children: [ style: blackTextStyle.copyWith(
Text( fontSize: 28,
"History Saldo Wristband", fontWeight: medium,
style: blackTextStyle.copyWith( letterSpacing: 3,
fontSize: 28,
fontWeight: medium,
letterSpacing: 3,
),
), ),
Text( ),
'history wristband balance', Text(
style: blackTextStyle.copyWith( 'history wristband balance',
fontSize: 15, style: blackTextStyle.copyWith(
fontWeight: light, fontSize: 15,
fontStyle: FontStyle.italic, fontWeight: light,
letterSpacing: 3, fontStyle: FontStyle.italic,
), letterSpacing: 3,
), ),
], ),
), ],
), ),
SizedBox(height: 20,), ),
Center( SizedBox(
child: Container( height: 20,
height: 80, ),
margin: EdgeInsets.fromLTRB(20, 0, 20, 0), Center(
child: Card( child: Container(
child: Padding( height: 80,
padding: const EdgeInsets.fromLTRB(10,10,10,10), margin: EdgeInsets.fromLTRB(20, 0, 20, 0),
child: Row( child: Card(
children: [ child: Padding(
Expanded( padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Table( child: Row(
children: [ children: [
TableRow( Expanded(
children: [ child: Table(
TableCell(child: Text('Terminal',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center,)), children: [
TableCell(child: Text('Tid',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel pertama// Judul untuk sel pertama TableRow(
TableCell(child: Text('Tipe', style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel kedua children: [
TableCell(child: Text('Tanggal', style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel kedua TableCell(
TableCell(child: Text('Jam', style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel kedua child: Text('Terminal',
TableCell(child: Text('Jumlah',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel kedua style: TextStyle(
TableCell(child: Text('Saldo Akhir',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel kedua fontWeight: FontWeight.bold),
], textAlign: TextAlign.center)),
), TableCell(
TableRow( child: Text('Tid',
children: [ style: TextStyle(
TableCell(child: Text('-',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel pertama fontWeight: FontWeight.bold),
TableCell(child: Text('-',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel pertama textAlign: TextAlign.center)),
TableCell(child: Text('type',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel kedua TableCell(
TableCell(child: Text('date',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel kedua child: Text('Tipe',
TableCell(child: Text('time',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel kedua style: TextStyle(
TableCell(child: Text('amount',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel kedua fontWeight: FontWeight.bold),
TableCell(child: Text('last balance',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel kedua textAlign: TextAlign.center)),
], TableCell(
), child: Text('Tanggal',
], style: TextStyle(
), fontWeight: FontWeight.bold),
textAlign: TextAlign.center)),
TableCell(
child: Text('Jam',
style: TextStyle(
fontWeight: FontWeight.bold),
textAlign: TextAlign.center)),
TableCell(
child: Text('Jumlah',
style: TextStyle(
fontWeight: FontWeight.bold),
textAlign: TextAlign.center)),
TableCell(
child: Text('Saldo Akhir',
style: TextStyle(
fontWeight: FontWeight.bold),
textAlign: TextAlign.center),
),
],
),
TableRow(
children: [
TableCell(
child: Text('-',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
TableCell(
child: Text('-',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
TableCell(
child: Text('type',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
TableCell(
child: Text('date',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
TableCell(
child: Text('time',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
TableCell(
child: Text('amount',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
TableCell(
child: Text('last balance',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center),
),
],
),
],
), ),
], ),
), ],
), ),
), ),
), ),
), ),
Expanded( ),
child: Container( Expanded(
child: Scrollbar( child: Container(
controller: _scrollController, // Use the same ScrollController child: Scrollbar(
thumbVisibility: true, controller: _scrollController,
radius: Radius.circular(6), // Customize the scrollbar appearance thumbVisibility: true,
thickness: 6,// Ensure scrollbar is always shown radius: Radius.circular(6),
child: ListView.builder( thickness: 6,
shrinkWrap: true, // Make sure to set shrinkWrap to true child: balanceHistoryData.isEmpty
itemCount: balanceHistoryData.length, ? Center(
itemBuilder: (context, index) {
final data = balanceHistoryData[index];
int amount = data['amount'];
int lastBalance = data['last_balance'];
String fAmount = NumberFormat.decimalPattern().format(amount);
String fLastBalance = NumberFormat.decimalPattern().format(lastBalance);
String dateTimeString = data['datetime'];
List<String> parts = dateTimeString.split(" ");
String date = parts[0];
String time = parts[1];
String terminalTid = data['terminal'];
String terminalName = data['terminal'];
String tid = "-";
String name = "-";
if (terminalName.length > 4) {
name = terminalName.substring(0, terminalName.length - 5);
} else {
terminalName = "";
}
if (terminalTid.length >= 4) {
tid = terminalTid.substring(terminalTid.length - 4); // Mengambil 4 karakter terakhir
} else {
while (terminalTid.length < 4) {
terminalTid = "0" + terminalTid;
}
}
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Card( child: Card(
margin: EdgeInsets.fromLTRB(20,0,20,12), margin: EdgeInsets.fromLTRB(20, 25, 20, 12),
child: Padding( child: Container(
padding: const EdgeInsets.fromLTRB(20,10,20,10), height: 300,
child: Column( width: double.infinity,
children: [ child: Center(
Row( child: Padding(
padding: const EdgeInsets.all(20),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
// Tengahkan vertikal
children: [ children: [
Expanded( Align(
child: Table( alignment: Alignment.center,
children: [ // Tengahkan horizontal
TableRow( child: Text(
children: [ "ⓘ Tidak ada informasi saldo yang tercatat pada wristband Anda.",
TableCell(child: Text(name,textAlign: TextAlign.center)), style: blackTextStyle.copyWith(
TableCell(child: Text(tid,textAlign: TextAlign.center)), fontSize: 20 * textScaleFactor,
TableCell(child: Text(data['type'],textAlign: TextAlign.center)), fontWeight: bold,
TableCell(child: Text(date,textAlign: TextAlign.center)), letterSpacing: 3),
TableCell(child: Text(time,textAlign: TextAlign.center)), textAlign: TextAlign.center),
TableCell(child: Text(fAmount.toString(),textAlign: TextAlign.center)), ),
TableCell(child: Text(fLastBalance.toString(),textAlign: TextAlign.center)), Align(
], alignment: Alignment.center,
), // Tengahkan horizontal
], child: Text(
), "ⓘ There is no recorded balance information on your wristband.",
style: greyTextStyle.copyWith(
fontSize: 15 * textScaleFactor,
fontWeight: light,
fontStyle: FontStyle.italic,
letterSpacing: 3),
textAlign: TextAlign.center),
), ),
], ],
), ),
], ),
), ),
), ),
), ),
); )
}, : ListView.builder(
), shrinkWrap: true,
), itemCount: balanceHistoryData.length,
itemBuilder: (context, index) {
final data = balanceHistoryData[index];
int amount = data['amount'];
int lastBalance = data['last_balance'];
String fAmount =
NumberFormat.decimalPattern().format(amount);
String fLastBalance =
NumberFormat.decimalPattern().format(lastBalance);
String dateTimeString = data['datetime'];
List<String> parts = dateTimeString.split(" ");
String date = parts[0];
String time = parts[1];
String terminalTid = data['terminal'];
String terminalName = data['terminal'];
String tid = "-";
String name = "-";
if (terminalName.length > 4) {
name = terminalName.substring(
0, terminalName.length - 5);
} else {
terminalName = "";
}
if (terminalTid.length >= 4) {
tid = terminalTid.substring(terminalTid.length - 4);
} else {
while (terminalTid.length < 4) {
terminalTid = "0" + terminalTid;
}
}
return Card(
margin: EdgeInsets.fromLTRB(20, 0, 20, 12),
child: Padding(
padding:
const EdgeInsets.fromLTRB(20, 10, 20, 10),
child: Column(
children: [
Row(
children: [
Expanded(
child: Table(
children: [
TableRow(
children: [
TableCell(
child: Text(name,
textAlign:
TextAlign.center)),
TableCell(
child: Text(tid,
textAlign:
TextAlign.center)),
TableCell(
child: Text(data['type'],
textAlign:
TextAlign.center)),
TableCell(
child: Text(date,
textAlign:
TextAlign.center)),
TableCell(
child: Text(time,
textAlign:
TextAlign.center)),
TableCell(
child: Text(fAmount,
textAlign:
TextAlign.center)),
TableCell(
child: Text(fLastBalance,
textAlign:
TextAlign.center)),
],
),
],
),
),
],
),
],
),
),
);
},
),
), ),
), ),
], ),
), ],
), ),
); );
} }
...@@ -1183,154 +1355,321 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -1183,154 +1355,321 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
Widget buildTicketSection() { Widget buildTicketSection() {
double screenWidth = MediaQuery.of(context).size.width; double screenWidth = MediaQuery.of(context).size.width;
double textScaleFactor = screenWidth / 1700; double textScaleFactor = screenWidth / 1700;
return Visibility( return Container(
visible: ticketHistoryData.isNotEmpty, width: screenWidth * 40,
child: Container( height: 500,
width: screenWidth * 40, margin: EdgeInsets.all(20),
height: 500, padding: EdgeInsets.only(bottom: 20),
margin: EdgeInsets.all(20), // Add margin to the outer Container
padding: EdgeInsets.only(bottom: 20),// Add margin to the outer Container child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, children: [
children: [ Text(
Text( "Riwayat Tiket Wristband",
"History Card Ticket", style: blackTextStyle.copyWith(
style: blackTextStyle.copyWith( fontSize: 28,
fontSize: 28, fontWeight: medium,
fontWeight: medium, letterSpacing: 3,
letterSpacing: 3,
),
), ),
Text( ),
'history card ticket', Text(
style: blackTextStyle.copyWith( 'history wristband ticket',
fontSize: 15, style: blackTextStyle.copyWith(
fontWeight: light, fontSize: 15,
fontStyle: FontStyle.italic, fontWeight: light,
letterSpacing: 3, fontStyle: FontStyle.italic,
), letterSpacing: 3,
), ),
SizedBox(height: 20,), ),
Center( SizedBox(
child: Container( height: 20,
height: 80, ),
margin: EdgeInsets.fromLTRB(20, 0, 20, 0), Center(
child: Card( child: Container(
child: Padding( height: 80,
padding: const EdgeInsets.fromLTRB(10,10,10,10), margin: EdgeInsets.fromLTRB(20, 0, 20, 0),
child: Row( child: Card(
children: [ child: Padding(
Expanded( padding: const EdgeInsets.fromLTRB(10, 10, 10, 10),
child: Table( child: Row(
children: [ children: [
TableRow( Expanded(
children: [ child: Table(
TableCell(child: Text('Terminal',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel pertama children: [
TableCell(child: Text('Tid',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel pertama TableRow(
TableCell(child: Text('Tipe', style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel kedua children: [
TableCell(child: Text('Tanggal', style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel kedua TableCell(
TableCell(child: Text('Jam', style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), child: Text('Terminal',
TableCell(child: Text('Kuantitas',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel kedua style: TextStyle(
TableCell(child: Text('Tiket Akhir',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel kedua fontWeight: FontWeight.bold),
], textAlign: TextAlign.center)),
), // Judul untuk sel pertama
TableRow( TableCell(
children: [ child: Text('Tid',
TableCell(child: Text('-',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel pertama style: TextStyle(
TableCell(child: Text('-',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel pertama fontWeight: FontWeight.bold),
TableCell(child: Text('type',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), textAlign: TextAlign.center)),
TableCell(child: Text('date',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel kedua // Judul untuk sel pertama
TableCell(child: Text('time',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel kedua TableCell(
TableCell(child: Text('quantity',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel kedua child: Text('Tipe',
TableCell(child: Text('last ticket',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel kedua style: TextStyle(
], fontWeight: FontWeight.bold),
), textAlign: TextAlign.center)),
], // Judul untuk sel kedua
), TableCell(
child: Text('Tanggal',
style: TextStyle(
fontWeight: FontWeight.bold),
textAlign: TextAlign.center)),
// Judul untuk sel kedua
TableCell(
child: Text('Jam',
style: TextStyle(
fontWeight: FontWeight.bold),
textAlign: TextAlign.center)),
TableCell(
child: Text('Kuantitas',
style: TextStyle(
fontWeight: FontWeight.bold),
textAlign: TextAlign.center)),
// Judul untuk sel kedua
TableCell(
child: Text('Tiket Akhir',
style: TextStyle(
fontWeight: FontWeight.bold),
textAlign: TextAlign.center)),
// Judul untuk sel kedua
],
),
TableRow(
children: [
TableCell(
child: Text('-',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
// Judul untuk sel pertama
TableCell(
child: Text('-',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
// Judul untuk sel pertama
TableCell(
child: Text('type',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
TableCell(
child: Text('date',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
// Judul untuk sel kedua
TableCell(
child: Text('time',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
// Judul untuk sel kedua
TableCell(
child: Text('quantity',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
// Judul untuk sel kedua
TableCell(
child: Text('last ticket',
style: TextStyle(
fontWeight: light,
fontStyle: FontStyle.italic),
textAlign: TextAlign.center)),
// Judul untuk sel kedua
],
),
],
), ),
], ),
), ],
), ),
), ),
), ),
), ),
Expanded( ),
child: Container( Expanded(
child: child: Container(
Scrollbar( child: Scrollbar(
controller: _scrollController, // Use the same ScrollController controller: _scrollController,
thumbVisibility: true, // Use the same ScrollController
radius: Radius.circular(6), // Customize the scrollbar appearance thumbVisibility: true,
thickness: 6, radius: Radius.circular(6),
child: ListView.builder( // Customize the scrollbar appearance
shrinkWrap: true, // Make sure to set shrinkWrap to true thickness: 6,
itemCount: ticketHistoryData.length, child: ticketHistoryData.isEmpty
itemBuilder: (context, index) { ? Center(
final data = ticketHistoryData[index]; child: Card(
String dateTimeString = data['datetime']; margin: EdgeInsets.fromLTRB(20, 25, 20, 12),
List<String> parts = dateTimeString.split(" "); child: Container(
String date = parts[0]; height: 300,
String time = parts[1]; width: double.infinity,
String terminalTid = data['terminal']; child: Center(
String terminalName = data['terminal']; child: Padding(
String tid = "-"; padding: const EdgeInsets.all(20),
String name = "-"; child: Column(
mainAxisAlignment: MainAxisAlignment.center,
if (terminalName.length > 4) { // Tengahkan vertikal
name = terminalName.substring(0, terminalName.length - 5);
} else {
terminalName = "";
}
if (terminalTid.length >= 4) {
tid = terminalTid.substring(terminalTid.length - 4); // Mengambil 4 karakter terakhir
} else {
while (terminalTid.length < 4) {
terminalTid = "0" + terminalTid;
}
}
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child:
Card(
margin: EdgeInsets.fromLTRB(20,0,20,12),
child: Padding(
padding: const EdgeInsets.fromLTRB(10,10,10,10),
child: Column(
children: [
Row(
children: [ children: [
Expanded( Align(
child: Table( alignment: Alignment.center,
// Tengahkan horizontal
child: Text(
"ⓘ Tidak ada informasi tiket yang tercatat pada wristband Anda.",
style: blackTextStyle.copyWith(
fontSize: 20 * textScaleFactor,
fontWeight: bold,
letterSpacing: 3),
textAlign: TextAlign.center),
),
Align(
alignment: Alignment.center,
// Tengahkan horizontal
child: Text(
"ⓘ There is no recorded ticket information on your wristband.",
style: greyTextStyle.copyWith(
fontSize: 15 * textScaleFactor,
fontWeight: light,
fontStyle: FontStyle.italic,
letterSpacing: 3),
textAlign: TextAlign.center),
),
],
),
),
),
),
),
)
: ListView.builder(
shrinkWrap: true, // Make sure to set shrinkWrap to true
itemCount: ticketHistoryData.length,
itemBuilder: (context, index) {
final data = ticketHistoryData[index];
String dateTimeString = data['datetime'];
List<String> parts = dateTimeString.split(" ");
String date = parts[0];
String time = parts[1];
String terminalTid = data['terminal'];
String terminalName = data['terminal'];
String tid = "-";
String name = "-";
if (terminalName.length > 4) {
name = terminalName.substring(
0, terminalName.length - 5);
} else {
terminalName = "";
}
if (terminalTid.length >= 4) {
tid = terminalTid.substring(terminalTid.length -
4); // Mengambil 4 karakter terakhir
} else {
while (terminalTid.length < 4) {
terminalTid = "0" + terminalTid;
}
}
return SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: ticketHistoryData.isEmpty
? Center(
child: Text(
"Tidak ada histori tiket",
style: blackTextStyle.copyWith(
fontSize: 20,
fontWeight: medium,
letterSpacing: 3,
),
),
)
: Card(
margin: EdgeInsets.fromLTRB(20, 0, 20, 12),
child: Padding(
padding: const EdgeInsets.fromLTRB(
10, 10, 10, 10),
child: Column(
children: [ children: [
TableRow( Row(
children: [ children: [
TableCell(child: Text(name,textAlign: TextAlign.center)), Expanded(
TableCell(child: Text(tid,textAlign: TextAlign.center)), child: Table(
TableCell(child: Text(data['type'],textAlign: TextAlign.center)), children: [
TableCell(child: Text(date,textAlign: TextAlign.center)), TableRow(
TableCell(child: Text(time,textAlign: TextAlign.center)), TableCell(child: Text(data['amount'].toString(),textAlign: TextAlign.center)), children: [
TableCell(child: Text(data['last_balance'].toString(),textAlign: TextAlign.center)), TableCell(
child: Text(name,
textAlign:
TextAlign
.center)),
TableCell(
child: Text(tid,
textAlign:
TextAlign
.center)),
TableCell(
child: Text(
data['type'],
textAlign:
TextAlign
.center)),
TableCell(
child: Text(date,
textAlign:
TextAlign
.center)),
TableCell(
child: Text(time,
textAlign:
TextAlign
.center)),
TableCell(
child: Text(
data['amount']
.toString(),
textAlign:
TextAlign
.center)),
TableCell(
child: Text(
data['last_balance']
.toString(),
textAlign:
TextAlign
.center)),
],
),
],
),
),
], ],
), ),
], ],
), ),
), ),
], ),
), );
], },
), ),
),
),
);
},
),
),
), ),
), ], ),
), ),
],
), ),
); );
} }
...@@ -1374,9 +1713,9 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -1374,9 +1713,9 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
CircularProgressIndicator( CircularProgressIndicator(
strokeWidth: 5, strokeWidth: 5,
value: progressValue, value: progressValue,
valueColor: AlwaysStoppedAnimation<Color>(progressBarColor), valueColor: AlwaysStoppedAnimation<Color>(
progressBarColor),
), ),
], ],
); );
}, },
...@@ -1387,7 +1726,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -1387,7 +1726,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
valueListenable: idleDuration, valueListenable: idleDuration,
builder: (context, value, child) => Text( builder: (context, value, child) => Text(
(value.toInt() % _maxDuration).toString(), (value.toInt() % _maxDuration).toString(),
style: TextStyle(color: darkBackgroundColor,fontSize: 15), style: TextStyle(
color: darkBackgroundColor, fontSize: 15),
), ),
), ),
), ),
...@@ -1412,7 +1752,4 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements ...@@ -1412,7 +1752,4 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
void onPositive(Object object) { void onPositive(Object object) {
// TODO: implement onPositive // TODO: implement onPositive
} }
} }
...@@ -949,6 +949,14 @@ packages: ...@@ -949,6 +949,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.3" version: "1.0.3"
shimmer:
dependency: "direct main"
description:
name: shimmer
sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
simple_animations: simple_animations:
dependency: "direct main" dependency: "direct main"
description: description:
......
...@@ -59,6 +59,7 @@ dependencies: ...@@ -59,6 +59,7 @@ dependencies:
flutter_staggered_grid_view: ^0.6.2 flutter_staggered_grid_view: ^0.6.2
timer_count_down: ^2.2.1 timer_count_down: ^2.2.1
easy_localization: ^3.0.0 easy_localization: ^3.0.0
shimmer: ^3.0.0
sqflite: ^2.2.0+3 sqflite: ^2.2.0+3
device_info_plus: ^8.1.0 device_info_plus: ^8.1.0
lottie: ^2.3.0 lottie: ^2.3.0
......
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