feat: Account page ui done
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import '../../../../food_delivery_client.dart';
|
||||
|
||||
class WCachedNetworkImage extends StatelessWidget {
|
||||
const WCachedNetworkImage({
|
||||
super.key,
|
||||
this.borderRadius,
|
||||
required this.imageUrl,
|
||||
this.height,
|
||||
this.width,
|
||||
this.fit,
|
||||
});
|
||||
|
||||
final BorderRadius? borderRadius;
|
||||
final String imageUrl;
|
||||
final double? height;
|
||||
final double? width;
|
||||
final BoxFit? fit;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ClipRRect(
|
||||
borderRadius: borderRadius ?? AppUtils.kBorderRadius20,
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: imageUrl,
|
||||
height: height ?? 155,
|
||||
width: width ?? context.w,
|
||||
fit: fit ?? BoxFit.cover,
|
||||
errorWidget: (context, url, error) =>
|
||||
const Center(child: Icon(Icons.error, color: AppColors.cRed)),
|
||||
placeholder: (context, url) => Skeletonizer(
|
||||
enabled: true,
|
||||
child: Container(
|
||||
height: height ?? 150,
|
||||
width: width ?? context.w,
|
||||
color: AppColors.cE6E6E6,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import 'dart:ui';
|
||||
|
||||
import 'package:flutter_bounceable/flutter_bounceable.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:food_delivery_client/feature/common/presentation/widgets/w_cached_network_image.dart';
|
||||
|
||||
import '../../../../food_delivery_client.dart';
|
||||
|
||||
@@ -41,16 +42,19 @@ class WFoodItem extends StatelessWidget {
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: AppLocaleKeys.imageUrl,
|
||||
width: 200,
|
||||
height: 155,
|
||||
fit: BoxFit.cover,
|
||||
placeholder: (context, url) =>
|
||||
Center(child: CircularProgressIndicator.adaptive()),
|
||||
errorWidget: (context, url, error) => Icon(Icons.error),
|
||||
),
|
||||
child: WCachedNetworkImage(imageUrl: AppLocaleKeys.imageUrl),
|
||||
),
|
||||
// Positioned.fill(
|
||||
// child: CachedNetworkImage(
|
||||
// imageUrl: AppLocaleKeys.imageUrl,
|
||||
// width: 200,
|
||||
// height: 155,
|
||||
// fit: BoxFit.cover,
|
||||
// placeholder: (context, url) =>
|
||||
// Center(child: CircularProgressIndicator.adaptive()),
|
||||
// errorWidget: (context, url, error) => Icon(Icons.error),
|
||||
// ),
|
||||
// ),
|
||||
Positioned(
|
||||
top: 10,
|
||||
right: 8,
|
||||
|
||||
Reference in New Issue
Block a user