|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_layout_grid/flutter_layout_grid.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/api/my_attendance_api_client.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/classes/colors.dart';
|
|
|
|
|
import 'package:mohem_flutter_app/classes/utils.dart';
|
|
|
|
@ -22,7 +23,8 @@ class DynamicListViewParams {
|
|
|
|
|
List<CollectionNotificationEit>? collectionNotificationList;
|
|
|
|
|
final String selectedEmp;
|
|
|
|
|
|
|
|
|
|
DynamicListViewParams(this.title, this.dynamicId, {this.selectedEmp ='', this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = '', this.isUpdate = false, this.collectionNotificationList});
|
|
|
|
|
DynamicListViewParams(this.title, this.dynamicId,
|
|
|
|
|
{this.selectedEmp = '', this.uRL = 'GET_EIT_DFF_STRUCTURE', this.requestID = '', this.colsURL = '', this.isUpdate = false, this.collectionNotificationList});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class DynamicListViewScreen extends StatefulWidget {
|
|
|
|
@ -37,6 +39,7 @@ class DynamicListViewScreen extends StatefulWidget {
|
|
|
|
|
class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
|
|
|
|
|
List<GetEITTransactionList>? getEITTransactionList;
|
|
|
|
|
DynamicListViewParams? dynamicParams;
|
|
|
|
|
|
|
|
|
|
// String? empId;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@ -99,47 +102,19 @@ class _DynamicListViewScreenState extends State<DynamicListViewScreen> {
|
|
|
|
|
: ListView.separated(
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
itemBuilder: (cxt, int parentIndex) => getEITTransactionList![parentIndex].collectionTransaction!.isEmpty
|
|
|
|
|
? const SizedBox()
|
|
|
|
|
: GridView(
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 1.0 / 0.75),
|
|
|
|
|
padding: const EdgeInsets.only(left: 12,right: 21,top: 12),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
primary: false,
|
|
|
|
|
physics: const ScrollPhysics(),
|
|
|
|
|
children: getEITWidgetsList(getEITTransactionList![parentIndex].collectionTransaction),
|
|
|
|
|
).objectContainerView(),
|
|
|
|
|
// Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
// children: [
|
|
|
|
|
// for (int t = 0; t < (getEITTransactionList![parentIndex].collectionTransaction ?? []).length; t++)
|
|
|
|
|
// if (getEITTransactionList![parentIndex].collectionTransaction![t].dISPLAYFLAG == "Y")
|
|
|
|
|
// // ItemDetailView(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!,
|
|
|
|
|
// // getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
|
|
|
|
|
// // GridView(
|
|
|
|
|
// // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
|
|
|
|
|
// // padding: const EdgeInsets.only(left: 21, right: 21, bottom: 21, top: 12),
|
|
|
|
|
// // shrinkWrap: true,
|
|
|
|
|
// // primary: false,
|
|
|
|
|
// // physics: const ScrollPhysics(),
|
|
|
|
|
// // children: getEITWidgetsList(getEITTransactionList![parentIndex].collectionTransaction),
|
|
|
|
|
// // )
|
|
|
|
|
// // ItemDetailViewCol(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!,
|
|
|
|
|
// // getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
|
|
|
|
|
//
|
|
|
|
|
// // GridView(
|
|
|
|
|
// // gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
|
|
|
|
|
// // padding: const EdgeInsets.only(left: 21, right: 21, bottom: 21, top: 12),
|
|
|
|
|
// // shrinkWrap: true,
|
|
|
|
|
// // primary: false,
|
|
|
|
|
// // physics: const ScrollPhysics(),
|
|
|
|
|
// // children: getEITWidgetsList(getEITTransactionList![parentIndex].collectionTransaction),
|
|
|
|
|
// // )
|
|
|
|
|
// // ItemDetailView(getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTPROMPT!,
|
|
|
|
|
// // getEITTransactionList![parentIndex].collectionTransaction![t].sEGMENTVALUEDSP ?? ""),
|
|
|
|
|
// ],
|
|
|
|
|
// ).objectContainerView(),
|
|
|
|
|
itemBuilder: (cxt, int parentIndex) {
|
|
|
|
|
if (getEITTransactionList![parentIndex].collectionTransaction!.isEmpty) {
|
|
|
|
|
return const SizedBox();
|
|
|
|
|
}
|
|
|
|
|
int count = getEITTransactionList![parentIndex].collectionTransaction!.length;
|
|
|
|
|
return LayoutGrid(
|
|
|
|
|
columnSizes: [1.fr, 1.fr],
|
|
|
|
|
rowSizes: [for (int i = 0; i < (count / 2).round(); i++) auto],
|
|
|
|
|
columnGap: 8,
|
|
|
|
|
rowGap: 12,
|
|
|
|
|
children: getEITWidgetsList(getEITTransactionList![parentIndex].collectionTransaction),
|
|
|
|
|
).objectContainerView();
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (cxt, index) => 12.height,
|
|
|
|
|
itemCount: getEITTransactionList!.length)),
|
|
|
|
|
],
|
|
|
|
|