|
|
|
|
@ -1,121 +1,15 @@
|
|
|
|
|
//older code....
|
|
|
|
|
// import 'package:flutter/material.dart';
|
|
|
|
|
// import 'package:provider/provider.dart';
|
|
|
|
|
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
|
|
|
// import 'package:test_sa/controllers/providers/api/all_requests_provider.dart';
|
|
|
|
|
// import 'package:test_sa/controllers/providers/api/notifications_provider.dart';
|
|
|
|
|
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
|
|
|
// import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
|
// import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
|
// import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
|
// import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
// import 'package:test_sa/models/enums/user_types.dart';
|
|
|
|
|
// import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
// import 'package:test_sa/new_views/common_widgets/app_floating_action_button.dart';
|
|
|
|
|
// import 'package:test_sa/new_views/pages/land_page/requests_list_page.dart';
|
|
|
|
|
//
|
|
|
|
|
// class RequestsFragment extends StatelessWidget {
|
|
|
|
|
// const RequestsFragment({Key key}) : super(key: key);
|
|
|
|
|
//
|
|
|
|
|
// @override
|
|
|
|
|
// Widget build(BuildContext context) {
|
|
|
|
|
// return Scaffold(
|
|
|
|
|
// // todo check here, nurse can add request not engineer
|
|
|
|
|
// floatingActionButton: const AppFloatingActionButton(),
|
|
|
|
|
// body: Consumer<AllRequestsProvider>(
|
|
|
|
|
// builder: (context, snapshot, _) => RefreshIndicator(
|
|
|
|
|
// onRefresh: () {
|
|
|
|
|
// snapshot.getRequests();
|
|
|
|
|
// Provider.of<NotificationsProvider>(context, listen: false).getSystemNotifications(user: Provider.of<UserProvider>(context, listen: false).user, resetProvider: true);
|
|
|
|
|
// return Future.delayed(const Duration(microseconds: 250));
|
|
|
|
|
// },
|
|
|
|
|
// child: GridView(
|
|
|
|
|
// padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
|
|
|
|
|
// gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 191 / 237, crossAxisSpacing: 16, mainAxisSpacing: 16),
|
|
|
|
|
// children: [
|
|
|
|
|
// listItem(
|
|
|
|
|
// snapshot.highPriorityRequests?.total?.count,
|
|
|
|
|
// "high_priority",
|
|
|
|
|
// context.translation.highPriority,
|
|
|
|
|
// context,
|
|
|
|
|
// snapshot.isHighPriorityLoading,
|
|
|
|
|
// 0,
|
|
|
|
|
// context.isDark ? AppColor.redStatus(context) : AppColor.red50,
|
|
|
|
|
// ),
|
|
|
|
|
// listItem(snapshot.overdueRequests?.total?.count, "overdue", context.translation.overdue, context, snapshot.isOverdueLoading, 1, AppColor.yellowStatus(context)),
|
|
|
|
|
// listItem(snapshot.openRequests?.total?.count, "new_request", ApiManager.instance.user.type == UsersTypes.engineer ? context.translation.inProgress : context.translation.newR, context,
|
|
|
|
|
// snapshot.isOpenLoading, 2, AppColor.primary40),
|
|
|
|
|
// listItem(snapshot.completedRequests?.total?.count, "complete_request", context.translation.completed, context, snapshot.isCompleteLoading, 3, AppColor.greenStatus(context)),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// Widget listItem(int value, String icon, String title, BuildContext context, bool isLoading, int index, Color iconColor) {
|
|
|
|
|
// return Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Row(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Text(
|
|
|
|
|
// value?.toString() ?? "-",
|
|
|
|
|
// style: AppTextStyles.heading1.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50, height: 1),
|
|
|
|
|
// ).toShimmer(isShow: isLoading).expanded,
|
|
|
|
|
// 8.width,
|
|
|
|
|
// (icon ?? "").toSvgAsset(height: 48, width: 48, color: iconColor)?.toShimmer(isShow: isLoading),
|
|
|
|
|
// ],
|
|
|
|
|
// ).expanded,
|
|
|
|
|
// Text(
|
|
|
|
|
// "$title\n${context.translation.requests}",
|
|
|
|
|
// style: AppTextStyles.heading5.copyWith(
|
|
|
|
|
// color: context.isDark ? AppColor.neutral30 : AppColor.neutral50,
|
|
|
|
|
// ),
|
|
|
|
|
// ).toShimmer(isShow: isLoading),
|
|
|
|
|
// 8.height,
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
|
// children: [
|
|
|
|
|
// Text(
|
|
|
|
|
// context.translation.viewDetails,
|
|
|
|
|
// style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.primary40 : AppColor.primary50),
|
|
|
|
|
// ),
|
|
|
|
|
// 4.width,
|
|
|
|
|
// Icon(
|
|
|
|
|
// Icons.arrow_forward,
|
|
|
|
|
// color: context.isDark ? AppColor.primary40 : AppColor.primary50,
|
|
|
|
|
// size: 14,
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ).toShimmer(isShow: isLoading),
|
|
|
|
|
// ],
|
|
|
|
|
// ).toShadowContainer(context).onPress(isLoading
|
|
|
|
|
// ? null
|
|
|
|
|
// : () async {
|
|
|
|
|
// await Navigator.push(context, MaterialPageRoute(builder: (context) => RequestsListPage(index)));
|
|
|
|
|
// Provider.of<AllRequestsProvider>(context, listen: false).getRequests();
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// older code....
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/all_requests_provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/notifications_provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
|
|
|
import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
|
import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
|
import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
import 'package:badges/badges.dart' as badges;
|
|
|
|
|
import 'package:test_sa/models/enums/user_types.dart';
|
|
|
|
|
import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/app_floating_action_button.dart';
|
|
|
|
|
import 'package:test_sa/new_views/common_widgets/custom_badge.dart';
|
|
|
|
|
import 'package:test_sa/new_views/pages/land_page/requests_list_page.dart';
|
|
|
|
|
|
|
|
|
|
class RequestsFragment extends StatelessWidget {
|
|
|
|
|
@ -124,123 +18,68 @@ class RequestsFragment extends StatelessWidget {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Consumer<AllRequestsProvider>(
|
|
|
|
|
builder: (context, snapshot, _) => RefreshIndicator(
|
|
|
|
|
onRefresh: () async {
|
|
|
|
|
snapshot.getRequests();
|
|
|
|
|
await Provider.of<NotificationsProvider>(context, listen: false)
|
|
|
|
|
.getSystemNotifications(
|
|
|
|
|
user: Provider.of<UserProvider>(context, listen: false).user,
|
|
|
|
|
resetProvider: true,
|
|
|
|
|
);
|
|
|
|
|
return Future.delayed(const Duration(milliseconds: 250));
|
|
|
|
|
},
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: _buildListItems(context, snapshot),
|
|
|
|
|
),
|
|
|
|
|
builder: (context, snapshot, _) => GridView(
|
|
|
|
|
// padding: const EdgeInsets.only( bottom: 16),
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4, childAspectRatio: 75 / 84, crossAxisSpacing: 2, mainAxisSpacing: 13),
|
|
|
|
|
children: [
|
|
|
|
|
listItem(
|
|
|
|
|
snapshot.highPriorityRequests?.total?.count,
|
|
|
|
|
"high_priority",
|
|
|
|
|
context.translation.highPriority,
|
|
|
|
|
context,
|
|
|
|
|
snapshot.isHighPriorityLoading,
|
|
|
|
|
0,
|
|
|
|
|
context.isDark ? AppColor.redStatus(context) : AppColor.red50,
|
|
|
|
|
),
|
|
|
|
|
listItem(snapshot.overdueRequests?.total?.count, "overdue", context.translation.overdue, context, snapshot.isOverdueLoading, 1, AppColor.yellowIcon(context)),
|
|
|
|
|
listItem(snapshot.openRequests?.total?.count, "new_request", ApiManager.instance.user.type == UsersTypes.engineer ? context.translation.inProgress : context.translation.newR, context,
|
|
|
|
|
snapshot.isOpenLoading, 2, AppColor.primary40),
|
|
|
|
|
listItem(snapshot.completedRequests?.total?.count, "complete_request", context.translation.completed, context, snapshot.isCompleteLoading, 3, AppColor.greenStatus(context)),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<Widget> _buildListItems(BuildContext context, AllRequestsProvider snapshot) {
|
|
|
|
|
final Map<String, dynamic> requestItems = {
|
|
|
|
|
'high_priority': {
|
|
|
|
|
'count': snapshot.highPriorityRequests?.total?.count,
|
|
|
|
|
'translation': context.translation.highPriority,
|
|
|
|
|
'isLoading': snapshot.isAllLoading,
|
|
|
|
|
'color': context.isDark ? AppColor.redStatus(context) : AppColor.red50,
|
|
|
|
|
},
|
|
|
|
|
'overdue': {
|
|
|
|
|
'count': snapshot.overdueRequests?.total?.count,
|
|
|
|
|
'translation': context.translation.overdue,
|
|
|
|
|
'isLoading': snapshot.isAllLoading,
|
|
|
|
|
'color': AppColor.yellowStatus(context),
|
|
|
|
|
},
|
|
|
|
|
'new_request': {
|
|
|
|
|
'count': snapshot.openRequests?.total?.count,
|
|
|
|
|
'translation': ApiManager.instance.user.type == UsersTypes.engineer
|
|
|
|
|
? context.translation.inProgress
|
|
|
|
|
: context.translation.newR,
|
|
|
|
|
'isLoading': snapshot.isAllLoading,
|
|
|
|
|
'color': AppColor.primary40,
|
|
|
|
|
},
|
|
|
|
|
'complete_request': {
|
|
|
|
|
'count': snapshot.completedRequests?.total?.count,
|
|
|
|
|
'translation': context.translation.completed,
|
|
|
|
|
'isLoading': snapshot.isAllLoading,
|
|
|
|
|
'color': AppColor.greenStatus(context),
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return requestItems.entries.map((entry) {
|
|
|
|
|
final key = entry.key;
|
|
|
|
|
final value = entry.value;
|
|
|
|
|
|
|
|
|
|
return listItem(
|
|
|
|
|
value['count'],
|
|
|
|
|
key,
|
|
|
|
|
value['translation'],
|
|
|
|
|
context,
|
|
|
|
|
value['isLoading'],
|
|
|
|
|
requestItems.keys.toList().indexOf(key),
|
|
|
|
|
value['color'],
|
|
|
|
|
);
|
|
|
|
|
}).toList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget listItem(
|
|
|
|
|
int value,
|
|
|
|
|
String icon,
|
|
|
|
|
String title,
|
|
|
|
|
BuildContext context,
|
|
|
|
|
bool isLoading,
|
|
|
|
|
int index,
|
|
|
|
|
Color iconColor,
|
|
|
|
|
) {
|
|
|
|
|
int value,
|
|
|
|
|
String icon,
|
|
|
|
|
String title,
|
|
|
|
|
BuildContext context,
|
|
|
|
|
bool isLoading,
|
|
|
|
|
int index,
|
|
|
|
|
Color iconColor,
|
|
|
|
|
) {
|
|
|
|
|
return GestureDetector(
|
|
|
|
|
onTap: isLoading
|
|
|
|
|
? null
|
|
|
|
|
: () async {
|
|
|
|
|
await Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => RequestsListPage(index),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
Provider.of<AllRequestsProvider>(context, listen: false)
|
|
|
|
|
.getRequests();
|
|
|
|
|
},
|
|
|
|
|
: () {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
MaterialPageRoute(
|
|
|
|
|
builder: (context) => RequestsListPage(index,title),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
value != null && value > 0&&!isLoading
|
|
|
|
|
? badges.Badge(
|
|
|
|
|
badgeContent: Text(
|
|
|
|
|
value.toString(),
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
color: AppColor.white20,
|
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
badgeStyle: const badges.BadgeStyle(
|
|
|
|
|
padding: EdgeInsets.all(4),
|
|
|
|
|
badgeColor: AppColor.red50
|
|
|
|
|
),
|
|
|
|
|
child: Container(
|
|
|
|
|
child: (icon ?? "")
|
|
|
|
|
.toSvgAsset(height: 26, width: 26, color: iconColor)
|
|
|
|
|
?.toShimmer(isShow: isLoading),
|
|
|
|
|
).toShadowCircleContainer(context,padding: 18),
|
|
|
|
|
)
|
|
|
|
|
value != null && value > 0 && !isLoading
|
|
|
|
|
? CustomBadge(
|
|
|
|
|
value: value.toString(),
|
|
|
|
|
child: Container(
|
|
|
|
|
child: (icon ?? "").toSvgAsset(height: 26, width: 26, color: iconColor)?.toShimmer(isShow: isLoading),
|
|
|
|
|
).toShadowCircleContainer(context, padding: 18),
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
child: (icon ?? "")
|
|
|
|
|
.toSvgAsset(height: 26, width: 26, color: iconColor)
|
|
|
|
|
?.toShimmer(isShow: isLoading),
|
|
|
|
|
).toShadowCircleContainer(context,padding: 18),
|
|
|
|
|
child: (icon ?? "").toSvgAsset(height: 26, width: 26, color: iconColor)?.toShimmer(isShow: isLoading),
|
|
|
|
|
).toShadowCircleContainer(context, padding: 18),
|
|
|
|
|
10.height,
|
|
|
|
|
Text(
|
|
|
|
|
title,
|
|
|
|
|
style: AppTextStyles.bodyText.copyWith(
|
|
|
|
|
style: AppTextStyles.tinyFont.copyWith(
|
|
|
|
|
color: context.isDark ? AppColor.neutral30 : AppColor.neutral50,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
@ -250,6 +89,145 @@ class RequestsFragment extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// import 'package:flutter/material.dart';
|
|
|
|
|
// import 'package:provider/provider.dart';
|
|
|
|
|
// import 'package:test_sa/controllers/api_routes/api_manager.dart';
|
|
|
|
|
// import 'package:test_sa/controllers/providers/api/all_requests_provider.dart';
|
|
|
|
|
// import 'package:test_sa/controllers/providers/api/notifications_provider.dart';
|
|
|
|
|
// import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
|
|
|
// import 'package:test_sa/extensions/context_extension.dart';
|
|
|
|
|
// import 'package:test_sa/extensions/int_extensions.dart';
|
|
|
|
|
// import 'package:test_sa/extensions/text_extensions.dart';
|
|
|
|
|
// import 'package:test_sa/extensions/widget_extensions.dart';
|
|
|
|
|
// import 'package:badges/badges.dart' as badges;
|
|
|
|
|
// import 'package:test_sa/models/enums/user_types.dart';
|
|
|
|
|
// import 'package:test_sa/new_views/app_style/app_color.dart';
|
|
|
|
|
// import 'package:test_sa/new_views/common_widgets/app_floating_action_button.dart';
|
|
|
|
|
// import 'package:test_sa/new_views/pages/land_page/requests_list_page.dart';
|
|
|
|
|
//
|
|
|
|
|
// class RequestsFragment extends StatelessWidget {
|
|
|
|
|
// const RequestsFragment({Key key}) : super(key: key);
|
|
|
|
|
//
|
|
|
|
|
// @override
|
|
|
|
|
// Widget build(BuildContext context) {
|
|
|
|
|
// return Consumer<AllRequestsProvider>(
|
|
|
|
|
// builder: (context, snapshot, _) => RefreshIndicator(
|
|
|
|
|
// onRefresh: () async {
|
|
|
|
|
// snapshot.getRequests();
|
|
|
|
|
// await Provider.of<NotificationsProvider>(context, listen: false).getSystemNotifications(
|
|
|
|
|
// user: Provider.of<UserProvider>(context, listen: false).user,
|
|
|
|
|
// resetProvider: true,
|
|
|
|
|
// );
|
|
|
|
|
// return Future.delayed(const Duration(milliseconds: 250));
|
|
|
|
|
// },
|
|
|
|
|
// child: Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: _buildListItems(context, snapshot),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// List<Widget> _buildListItems(BuildContext context, AllRequestsProvider snapshot) {
|
|
|
|
|
// final Map<String, dynamic> requestItems = {
|
|
|
|
|
// 'high_priority': {
|
|
|
|
|
// 'count': snapshot.highPriorityRequests?.total?.count,
|
|
|
|
|
// 'translation': context.translation.highPriority,
|
|
|
|
|
// 'isLoading': snapshot.isAllLoading,
|
|
|
|
|
// 'color': context.isDark ? AppColor.redStatus(context) : AppColor.red50,
|
|
|
|
|
// },
|
|
|
|
|
// 'overdue': {
|
|
|
|
|
// 'count': snapshot.overdueRequests?.total?.count,
|
|
|
|
|
// 'translation': context.translation.overdue,
|
|
|
|
|
// 'isLoading': snapshot.isAllLoading,
|
|
|
|
|
// 'color': AppColor.yellowStatus(context),
|
|
|
|
|
// },
|
|
|
|
|
// 'new_request': {
|
|
|
|
|
// 'count': snapshot.openRequests?.total?.count,
|
|
|
|
|
// 'translation': ApiManager.instance.user.type == UsersTypes.engineer ? context.translation.inProgress : context.translation.newR,
|
|
|
|
|
// 'isLoading': snapshot.isAllLoading,
|
|
|
|
|
// 'color': AppColor.primary40,
|
|
|
|
|
// },
|
|
|
|
|
// 'complete_request': {
|
|
|
|
|
// 'count': snapshot.completedRequests?.total?.count,
|
|
|
|
|
// 'translation': context.translation.completed,
|
|
|
|
|
// 'isLoading': snapshot.isAllLoading,
|
|
|
|
|
// 'color': AppColor.greenStatus(context),
|
|
|
|
|
// },
|
|
|
|
|
// };
|
|
|
|
|
//
|
|
|
|
|
// return requestItems.entries.map((entry) {
|
|
|
|
|
// final key = entry.key;
|
|
|
|
|
// final value = entry.value;
|
|
|
|
|
//
|
|
|
|
|
// return listItem(
|
|
|
|
|
// value['count'],
|
|
|
|
|
// key,
|
|
|
|
|
// value['translation'],
|
|
|
|
|
// context,
|
|
|
|
|
// value['isLoading'],
|
|
|
|
|
// requestItems.keys.toList().indexOf(key),
|
|
|
|
|
// value['color'],
|
|
|
|
|
// );
|
|
|
|
|
// }).toList();
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// Widget listItem(
|
|
|
|
|
// int value,
|
|
|
|
|
// String icon,
|
|
|
|
|
// String title,
|
|
|
|
|
// BuildContext context,
|
|
|
|
|
// bool isLoading,
|
|
|
|
|
// int index,
|
|
|
|
|
// Color iconColor,
|
|
|
|
|
// ) {
|
|
|
|
|
// return GestureDetector(
|
|
|
|
|
// onTap: isLoading
|
|
|
|
|
// ? null
|
|
|
|
|
// : () {
|
|
|
|
|
// Navigator.push(
|
|
|
|
|
// context,
|
|
|
|
|
// MaterialPageRoute(
|
|
|
|
|
// builder: (context) => RequestsListPage(index),
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// // Provider.of<AllRequestsProvider>(context, listen: false).isAllLoading = true;
|
|
|
|
|
// // Provider.of<AllRequestsProvider>(context, listen: false)
|
|
|
|
|
// // .getRequests();
|
|
|
|
|
// },
|
|
|
|
|
// child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// value != null && value > 0 && !isLoading
|
|
|
|
|
// ? badges.Badge(
|
|
|
|
|
// badgeContent: Text(
|
|
|
|
|
// value.toString(),
|
|
|
|
|
// style: const TextStyle(
|
|
|
|
|
// color: AppColor.white20,
|
|
|
|
|
// fontWeight: FontWeight.normal,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// badgeStyle: const badges.BadgeStyle(padding: EdgeInsets.all(4), badgeColor: AppColor.red30),
|
|
|
|
|
// child: Container(
|
|
|
|
|
// child: (icon ?? "").toSvgAsset(height: 26, width: 26, color: iconColor)?.toShimmer(isShow: isLoading),
|
|
|
|
|
// ).toShadowCircleContainer(context, padding: 18),
|
|
|
|
|
// )
|
|
|
|
|
// : Container(
|
|
|
|
|
// child: (icon ?? "").toSvgAsset(height: 26, width: 26, color: iconColor)?.toShimmer(isShow: isLoading),
|
|
|
|
|
// ).toShadowCircleContainer(context, padding: 18),
|
|
|
|
|
// 10.height,
|
|
|
|
|
// Text(
|
|
|
|
|
// title,
|
|
|
|
|
// style: AppTextStyles.bodyText.copyWith(
|
|
|
|
|
// color: context.isDark ? AppColor.neutral30 : AppColor.neutral50,
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// );
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// import 'package:flutter/material.dart';
|
|
|
|
|
// import 'package:provider/provider.dart';
|
|
|
|
|
@ -500,3 +478,48 @@ class RequestsFragment extends StatelessWidget {
|
|
|
|
|
// // });
|
|
|
|
|
// // }
|
|
|
|
|
// }
|
|
|
|
|
// Widget listItem(int value, String icon, String title, BuildContext context, bool isLoading, int index, Color iconColor) {
|
|
|
|
|
// return Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Row(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// Text(
|
|
|
|
|
// value?.toString() ?? "-",
|
|
|
|
|
// style: AppTextStyles.bodyText2.copyWith(color: context.isDark ? AppColor.neutral30 : AppColor.neutral50, height: 1),
|
|
|
|
|
// ).toShimmer(isShow: isLoading).expanded,
|
|
|
|
|
// 8.width,
|
|
|
|
|
// (icon ?? "").toSvgAsset(height: 48, width: 48, color: iconColor)?.toShimmer(isShow: isLoading),
|
|
|
|
|
// ],
|
|
|
|
|
// ).expanded,
|
|
|
|
|
// Text(
|
|
|
|
|
// "$title\n${context.translation.requests}",
|
|
|
|
|
// style: AppTextStyles.bodyText2.copyWith(
|
|
|
|
|
// color: context.isDark ? AppColor.neutral30 : AppColor.neutral50,
|
|
|
|
|
// ),
|
|
|
|
|
// ).toShimmer(isShow: isLoading),
|
|
|
|
|
// // 8.height,
|
|
|
|
|
// // Row(
|
|
|
|
|
// // mainAxisSize: MainAxisSize.min,
|
|
|
|
|
// // children: [
|
|
|
|
|
// // Text(
|
|
|
|
|
// // context.translation.viewDetails,
|
|
|
|
|
// // style: AppTextStyles.bodyText.copyWith(color: context.isDark ? AppColor.primary40 : AppColor.primary50),
|
|
|
|
|
// // ),
|
|
|
|
|
// // 4.width,
|
|
|
|
|
// // Icon(
|
|
|
|
|
// // Icons.arrow_forward,
|
|
|
|
|
// // color: context.isDark ? AppColor.primary40 : AppColor.primary50,
|
|
|
|
|
// // size: 14,
|
|
|
|
|
// // )
|
|
|
|
|
// // ],
|
|
|
|
|
// // ).toShimmer(isShow: isLoading),
|
|
|
|
|
// ],
|
|
|
|
|
// ).toShadowContainer(context, padding: 0).onPress(isLoading
|
|
|
|
|
// ? null
|
|
|
|
|
// : () async {
|
|
|
|
|
// await Navigator.push(context, MaterialPageRoute(builder: (context) => RequestsListPage(index)));
|
|
|
|
|
// Provider.of<AllRequestsProvider>(context, listen: false).getRequests();
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
|