const constructure
This commit is contained in:
@@ -22,7 +22,7 @@ class SyncPage extends StatefulWidget implements AutoRouteWrapper {
|
||||
|
||||
@override
|
||||
Widget wrappedRoute(BuildContext context) => BlocProvider(
|
||||
create: (context) => getIt<SyncBloc>()..add(SyncEvent.startSync()),
|
||||
create: (context) => getIt<SyncBloc>()..add(const SyncEvent.startSync()),
|
||||
child: this,
|
||||
);
|
||||
}
|
||||
@@ -35,7 +35,7 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
|
||||
void initState() {
|
||||
super.initState();
|
||||
_animationController = AnimationController(
|
||||
duration: Duration(milliseconds: 500),
|
||||
duration: const Duration(milliseconds: 500),
|
||||
vsync: this,
|
||||
);
|
||||
_progressAnimation = Tween<double>(begin: 0.0, end: 1.0).animate(
|
||||
@@ -66,7 +66,7 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
|
||||
|
||||
// Tunggu sebentar lalu pindah ke dashboard
|
||||
Future.delayed(const Duration(seconds: 2), () {
|
||||
context.router.replace(MainRoute());
|
||||
context.router.replace(const MainRoute());
|
||||
});
|
||||
}
|
||||
// Kalau error
|
||||
@@ -76,7 +76,7 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
|
||||
},
|
||||
builder: (context, state) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 32, vertical: 16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 32, vertical: 16),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -85,13 +85,13 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
_buildHeader(),
|
||||
SizedBox(height: 20),
|
||||
const SizedBox(height: 20),
|
||||
_buildActions(state),
|
||||
],
|
||||
),
|
||||
),
|
||||
SpaceWidth(40),
|
||||
SizedBox(width: 40),
|
||||
const SpaceWidth(40),
|
||||
const SizedBox(width: 40),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: SizedBox(
|
||||
@@ -119,7 +119,7 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
|
||||
}
|
||||
|
||||
// Kondisi default: initial
|
||||
return SyncInitialWidget();
|
||||
return const SyncInitialWidget();
|
||||
},
|
||||
),
|
||||
),
|
||||
@@ -138,7 +138,7 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.error_outline, size: 48, color: Colors.red.shade400),
|
||||
SizedBox(height: 12),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
'Sinkronisasi Gagal',
|
||||
style: TextStyle(
|
||||
@@ -147,9 +147,9 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
|
||||
color: Colors.red.shade600,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
Container(
|
||||
padding: EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red.shade50,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@@ -160,7 +160,7 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
'Periksa koneksi internet dan coba lagi',
|
||||
style: TextStyle(fontSize: 12, color: Colors.grey.shade600),
|
||||
@@ -180,9 +180,9 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
|
||||
color: AppColor.primary.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Icon(Icons.sync, size: 30, color: AppColor.primary),
|
||||
child: const Icon(Icons.sync, size: 30, color: AppColor.primary),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
'Sinkronisasi Data',
|
||||
style: TextStyle(
|
||||
@@ -191,7 +191,7 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
|
||||
color: Colors.grey.shade800,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'Mengunduh kategori dan produk terbaru',
|
||||
style: TextStyle(fontSize: 16, color: Colors.grey.shade600),
|
||||
@@ -215,7 +215,7 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
|
||||
if (state.stats != null && state.errorMessage == null) {
|
||||
return AppElevatedButton.filled(
|
||||
onPressed: () {
|
||||
context.router.replace(MainRoute());
|
||||
context.router.replace(const MainRoute());
|
||||
},
|
||||
label: 'Lanjutkan ke Aplikasi',
|
||||
);
|
||||
@@ -228,7 +228,7 @@ class _SyncPageState extends State<SyncPage> with TickerProviderStateMixin {
|
||||
Expanded(
|
||||
child: AppElevatedButton.outlined(
|
||||
onPressed: () {
|
||||
context.router.replace(MainRoute());
|
||||
context.router.replace(const MainRoute());
|
||||
},
|
||||
label: 'Lewati',
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user