improvements.

main_design2.0
Sikander Saleem 2 years ago
parent de2b6e1265
commit 34bae463b6

@ -33,14 +33,14 @@ class AllRequestsProvider extends ChangeNotifier {
getCloseRequests();
}
Future<int> getAllRequests() async {
Future<int> getAllRequests({int typeTransaction}) async {
if (isAllLoading == true) return -2;
isAllLoading = true;
if (allRequestsAndCount == null) notifyListeners();
Response response;
try {
Map<String, dynamic> body = {
"typeTransaction": [1, 2, 3, 4],
"typeTransaction": typeTransaction == null ? [1, 2, 3, 4] : [typeTransaction],
"statusTransaction": [1, 2, 3],
"priority": [0, 1],
"displayData": []

@ -44,7 +44,7 @@ class _WeeklyFragmentState extends State<WeeklyFragment> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: const EdgeInsets.only(left: 16,right: 16),
padding: const EdgeInsets.only(left: 16, right: 16),
child: Consumer<AllRequestsProvider>(builder: (context, snapshot, _) {
return Column(
mainAxisSize: MainAxisSize.min,
@ -108,11 +108,11 @@ class _WeeklyFragmentState extends State<WeeklyFragment> {
return isServiceRequest
? ServiceRequestItemView(list[index], showShadow: false)
: isGasRefill
? GasRefillItemView(list[index])
? GasRefillItemView(list[index], showShadow: false)
: isPPMs
? PpmItemView(list[index])
? PpmItemView(list[index], showShadow: false)
: isAssetTransfer
? AssetItemView(list[index])
? AssetItemView(list[index], showShadow: false)
: Container(
height: 100,
width: double.infinity,

@ -50,8 +50,8 @@ class _LandPageState extends State<LandPage> {
DashboardPage(onDrawerPress: (() {
_scaffoldKey.currentState.isDrawerOpen ? _scaffoldKey.currentState.closeDrawer() : _scaffoldKey.currentState.openDrawer();
})),
// old_page.LandPage(),
MyRequestsPage(),
old_page.LandPage(),
// MyRequestsPage(),
SingleDevicePicker(),
if (_userProvider.user.type == UsersTypes.engineer) CalendarPage(),
MyRequestsPage(),

@ -14,7 +14,7 @@ class AssetItemView extends StatelessWidget {
final RequestsDetails request;
final bool showShadow;
const AssetItemView(this.request, {Key key, this.showShadow = false}) : super(key: key);
const AssetItemView(this.request, {Key key, this.showShadow = true}) : super(key: key);
@override
Widget build(BuildContext context) {

@ -13,7 +13,7 @@ class GasRefillItemView extends StatelessWidget {
final RequestsDetails request;
final bool showShadow;
const GasRefillItemView(this.request, {Key key, this.showShadow = false}) : super(key: key);
const GasRefillItemView(this.request, {Key key, this.showShadow = true}) : super(key: key);
@override
Widget build(BuildContext context) {

@ -16,7 +16,7 @@ class PpmItemView extends StatelessWidget {
final RequestsDetails request;
final bool showShadow;
const PpmItemView(this.request, {Key key, this.showShadow = false}) : super(key: key);
const PpmItemView(this.request, {Key key, this.showShadow = true}) : super(key: key);
@override
Widget build(BuildContext context) {

@ -12,7 +12,7 @@ class ServiceRequestItemView extends StatelessWidget {
final RequestsDetails request;
final bool showShadow;
const ServiceRequestItemView(this.request, {Key key, this.showShadow = false}) : super(key: key);
const ServiceRequestItemView(this.request, {Key key, this.showShadow = true}) : super(key: key);
@override
Widget build(BuildContext context) {

@ -161,35 +161,38 @@ class _SingleDevicePickerState extends State<SingleDevicePicker> {
await _devicesProvider.getDevicesList(
user: _userProvider.user, host: _settingProvider.host, hospitalId: _userProvider.user.clientId, serialNumber: snController.text, number: numberController.text);
},
child: showListView
? ListView.separated(
padding: const EdgeInsets.all(16),
itemCount: _searchableList.length,
separatorBuilder: (listContext, itemIndex) => 8.height,
itemBuilder: (listContext, itemIndex) {
return AssetItemListView(
device: _searchableList[itemIndex],
onPressed: (device) {
Navigator.of(context).pop(device);
},
);
},
)
: GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 191 / 261, crossAxisSpacing: 16, mainAxisSpacing: 16),
itemCount: _searchableList.length,
padding: const EdgeInsets.all(16),
itemBuilder: (context, index) {
return AssetItemGridView(
device: _searchableList[index],
onPressed: (device) {
Navigator.of(context).pushNamed(AssetDetailPage.id, arguments: device.id);
return;
Navigator.of(context).pop(device);
},
);
},
),
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 500),
child: showListView
? ListView.separated(
padding: const EdgeInsets.all(16),
itemCount: _searchableList.length,
separatorBuilder: (listContext, itemIndex) => 8.height,
itemBuilder: (listContext, itemIndex) {
return AssetItemListView(
device: _searchableList[itemIndex],
onPressed: (device) {
Navigator.of(context).pop(device);
},
);
},
)
: GridView.builder(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 191 / 261, crossAxisSpacing: 16, mainAxisSpacing: 16),
itemCount: _searchableList.length,
padding: const EdgeInsets.all(16),
itemBuilder: (context, index) {
return AssetItemGridView(
device: _searchableList[index],
onPressed: (device) {
Navigator.of(context).pushNamed(AssetDetailPage.id, arguments: device.id);
return;
Navigator.of(context).pop(device);
},
);
},
),
),
)),
],
),

@ -88,7 +88,7 @@ class ServiceRequestItem extends StatelessWidget {
],
),
],
).paddingAll(16).onPress(() {
).onPress(() {
onPressed(request);
}).toShadowContainer(context),
],

Loading…
Cancel
Save