feat: draw page

This commit is contained in:
efrilm
2025-09-05 02:53:03 +07:00
parent 37b22fe662
commit e4af5f10d7
7 changed files with 1856 additions and 119 deletions
@@ -1,7 +1,10 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
import 'dart:math' as math;
import '../../../common/theme/theme.dart';
import '../assets/assets.gen.dart';
part 'image_placeholder.dart';
part 'network_image.dart';
@@ -0,0 +1,61 @@
part of 'image.dart';
class AppNetworkImage extends StatelessWidget {
final String? url;
final double? height;
final double? width;
final double? borderRadius;
final BoxFit? fit;
final bool? isCanZoom;
final VoidCallback? onTap;
const AppNetworkImage({
super.key,
this.url,
this.height,
this.width,
this.borderRadius = 0,
this.fit = BoxFit.cover,
this.isCanZoom = false,
this.onTap,
});
@override
Widget build(BuildContext context) {
Widget customPhoto(
double? heightx,
double? widthx,
BoxFit? fitx,
double? radius,
) {
return CachedNetworkImage(
imageUrl: url.toString(),
placeholder: (context, url) => Shimmer.fromColors(
baseColor: Colors.grey[300]!,
highlightColor: Colors.grey[100]!,
child: Container(
height: height,
width: width,
decoration: BoxDecoration(
color: Colors.grey.shade300,
borderRadius: BorderRadius.circular(radius ?? 0),
),
),
),
errorWidget: (context, url, error) =>
ImagePlaceholder(height: height, width: width),
height: heightx,
width: widthx,
fit: fitx,
);
}
return GestureDetector(
onTap: onTap,
child: ClipRRect(
borderRadius: BorderRadius.circular(borderRadius!),
child: customPhoto(height, width, BoxFit.fill, borderRadius),
),
);
}
}