Commit 965e5fff authored by Faizol's avatar Faizol

fixing ui

parent af2930c1
......@@ -18,11 +18,16 @@ This project is a starting point for a Flutter application.
** Added Card history endpoint ticket & balance ✅
** Added UI Card history endpoint ticket & balance ✅
** Adjust Ui check balance ✅
** Added function print card history
** Added Ui print card history
** Added function print card history
** Added Ui print card history
** Update mifare mdd lib to version version: 0.1.42 ✅
** Disable print history ✅
** Update version ✅
## Version App Change Log SS.23.2.WWW.SB.PC
## Version Code 17
## Version Code 17 (actual)
** remove icon printer ✅
** change icon reload ✅
** add datetime in history saldo & ticket ✅
** add scrollable effect to table history ✅
\ No newline at end of file
sdk.dir=C:\\Users\\MDD HP\\AndroidSDK
flutter.sdk=C:\\Users\\MDD HP\\flutter
flutter.buildMode=debug
flutter.versionName=SS.23.2.WWW.SB.PC
flutter.versionCode=17
\ No newline at end of file
flutter.versionName=1.0.0
flutter.versionCode=1
\ No newline at end of file
......@@ -11,6 +11,12 @@ Color blueColor = const Color(0xff53c1f9);
Color purpleColor = const Color(0xff5142E6);
Color greenColor = const Color(0xff22B07D);
//Pallet timer
Color color1 = const Color(0xffFFCD4B);
Color color2 = const Color(0xff3876BF);
Color color3 = const Color(0xffDA0C81);
Color color4 = const Color(0xffE95793);
//Background color
Color lightBackgroundColor = const Color(0xffF6F8FB);
Color darkBackgroundColor = const Color(0xff020518);
......
......@@ -47,6 +47,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
int _activeContainerIndex = 1;
List<Map<String, dynamic>> balanceHistoryData = [];
List<Map<String, dynamic>> ticketHistoryData = [];
ScrollController _scrollController = ScrollController();
@override
void initState() {
......@@ -99,28 +101,29 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
return DateFormat('dd-MMM-yyyy').format(nowt);
}
_getInfoCard(var info, BuildContext context) {
setState((){
if (info.toString().toLowerCase().contains('failed')) {
print('ini pesan salah');
void _getInfoCard(var info, BuildContext context) async {
try {
if (info == null) {
print('Data tidak ditemukan');
return;
}
if (info.toString().toLowerCase().contains('card not found')) {
message = "Silakan Tempel Wristband Anda Di Reader";
tapDial(context);
if (timer != null) timer?.cancel();
// tapIdle();
} else {
infoCard = info;
var infoMap = jsonDecode(info);
if (infoMap["cardType"] != null) {
switch (infoMap["cardType"]) {
case 1:
// Perubahan cardType 1 baru menjadi
cardType = "Kartu Belum Aktif";
break;
case 2:
// Perubahan cardType 2 Belum aktif menjadi
cardType = "Kartu Aktif";
break;
case 3:
// Perubahan cardType 3 aktif menjadi
cardType = "Binding Customer";
break;
case 4:
......@@ -133,67 +136,116 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
cardType = "Tidak Terdaftar";
break;
}
} else {
cardType = "Tidak Terdaftar";
}
if (infoMap["balance"] != null) {
balance = CurrencyFormat.convertToIdr(
infoMap["balance"],
2,
);
// NOTE merubah tanggal
var change = DateTime.fromMillisecondsSinceEpoch(
int.parse(infoMap['cardExpirity']) * 1000);
}
if (infoMap["cardExpirity"] != null) {
var cardExpiryMillis = int.parse(infoMap['cardExpirity']) * 1000;
var change = DateTime.fromMillisecondsSinceEpoch(cardExpiryMillis);
final DateFormat formatter = DateFormat('dd-MMM-yyyy');
cardExpirity = formatter.format(change);
deposit = CurrencyFormat.convertToIdr(infoMap["deposit"], 2,);
}
if (infoMap["deposit"] != null) {
deposit = CurrencyFormat.convertToIdr(infoMap["deposit"], 2);
}
if (infoMap["cardNumber"] != null) {
cardNumber = infoMap["cardNumber"];
String cardNo = cardNumber.toString();
String targetMasked = cardNo.substring(0, 12);
maskedText = cardNo.replaceAll(targetMasked, '************');
}
if (infoMap["name"] != null) {
name = infoMap["name"].toString().split("-")[0];
}
if (infoMap["cardUid"] != null) {
cardUid = infoMap["cardUid"];
regDb= infoMap["regDb"];
}
if (infoMap["regDb"] != null) {
regDb = infoMap["regDb"];
await _getAuditHistoryBalance(cardUid, regDb);
await _getAuditHistoryTicket(cardUid, regDb);
}
setState(() {
isShowingDialog = false;
isDenomDialogShowing = false;
checkCountZero = false;
});
tapIdle(context);
Navigator.pop(context);
}
} catch (e) {
// Tangani kesalahan saat memproses data
print("Kesalahan saat memproses data: $e");
// Lakukan sesuatu untuk menangani kesalahan ini, seperti menampilkan pesan kesalahan kepada pengguna.
}
}
Future<void> getAuditHistoryBalance(String cardUid, String regDb) async {
Future<void> _getAuditHistoryBalance(String cardUid, String regDb) async {
try {
var auditHistoryBalance = await ServiceApi.fetchAuditHistory(cardUid, regDb, "balance");
print("AUDIT HISTORY BALANCE: $auditHistoryBalance");
setState(() {
balanceHistoryData.clear();
// Your data is already a Map, so you don't need to decode it
if (auditHistoryBalance != null) {
List<dynamic> dataBalance = auditHistoryBalance['data'];
// Tambahkan data dari respons ke dalam balanceHistoryData
for (var itemBalance in dataBalance) {
// print("isi dari $item");
balanceHistoryData.add(itemBalance);
}
balanceHistoryData = balanceHistoryData.reversed.toList();
balanceHistoryData = balanceHistoryData.reversed.toList();
}
});
} catch (error) {
setState(() {
print("AUDIT BALANCE ERROR: $error");
});
}
}
Future<void> getAuditHistoryTicket(String cardUid, String regDb) async {
Future<void> _getAuditHistoryTicket(String cardUid, String regDb) async {
try {
var auditHistoryTicket = await ServiceApi.fetchAuditHistory(cardUid, regDb, "ticket");
print("AUDIT HISTORY TICKET: $auditHistoryTicket");
setState(() {
ticketHistoryData.clear();
if (auditHistoryTicket != null) {
List<dynamic> dataTicket = auditHistoryTicket['data'];
for (var itemTicket in dataTicket) {
ticketHistoryData.add(itemTicket);
}
ticketHistoryData = ticketHistoryData.reversed.toList();
}
});
} catch (error) {
setState(() {
print("AUDIT TICKET ERROR: $error");
});
}
}
void tapIdle(BuildContext context) {
Future <void> tapIdle(BuildContext context) async{
var connectivityResult = Connectivity().checkConnectivity();
if (connectivityResult == ConnectivityResult.none) {
......@@ -233,7 +285,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
});
}
void tapDial(BuildContext context) async {
Future<void> tapDial(BuildContext context) async {
var connectivityResult = await Connectivity().checkConnectivity();
if (connectivityResult == ConnectivityResult.none) {
......@@ -258,15 +310,6 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
var isTap = await StartService.getCard();
try {
_getInfoCard(isTap, context);
await Future.wait([
getAuditHistoryTicket(cardUid, regDb),
getAuditHistoryBalance(cardUid, regDb),
]);
isShowingDialog = false;
isDenomDialogShowing = false;
checkCountZero = false;
tapIdle(context);
Navigator.pop(context);
} catch (e) {
print("Error $isTap");
tapDial(context);
......@@ -533,7 +576,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
Column(
children: [
Container(
width: screenWidth * 0.01, // Container untuk spasi di kiri
width: screenWidth * 0.10, // Container untuk spasi di kiri
),
Container(
width: screenWidth * 0.70,
......@@ -541,14 +584,18 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
child: buildWalletSection(),
),
Container(
margin: EdgeInsets.fromLTRB(0,0,0,0 ),
margin: EdgeInsets.fromLTRB(30,0,0,0 ),
width: screenWidth * 0.95,
height: screenHeight * 0.70, // Container untuk "balance section"
child: buildBalanceSection(),
),
SizedBox(height: 20),
SizedBox(height: 20),
buildTicketSection(),
Container(
margin: EdgeInsets.fromLTRB(30,0,0,0 ),
width: screenWidth * 0.95,
height: screenHeight * 0.70,
child: buildTicketSection()),
SizedBox(height: 20),
],
),
......@@ -556,9 +603,10 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
),
),
Positioned(
bottom: 20.0, // Adjust the position as needed
right: 20.0, // Adjust the position as needed
bottom: 90.0, // Adjust the position as needed
right: 5.0, // Adjust the position as needed
child: FloatingActionButton(
backgroundColor: purpleColor,
onPressed: () {
// Add the action for your floating button
isShowingDialog = true;
......@@ -566,15 +614,17 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
_showTap(context);
tapDial(context);
},
child: Icon(Icons.search),
child: Icon(
Icons.sync,
color: Colors.white,),
),
),
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');
// 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
......@@ -595,13 +645,13 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
// deposit,
// balance
// );
},
child: Icon(Icons.print),
),
),
// },
// child: Icon(Icons.print),
// ),
// ),
Positioned(
bottom: 120.0, // Adjust the position as needed
right: 30.0, // Adjust the position as needed
bottom: 100.0, // Adjust the position as needed
right: 14.5, // Adjust the position as needed
child: buildTimerSection(context),
),
],
......@@ -970,7 +1020,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
return Visibility(
visible: balanceHistoryData.isNotEmpty,
child: Container(
width: screenWidth ,
width: screenWidth * 40,
height: 500,
padding: EdgeInsets.only(bottom: 20),//
margin: EdgeInsets.all(20), // Add margin to the outer Container
......@@ -1018,18 +1068,24 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
children: [
TableRow(
children: [
TableCell(child: Text('Terminal',style: TextStyle(fontWeight: FontWeight.bold),)), // Judul untuk sel pertama
TableCell(child: Text('Tipe', style: TextStyle(fontWeight: FontWeight.bold))), // Judul untuk sel kedua
TableCell(child: Text('Jumlah',style: TextStyle(fontWeight: FontWeight.bold))), // Judul untuk sel kedua
TableCell(child: Text('Saldo Akhir',style: TextStyle(fontWeight: FontWeight.bold))), // Judul untuk sel kedua
TableCell(child: Text('Terminal',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center,)),
TableCell(child: Text('Tid',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel pertama// Judul untuk sel pertama
TableCell(child: Text('Tipe', 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)), // Judul untuk sel kedua
TableCell(child: Text('Jumlah',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel kedua
TableCell(child: Text('Saldo 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))), // Judul untuk sel pertama
TableCell(child: Text('type',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic))), // Judul untuk sel kedua
TableCell(child: Text('amount',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic))), // Judul untuk sel kedua
TableCell(child: Text('last balance',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic))), // Judul untuk sel kedua
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)), // Judul untuk sel kedua
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('amount',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel kedua
TableCell(child: Text('last balance',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic),textAlign: TextAlign.center)), // Judul untuk sel kedua
],
),
],
......@@ -1043,8 +1099,12 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
),
Expanded(
child: Container(
child:
ListView.builder(
child: Scrollbar(
controller: _scrollController, // Use the same ScrollController
thumbVisibility: true,
radius: Radius.circular(6), // Customize the scrollbar appearance
thickness: 6,// Ensure scrollbar is always shown
child: ListView.builder(
shrinkWrap: true, // Make sure to set shrinkWrap to true
itemCount: balanceHistoryData.length,
itemBuilder: (context, index) {
......@@ -1053,10 +1113,31 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
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),
child: Padding(
padding: const EdgeInsets.fromLTRB(20,10,20,10),
......@@ -1069,10 +1150,13 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
children: [
TableRow(
children: [
TableCell(child: Text(data['terminal'])),
TableCell(child: Text(data['type'])),
TableCell(child: Text(fAmount.toString())),
TableCell(child: Text(fLastBalance.toString())),
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.toString(),textAlign: TextAlign.center)),
TableCell(child: Text(fLastBalance.toString(),textAlign: TextAlign.center)),
],
),
],
......@@ -1089,6 +1173,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
),
),
),
),
],
),
),
......@@ -1098,10 +1183,8 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
Widget buildTicketSection() {
double screenWidth = MediaQuery.of(context).size.width;
double textScaleFactor = screenWidth / 1700;
return Visibility(
visible: ticketHistoryData.isNotEmpty,
child: SingleChildScrollView(
child: Container(
width: screenWidth * 40,
height: 500,
......@@ -1135,7 +1218,7 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
margin: EdgeInsets.fromLTRB(20, 0, 20, 0),
child: Card(
child: Padding(
padding: const EdgeInsets.fromLTRB(20,10,20,10),
padding: const EdgeInsets.fromLTRB(10,10,10,10),
child: Row(
children: [
Expanded(
......@@ -1143,18 +1226,24 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
children: [
TableRow(
children: [
TableCell(child: Text('Terminal',style: TextStyle(fontWeight: FontWeight.bold),)), // Judul untuk sel pertama
TableCell(child: Text('Tipe', style: TextStyle(fontWeight: FontWeight.bold))), // Judul untuk sel kedua
TableCell(child: Text('Kuantitas',style: TextStyle(fontWeight: FontWeight.bold))), // Judul untuk sel kedua
TableCell(child: Text('Tiket Akhir',style: TextStyle(fontWeight: FontWeight.bold))), // Judul untuk sel kedua
TableCell(child: Text('Terminal',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel pertama
TableCell(child: Text('Tid',style: TextStyle(fontWeight: FontWeight.bold),textAlign: TextAlign.center)), // Judul untuk sel pertama
TableCell(child: Text('Tipe', 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))), // Judul untuk sel pertama
TableCell(child: Text('type',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic))), // Judul untuk sel kedua
TableCell(child: Text('quantity',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic))), // Judul untuk sel kedua
TableCell(child: Text('last ticket',style: TextStyle(fontWeight: light , fontStyle: FontStyle.italic))), // Judul untuk sel kedua
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
],
),
],
......@@ -1169,11 +1258,38 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
Expanded(
child: Container(
child:
ListView.builder(
Scrollbar(
controller: _scrollController, // Use the same ScrollController
thumbVisibility: true,
radius: Radius.circular(6), // Customize the scrollbar appearance
thickness: 6,
child: 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:
......@@ -1190,10 +1306,12 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
children: [
TableRow(
children: [
TableCell(child: Text(data['terminal'])),
TableCell(child: Text(data['type'])),
TableCell(child: Text(data['amount'].toString())),
TableCell(child: Text(data['last_balance'].toString())),
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)),
],
),
],
......@@ -1210,15 +1328,14 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
},
),
),
), ],
),
), ],
),
),
);
}
buildTimerSection(BuildContext context) {
return Container(
height: 80,
margin: const EdgeInsets.only(
......@@ -1239,23 +1356,38 @@ class _HomePageCheckBalanceState extends State<HomePageCheckBalance> implements
children: [
ValueListenableBuilder(
valueListenable: idleDuration,
builder: (context, value, child) =>
builder: (context, value, child) {
Color progressBarColor;
double progressValue = value / _maxDuration;
if (progressValue < 0.25) {
progressBarColor = color4;
} else if (progressValue < 0.5) {
progressBarColor = color3;
} else {
progressBarColor = blueColor;
}
return Stack(
alignment: Alignment.center,
children: [
CircularProgressIndicator(
strokeWidth: 5,
value: value / _maxDuration,
// Menggunakan nilai langsung dari value
valueColor:
AlwaysStoppedAnimation<Color>(Colors.blue),
value: progressValue,
valueColor: AlwaysStoppedAnimation<Color>(progressBarColor),
),
],
);
},
),
RotatedBox(
quarterTurns: 4, // Menggunakan nilai bulat dari value
quarterTurns: 4,
child: ValueListenableBuilder(
valueListenable: idleDuration,
builder: (context, value, child) => Text(
(value.toInt() % _maxDuration).toString(),
// Menggunakan nilai bulat dari value
style: TextStyle(fontSize: 19),
style: TextStyle(color: darkBackgroundColor,fontSize: 15),
),
),
),
......
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