Browse Source

Perubahan fitur Pengaturan login domain/IPport, perbaikan typo tampilan peminjaman, pengembalian, transfer peti, perbaikan loading shimmer, dan perbaikan bug reinit

master
unknown 9 months ago
parent
commit
9451c0dc0b
  1. 31
      lib/connection/connection.dart
  2. 71
      lib/pages/home/home_page.dart
  3. 189
      lib/pages/home/main_page.dart
  4. 4
      lib/pages/pengembalian_barang/index.dart
  5. 55
      lib/pages/sign_in_page.dart
  6. 4
      lib/pages/transfer_peti/index.dart
  7. 300
      lib/widget/loading_shimmer_show.dart

31
lib/connection/connection.dart

@ -1,25 +1,32 @@
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../pages/sign_in_page.dart';
import 'package:path_provider/path_provider.dart';
Future<String> getBaseUrl() async { Future<String> getBaseUrl() async {
try { try {
SharedPreferences prefs = await SharedPreferences.getInstance(); String savedValue = await getSavedValue();
String ipAddress =
prefs.getString('ipAddress') ?? '192.168.1.14'; // Default value // Check if savedValue is a domain, IP with or without port
String port = prefs.getString('port') ?? '8000'; // Default value String baseUrl;
String baseUrl = 'http://$ipAddress:$port/api/v1'; if (savedValue.contains(':')) {
// If savedValue contains a colon, assume it's an IP with port
baseUrl = 'http://$savedValue/api/v1';
} else if (RegExp(r'^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$').hasMatch(savedValue)) {
// If savedValue matches the domain pattern, assume it's a domain
baseUrl = 'https://$savedValue/api/v1';
} else {
// If it doesn't match both patterns, assume it's an IP without port
baseUrl = 'https://$savedValue/api/v1';
}
return baseUrl; return baseUrl;
} catch (e) { } catch (e) {
// Penanganan kesalahan // Error handling
print('Error reading SharedPreferences: $e'); print('Error reading SharedPreferences: $e');
return ''; // Atau nilai default lainnya jika terjadi kesalahan return ''; // Or any other default value in case of an error
} }
} }
// return 'http://$ipAddress:$port/api/v1';
// String baseUrl = 'http://192.168.0.18:8000/api/v1';
// Gunakan fungsi ini saat diperlukan, misalnya di tempat-tempat yang membutuhkan baseUrl
// Contoh penggunaan: String url = await getBaseUrl();

71
lib/pages/home/home_page.dart

@ -30,6 +30,14 @@ import 'controller/home_controller.dart';
class HomePage extends StatefulWidget { class HomePage extends StatefulWidget {
final ControllerHome controllerHome = ControllerHome(); // Declare here final ControllerHome controllerHome = ControllerHome(); // Declare here
final VoidCallback? onReinitStarted;
final VoidCallback? onReinitFinished;
HomePage({
Key? key,
this.onReinitStarted,
this.onReinitFinished,
}) : super(key: key);
@override @override
State<HomePage> createState() => _HomePageState(); State<HomePage> createState() => _HomePageState();
@ -71,10 +79,11 @@ class _HomePageState extends State<HomePage> {
super.initState(); super.initState();
_getUserToken(); _getUserToken();
// Mengatur _isLoading ke true sebelum tugas dimulai // Mengatur _isLoading dan _isFetchingData ke true sebelum tugas dimulai
if (mounted) { if (mounted) {
setState(() { setState(() {
_isLoading = true; _isLoading = true;
_isFetchingData = true;
}); });
} }
@ -100,10 +109,11 @@ class _HomePageState extends State<HomePage> {
initializeDateFormatting('id_ID', null), initializeDateFormatting('id_ID', null),
]); ]);
// Mengatur _isLoading ke false setelah semua tugas selesai // Mengatur _isLoading dan _isFetchingData ke false setelah semua tugas selesai
if (mounted) { if (mounted) {
setState(() { setState(() {
_isLoading = false; _isLoading = false;
_isFetchingData = false;
}); });
} }
} }
@ -262,6 +272,9 @@ class _HomePageState extends State<HomePage> {
_isFetchingData = true; _isFetchingData = true;
}); });
// Callback to inform that Reinit process has started
widget.onReinitStarted?.call();
EasyLoading.show(status: 'Mengambil data dari Server...'); EasyLoading.show(status: 'Mengambil data dari Server...');
try { try {
// Cek koneksi internet // Cek koneksi internet
@ -295,10 +308,61 @@ class _HomePageState extends State<HomePage> {
_isFetchingData = false; _isFetchingData = false;
}); });
EasyLoading.dismiss(); EasyLoading.dismiss();
// Callback to inform that Reinit process has finished
widget.onReinitFinished?.call();
} }
} }
} }
// Future<void> fetchDataFromApiAndSync() async {
// if (_isFetchingData) {
// // Data is already being fetched, don't start another process
// return;
// }
// // Set _isFetchingData to true to disable the button
// setState(() {
// _isFetchingData = true;
// });
// EasyLoading.show(status: 'Mengambil data dari Server...');
// try {
// // Cek koneksi internet
// bool hasInternet = await SyncronizationGlobalData.isInternet();
// if (!hasInternet) {
// EasyLoading.showError('Tidak ada koneksi internet');
// return;
// }
// // Lanjutkan sinkronisasi jika ada koneksi
// await syncToGlobal('Peminjaman');
// await syncToGlobal('Pengembalian');
// await syncToGlobal('Transfer');
// // await reinitAssetStatusApi();
// await reinitWarehouseApi();
// await reinitPetiApi();
// await reinitCustomerApi();
// // await reinitTypePetiApi();
// await reinitConditionPetiApi();
// await datatablesAssetStatusList();
// Navigator.pushNamed(context, '/home');
// EasyLoading.showSuccess('Data berhasil diperbarui');
// } catch (e) {
// EasyLoading.showError('Gagal memperbarui data: $e');
// } finally {
// // Set _isFetchingData back to false when the process finishes
// if (mounted) {
// setState(() {
// _isFetchingData = false;
// });
// EasyLoading.dismiss();
// }
// }
// }
Future syncToGlobal(String type) async { Future syncToGlobal(String type) async {
try { try {
EasyLoading.show( EasyLoading.show(
@ -444,6 +508,7 @@ class _HomePageState extends State<HomePage> {
Widget cardMenuPeminjaman() { Widget cardMenuPeminjaman() {
return Container( return Container(
height: 125, height: 125,
margin: EdgeInsets.only(left: 10),
child: Card( child: Card(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
@ -480,6 +545,7 @@ class _HomePageState extends State<HomePage> {
Widget cardMenuPengembalian() { Widget cardMenuPengembalian() {
return Container( return Container(
height: 125, height: 125,
margin: EdgeInsets.only(right: 10),
child: Card( child: Card(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
@ -516,6 +582,7 @@ class _HomePageState extends State<HomePage> {
Widget cardMenuTransfer() { Widget cardMenuTransfer() {
return Container( return Container(
height: 125, height: 125,
margin: EdgeInsets.only(left: 10),
child: Card( child: Card(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),

189
lib/pages/home/main_page.dart

@ -1,8 +1,87 @@
// import 'package:flutter/material.dart';
// import 'package:provider/provider.dart';
// import '../../providers/auth_provider.dart';
// import 'home_page.dart';
// import 'setting_page.dart';
// class MainPage extends StatefulWidget {
// @override
// State<MainPage> createState() => _MainPageState();
// }
// class _MainPageState extends State<MainPage> {
// int currentIndex = 0;
// bool isReinitInProgress = false;
// @override
// Widget build(BuildContext context) {
// AuthProvider authProvider = Provider.of<AuthProvider>(context);
// Widget customBottomNav() {
// return ClipRRect(
// // borderRadius: BorderRadius.only(
// // topLeft: Radius.circular(20.0),
// // topRight: Radius.circular(20.0),
// // ),
// child: BottomNavigationBar(
// type: BottomNavigationBarType.fixed,
// currentIndex: currentIndex,
// selectedItemColor: Colors.indigoAccent, // Warna saat dipilih
// onTap: (index) {
// if (mounted) {
// setState(() {
// currentIndex = index;
// });
// }
// },
// items: [
// BottomNavigationBarItem(
// icon: Icon(Icons.home),
// label: 'Beranda',
// ),
// BottomNavigationBarItem(
// icon: Icon(Icons.settings),
// label: 'Pengaturan',
// ),
// ],
// ),
// );
// }
// Widget body() {
// switch (currentIndex) {
// case 0:
// return HomePage();
// case 1:
// // Return your MapsPage here
// return SettingPage(); // Ganti dengan MapsPage
// default:
// return Container(); // Add more cases if needed
// }
// }
// return Scaffold(
// backgroundColor: currentIndex == 0
// ? Color.fromRGBO(255, 255, 255, 0.973)
// : Colors.grey,
// bottomNavigationBar: customBottomNav(),
// body: Stack(
// children: [
// body(),
// ],
// ),
// // extendBody: true, // Membuat latar belakang menembus hingga ke bawah
// );
// }
// }
// main_page.dart
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../providers/auth_provider.dart'; import '../../providers/auth_provider.dart';
import 'home_page.dart'; import 'home_page.dart';
import '../peminjaman_barang/peminjaman_stock_page.dart';
import 'setting_page.dart'; import 'setting_page.dart';
class MainPage extends StatefulWidget { class MainPage extends StatefulWidget {
@ -12,67 +91,38 @@ class MainPage extends StatefulWidget {
class _MainPageState extends State<MainPage> { class _MainPageState extends State<MainPage> {
int currentIndex = 0; int currentIndex = 0;
bool isReinitInProgress = false;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AuthProvider authProvider = Provider.of<AuthProvider>(context); AuthProvider authProvider = Provider.of<AuthProvider>(context);
Widget customBottomNav() { Widget customBottomNav() {
return ClipRRect( return AbsorbPointer(
// borderRadius: BorderRadius.only( absorbing: isReinitInProgress,
// topLeft: Radius.circular(20.0), child: ClipRRect(
// topRight: Radius.circular(20.0), child: BottomNavigationBar(
// ), type: BottomNavigationBarType.fixed,
child: BottomNavigationBar( currentIndex: currentIndex,
type: BottomNavigationBarType.fixed, selectedItemColor: Colors.indigoAccent,
currentIndex: currentIndex, onTap: (index) {
selectedItemColor: Colors.indigoAccent, // Warna saat dipilih if (!isReinitInProgress) {
onTap: (index) { setState(() {
if (mounted) { currentIndex = index;
setState(() { });
currentIndex = index; }
}); },
} items: [
}, BottomNavigationBarItem(
items: [ icon: Icon(Icons.home),
BottomNavigationBarItem( label: 'Beranda',
icon: Icon(Icons.home), ),
label: 'Beranda', BottomNavigationBarItem(
), icon: Icon(Icons.settings),
// BottomNavigationBarItem( label: 'Pengaturan',
// icon: Icon(Icons.assignment_return), ),
// label: 'Return', ],
// ), ),
// BottomNavigationBarItem(
// icon: GestureDetector(
// onTap: () {
// setState(() {
// currentIndex = 2;
// });
// },
// child: Container(
// width: 60.0,
// height: 60.0,
// decoration: BoxDecoration(
// color: Colors.indigoAccent,
// shape: BoxShape.circle,
// ),
// child: Center(
// child: Icon(Icons.qr_code, size: 30.0, color: Colors.white),
// ),
// ),
// ),
// label: '', // Menghilangkan teks label
// ),
// BottomNavigationBarItem(
// icon: Icon(Icons.markunread_mailbox),
// label: 'Receive',
// ),
BottomNavigationBarItem(
icon: Icon(Icons.settings),
label: 'Pengaturan',
),
],
), ),
); );
} }
@ -80,21 +130,21 @@ class _MainPageState extends State<MainPage> {
Widget body() { Widget body() {
switch (currentIndex) { switch (currentIndex) {
case 0: case 0:
return HomePage(); return HomePage(onReinitStarted: () {
// Callback untuk memberi tahu bahwa Reinit dimulai
setState(() {
isReinitInProgress = true;
});
}, onReinitFinished: () {
// Callback untuk memberi tahu bahwa Reinit selesai
setState(() {
isReinitInProgress = false;
});
});
case 1: case 1:
// Return your MapsPage here return SettingPage();
return SettingPage(); // Ganti dengan MapsPage
// case 2:
// // Add your QR Code page here
// return Placeholder(); // Ganti dengan halaman QR Code
// case 3:
// // Return your HistoryPage here
// return Placeholder(); // Ganti dengan HistoryPage
// case 4:
// // Return your ProfilePage here
// return SettingPage(); // Ganti dengan ProfilePage
default: default:
return Container(); // Add more cases if needed return Container();
} }
} }
@ -108,7 +158,6 @@ class _MainPageState extends State<MainPage> {
body(), body(),
], ],
), ),
// extendBody: true, // Membuat latar belakang menembus hingga ke bawah
); );
} }
} }

4
lib/pages/pengembalian_barang/index.dart

@ -319,7 +319,7 @@ class PengembalianBarangPageState extends State<PengembalianBarangPage> {
itemCount: itemCount:
4, // Set the number of shimmer cards based on your data count 4, // Set the number of shimmer cards based on your data count
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ShimmerLoadingAssetStatusCard(); return ShimmerLoadingAssetStatusPengembalianCard();
}, },
), ),
), ),
@ -693,7 +693,7 @@ class AssetStatusCard extends StatelessWidget {
_buildInfoRow( _buildInfoRow(
'Gudang:', 'Gudang:',
'${warehouseSqfliteApi?.name ?? '-'}', '${warehouseSqfliteApi?.name ?? '-'}',
'Kondisi Barang', 'Kondisi Barang:',
'${conditionPetiSqfliteApi?.nama_kondisi ?? '-'}', '${conditionPetiSqfliteApi?.nama_kondisi ?? '-'}',
13), 13),
], ],

55
lib/pages/sign_in_page.dart

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter/services.dart';
import 'package:siopas/theme.dart'; import 'package:siopas/theme.dart';
@ -357,24 +358,19 @@ class SettingsModal extends StatefulWidget {
} }
class _SettingsModalState extends State<SettingsModal> { class _SettingsModalState extends State<SettingsModal> {
TextEditingController ipAddressController = TextEditingController(); TextEditingController inputController = TextEditingController();
TextEditingController portController = TextEditingController();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
// Load saved IP Address and Port when the modal is initialized // Load saved IP Address or Port when the modal is initialized
loadSettings(); loadSettings();
} }
void loadSettings() async { void loadSettings() async {
SharedPreferences prefs = await SharedPreferences.getInstance(); String savedValue = await getSavedValue();
String ipAddress = prefs.getString('ipAddress') ?? '';
String port = prefs.getString('port') ?? '';
setState(() { setState(() {
ipAddressController.text = ipAddress; inputController.text = savedValue;
portController.text = port;
}); });
} }
@ -397,23 +393,20 @@ class _SettingsModalState extends State<SettingsModal> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
TextFormField( TextFormField(
controller: ipAddressController, controller: inputController,
keyboardType: TextInputType.number, // Set numeric keyboard inputFormatters: [
decoration: InputDecoration(labelText: 'IP Address'), FilteringTextInputFormatter.allow(
), RegExp(r'[a-zA-Z0-9@#$%^&*()_+={}|\[\]\\:;"<>,.?/~`-]'))
SizedBox(height: 16), ],
TextFormField( decoration: InputDecoration(labelText: 'Domain atau IP:Port'),
controller: portController,
keyboardType: TextInputType.number, // Set numeric keyboard
decoration: InputDecoration(labelText: 'Port'),
), ),
], ],
), ),
actions: [ actions: [
ElevatedButton( ElevatedButton(
onPressed: () { onPressed: () {
// Save IP Address and Port to SharedPreferences // Save value to SharedPreferences
saveSettings(ipAddressController.text, portController.text); saveSettings(inputController.text);
Navigator.of(context).pop(); // Close the modal Navigator.of(context).pop(); // Close the modal
}, },
child: Text('Simpan'), child: Text('Simpan'),
@ -422,21 +415,23 @@ class _SettingsModalState extends State<SettingsModal> {
); );
} }
void saveSettings(String ipAddress, String port) async { Future<void> saveSettings(String value) async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString('ipAddress', ipAddress); prefs.setString('savedValue', value);
prefs.setString('port', port);
// Print the saved data // Print the saved data
print('IP Address saved: $ipAddress'); print('Value saved: $value');
print('Port saved: $port');
} }
// Function to clear the IP Address and Port in SharedPreferences Future<void> clearSettings() async {
void clearSettings() async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.remove('ipAddress'); prefs.remove('savedValue');
prefs.remove('port'); print('Value cleared');
print('IP Address and Port cleared');
} }
} }
Future<String> getSavedValue() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String savedValue = prefs.getString('savedValue') ?? '';
return savedValue;
}

4
lib/pages/transfer_peti/index.dart

@ -267,7 +267,7 @@ class TransferPetiPageState extends State<TransferPetiPage> {
itemCount: itemCount:
4, // Set the number of shimmer cards based on your data count 4, // Set the number of shimmer cards based on your data count
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ShimmerLoadingAssetStatusCard(); return ShimmerLoadingAssetStatusTransferPetiCard();
}, },
), ),
), ),
@ -634,7 +634,7 @@ class TransferPetiCard extends StatelessWidget {
_buildInfoRow( _buildInfoRow(
'Asal Gudang:', 'Asal Gudang:',
'${warehouseSqfliteApi?.name ?? '-'}', '${warehouseSqfliteApi?.name ?? '-'}',
'Tujuan Gudang', 'Tujuan Gudang:',
'${warehouseTujuanSqfliteApi?.name ?? '-'}', '${warehouseTujuanSqfliteApi?.name ?? '-'}',
13), 13),
], ],

300
lib/widget/loading_shimmer_show.dart

@ -137,9 +137,307 @@ class ShimmerLoadingAssetStatusCard extends StatelessWidget {
children: [ children: [
_buildAvatarAndIndex(), _buildAvatarAndIndex(),
Divider(), Divider(),
_buildInfoRow('Nama Peminjam:', '', 'PIC:', '', 11.5), _buildInfoRow('Nama Customer:', '', 'PIC/PJ:', '', 11.5),
_buildInfoRow('Tanggal Peminjaman:', '', _buildInfoRow('Tanggal Peminjaman:', '',
'Estimasi Pengembalian:', '', 11.5), 'Estimasi Pengembalian:', '', 11.5),
_buildInfoRow('Gudang:', '', '', '', 11.5),
],
),
),
),
),
],
);
}
Widget _buildAvatarAndIndex() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildAvatar(),
Expanded(
child: Padding(
padding: const EdgeInsets.only(
left: 8.0,
top: 8.0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Text(
// '',
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 11.5,
// ),
// ),
lineDivider(),
],
),
),
),
],
);
}
Widget lineDivider() {
return Container(
height: 13,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey[500],
borderRadius: BorderRadius.vertical(
top: Radius.circular(6), // Adjust top radius as needed
bottom: Radius.circular(6), // Adjust bottom radius as needed
),
),
);
}
Widget _buildAvatar() {
return Container(
child: CircleAvatar(
radius: 11,
backgroundColor: Colors.indigo,
),
);
}
Widget _buildInfoRow(String title1, String content1, String title2,
String content2, double fontSize) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title1,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: fontSize,
),
),
SizedBox(height: 3),
lineDivider(),
// Text(
// content1,
// style: TextStyle(
// fontSize: fontSize - 0.5,
// ),
// ),
],
),
),
SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// lineDivider(),
Text(
title2,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: fontSize,
),
),
SizedBox(height: 3),
lineDivider()
// Text(
// content2,
// style: TextStyle(
// fontSize: fontSize - 0.5,
// ),
// ),
],
),
),
],
);
}
}
class ShimmerLoadingAssetStatusPengembalianCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
children: [
Card(
elevation: 0.0,
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.grey, width: 1.0),
// borderRadius: BorderRadius.circular(10),
),
child: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Padding(
padding: const EdgeInsets.only(
top: 8.0,
bottom: 8.0,
left: 16.0,
right: 16.0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildAvatarAndIndex(),
Divider(),
_buildInfoRow(
'PIC/PJ:', '', 'Tanggal Pengembalian:', '', 11.5),
_buildInfoRow('Gudang:', '', 'Kondisi Barang:', '', 11.5),
],
),
),
),
),
],
);
}
Widget _buildAvatarAndIndex() {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildAvatar(),
Expanded(
child: Padding(
padding: const EdgeInsets.only(
left: 8.0,
top: 8.0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Text(
// '',
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: 11.5,
// ),
// ),
lineDivider(),
],
),
),
),
],
);
}
Widget lineDivider() {
return Container(
height: 13,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey[500],
borderRadius: BorderRadius.vertical(
top: Radius.circular(6), // Adjust top radius as needed
bottom: Radius.circular(6), // Adjust bottom radius as needed
),
),
);
}
Widget _buildAvatar() {
return Container(
child: CircleAvatar(
radius: 11,
backgroundColor: Colors.indigo,
),
);
}
Widget _buildInfoRow(String title1, String content1, String title2,
String content2, double fontSize) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title1,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: fontSize,
),
),
SizedBox(height: 3),
lineDivider(),
// Text(
// content1,
// style: TextStyle(
// fontSize: fontSize - 0.5,
// ),
// ),
],
),
),
SizedBox(width: 10),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// lineDivider(),
Text(
title2,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: fontSize,
),
),
SizedBox(height: 3),
lineDivider()
// Text(
// content2,
// style: TextStyle(
// fontSize: fontSize - 0.5,
// ),
// ),
],
),
),
],
);
}
}
class ShimmerLoadingAssetStatusTransferPetiCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Column(
children: [
Card(
elevation: 0.0,
shape: RoundedRectangleBorder(
side: BorderSide(color: Colors.grey, width: 1.0),
// borderRadius: BorderRadius.circular(10),
),
child: Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Padding(
padding: const EdgeInsets.only(
top: 8.0,
bottom: 8.0,
left: 16.0,
right: 16.0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildAvatarAndIndex(),
Divider(),
_buildInfoRow(
'Nama Customer:', '', 'Tanggal Transfer Peti:', '', 11.5),
_buildInfoRow('Asal Gudang:', '', 'Tujuan Gudang:', '', 11.5), _buildInfoRow('Asal Gudang:', '', 'Tujuan Gudang:', '', 11.5),
], ],
), ),

Loading…
Cancel
Save