This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:tm_app/view_models/ai_recommendations_view_model.dart';
|
||||
|
||||
import '../strings/tenders_strings.dart';
|
||||
import 'main_tenders_slider.dart';
|
||||
import 'tender_card_shimmer.dart';
|
||||
|
||||
/// The "Recommended" tab body. Handles loading, empty/"still learning",
|
||||
/// error+retry and the recommended tender list for [AiRecommendationsViewModel].
|
||||
@@ -34,7 +35,7 @@ class _RecommendedTendersViewState extends State<RecommendedTendersView> {
|
||||
return Consumer<AiRecommendationsViewModel>(
|
||||
builder: (context, vm, child) {
|
||||
if (vm.isLoading) {
|
||||
return const _LoadingSkeleton();
|
||||
return _LoadingSkeleton(isDesktop: widget.isDesktop);
|
||||
}
|
||||
if (vm.errorMessage != null) {
|
||||
return _MessageState(
|
||||
@@ -152,23 +153,18 @@ class _MessageState extends StatelessWidget {
|
||||
|
||||
/// Simple placeholder list shown while recommendations load.
|
||||
class _LoadingSkeleton extends StatelessWidget {
|
||||
const _LoadingSkeleton();
|
||||
const _LoadingSkeleton({required this.isDesktop});
|
||||
|
||||
final bool isDesktop;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.separated(
|
||||
padding: EdgeInsets.all(16.0.h()),
|
||||
itemCount: 4,
|
||||
separatorBuilder: (_, __) => SizedBox(height: 12.0.h()),
|
||||
itemBuilder:
|
||||
(context, index) => Container(
|
||||
height: 120.0.h(),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.grey0,
|
||||
borderRadius: BorderRadius.circular(12.0.w()),
|
||||
border: Border.all(color: AppColors.grey30),
|
||||
),
|
||||
),
|
||||
itemCount: isDesktop ? 3 : 2,
|
||||
separatorBuilder:
|
||||
(_, __) => SizedBox(height: isDesktop ? 20.0.h() : 52.0.h()),
|
||||
itemBuilder: (context, index) => TenderCardShimmer(isDesktop: isDesktop),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user