feat: Implement initial filtering for agent search from the home screen, enable footer navigation, and add provider stability checks.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shimmer/shimmer.dart';
|
||||
import 'package:real_estate_mobile/core/utils/image_url_resolver.dart';
|
||||
|
||||
/// Displays an image from an S3 key or full URL.
|
||||
@@ -9,6 +10,7 @@ class S3Image extends StatefulWidget {
|
||||
final double? width;
|
||||
final double? height;
|
||||
final BoxFit fit;
|
||||
final Alignment alignment;
|
||||
final Widget Function(BuildContext context)? placeholder;
|
||||
final Widget Function(BuildContext context)? errorWidget;
|
||||
|
||||
@@ -18,6 +20,7 @@ class S3Image extends StatefulWidget {
|
||||
this.width,
|
||||
this.height,
|
||||
this.fit = BoxFit.cover,
|
||||
this.alignment = Alignment.center,
|
||||
this.placeholder,
|
||||
this.errorWidget,
|
||||
});
|
||||
@@ -67,15 +70,22 @@ class _S3ImageState extends State<S3Image> {
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildPlaceholder(BuildContext context) {
|
||||
return widget.placeholder?.call(context) ?? Container(
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
color: const Color(0xFFC4D9D4),
|
||||
child: const Center(child: CircularProgressIndicator(strokeWidth: 2)),
|
||||
Widget _buildShimmerPlaceholder() {
|
||||
return Shimmer.fromColors(
|
||||
baseColor: const Color(0xFFE0E0E0),
|
||||
highlightColor: const Color(0xFFF5F5F5),
|
||||
child: Container(
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
color: Colors.white,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildPlaceholder(BuildContext context) {
|
||||
return widget.placeholder?.call(context) ?? _buildShimmerPlaceholder();
|
||||
}
|
||||
|
||||
Widget _buildError(BuildContext context) {
|
||||
return widget.errorWidget?.call(context) ?? Container(
|
||||
width: widget.width,
|
||||
@@ -95,6 +105,7 @@ class _S3ImageState extends State<S3Image> {
|
||||
width: widget.width,
|
||||
height: widget.height,
|
||||
fit: widget.fit,
|
||||
alignment: widget.alignment,
|
||||
placeholder: (ctx, _) => _buildPlaceholder(ctx),
|
||||
errorWidget: (ctx, _, __) => _buildError(ctx),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user