QOL: Data display load Mzansi Direct pt2
This commit is contained in:
parent
456dff6402
commit
a6d5e4ad35
6 changed files with 119 additions and 57 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
|
|
@ -58,13 +59,32 @@ class _BuildBusinessSearchResultsListState
|
|||
// vertical: 5,
|
||||
horizontal: 25,
|
||||
),
|
||||
child: MihBusinessProfilePreview(
|
||||
business: widget.businessList[index],
|
||||
imageFile: directoryProvider.busSearchImages![
|
||||
widget.businessList[index].business_id],
|
||||
loading: false,
|
||||
//To Do
|
||||
),
|
||||
child: FutureBuilder(
|
||||
future: directoryProvider.busSearchImagesUrl![
|
||||
widget.businessList[index].business_id],
|
||||
builder: (context, asyncSnapshot) {
|
||||
ImageProvider<Object>? imageFile;
|
||||
bool loading = true;
|
||||
if (asyncSnapshot.connectionState ==
|
||||
ConnectionState.done) {
|
||||
loading = false;
|
||||
if (asyncSnapshot.hasData) {
|
||||
imageFile = asyncSnapshot.requireData != ""
|
||||
? CachedNetworkImageProvider(
|
||||
asyncSnapshot.requireData)
|
||||
: null;
|
||||
} else {
|
||||
imageFile = null;
|
||||
}
|
||||
} else {
|
||||
imageFile = null;
|
||||
}
|
||||
return MihBusinessProfilePreview(
|
||||
business: widget.businessList[index],
|
||||
imageFile: imageFile,
|
||||
loading: loading,
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/main.dart';
|
||||
|
|
@ -57,11 +58,32 @@ class _BuildUserSearchResultsListState
|
|||
// vertical: 5,
|
||||
horizontal: 25,
|
||||
),
|
||||
child: MihPersonalProfilePreview(
|
||||
user: widget.userList[index],
|
||||
imageFile: directoryProvider
|
||||
.userSearchImages![widget.userList[index].app_id],
|
||||
),
|
||||
child: FutureBuilder(
|
||||
future: directoryProvider
|
||||
.userSearchImagesUrl![widget.userList[index].app_id],
|
||||
builder: (context, asyncSnapshot) {
|
||||
ImageProvider<Object>? imageFile;
|
||||
bool loading = true;
|
||||
if (asyncSnapshot.connectionState ==
|
||||
ConnectionState.done) {
|
||||
loading = false;
|
||||
if (asyncSnapshot.hasData) {
|
||||
imageFile = asyncSnapshot.requireData != ""
|
||||
? CachedNetworkImageProvider(
|
||||
asyncSnapshot.requireData)
|
||||
: null;
|
||||
} else {
|
||||
imageFile = null;
|
||||
}
|
||||
} else {
|
||||
imageFile = null;
|
||||
}
|
||||
return MihPersonalProfilePreview(
|
||||
user: widget.userList[index],
|
||||
imageFile: imageFile,
|
||||
loading: loading,
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue