pagination added

main_production_asset_tracking
WaseemAbbasi22 2 weeks ago
parent 0dc3eee22b
commit b018e7a420

@ -42,7 +42,7 @@ class AssetTrackingListItemView extends StatelessWidget {
arrowMsg: isGridView ? "" : "View on map",
),
if (isGridView) ...[
4.height,
5.height,
InfoTextWidget(
label: "View on map",
value: '',

@ -192,18 +192,13 @@ class _AssetTrackingPageState extends State<AssetTrackingPage> with SingleTicker
padding: const EdgeInsets.all(16),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
childAspectRatio: 1.2, // need to fix this it's not flexiable with content..
childAspectRatio: 1.1, // need to fix this it's not flexiable with content..
crossAxisSpacing: 12,
mainAxisSpacing: 12,
),
itemCount: provider.isLoading ? 6 : provider.assetsList.length,
// separatorBuilder: (listContext, itemIndex) => 12.height,
itemBuilder: (listContext, itemIndex) {
if (provider.isLoading) return const SizedBox().toAssetListShimmer(listContext, provider.isLoading);
// Calculate staggered animation delay
final delay = itemIndex * 0.08;
final animation = Tween<double>(begin: 0.0, end: 1.0).animate(
CurvedAnimation(

@ -74,7 +74,7 @@ class AssetTrackingProvider extends ChangeNotifier {
assetsList = responseAssetList;
// assetInventoryResponse = newResponse;
}
final int totalRows = (jsonData["totalRows"] as int?) ?? assetsList.length;
final int totalRows = (jsonData["totalRows"] as int?) ?? assetsList.length;
nextPage = (assetsList.length) < totalRows;
} else {
if (loadMore) pageNo -= 1;

Loading…
Cancel
Save