QueenFruits/Mobile Operasional/lib/features/customer/presentation/widgets/edit_customer_shimmer.dart

129 lines
4.6 KiB
Dart

import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
import 'package:sizer/sizer.dart';
class EditCustomerShimmer extends StatelessWidget {
const EditCustomerShimmer({super.key});
@override
Widget build(BuildContext context) {
return Shimmer.fromColors(
baseColor: Colors.grey.shade300,
highlightColor: Colors.grey.shade100,
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: Column(
children: [
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: 3.h),
child: Column(
children: [
Container(
width: 24.w,
height: 24.w,
decoration: const BoxDecoration(
color: Colors.white,
shape: BoxShape.circle,
),
),
SizedBox(height: 2.h),
Container(
width: 40.w,
height: 3.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4.5.w),
),
),
],
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 5.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: List.generate(
3,
(index) => Padding(
padding: EdgeInsets.only(bottom: 2.h),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 30.w,
height: 1.5.h,
color: Colors.white,
),
SizedBox(height: 1.h),
Container(
width: double.infinity,
height: 7.h,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(2.5.w),
),
),
],
),
),
),
),
),
_buildSectionLabelShimmer("Alamat Pelanggan"),
SizedBox(
height: 20.h,
child: ListView.builder(
scrollDirection: Axis.horizontal,
padding: EdgeInsets.only(left: 5.w),
itemCount: 2,
itemBuilder: (_, __) => Container(
width: 75.w,
margin: EdgeInsets.only(right: 3.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(2.5.w),
),
),
),
),
_buildSectionLabelShimmer("Aktivitas Pelanggan"),
Column(
children: List.generate(
2,
(index) => Container(
height: 12.h,
margin: EdgeInsets.fromLTRB(5.w, 0, 5.w, 1.5.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(2.5.w),
),
),
),
),
],
),
),
),
],
),
);
}
Widget _buildSectionLabelShimmer(String title) {
return Padding(
padding: EdgeInsets.fromLTRB(5.w, 3.h, 5.w, 1.5.h),
child: Align(
alignment: Alignment.centerLeft,
child: Container(width: 40.w, height: 2.h, color: Colors.white),
),
);
}
}