request fragment added on dashboard.

main_design2.0
Sikander Saleem 2 years ago
parent 1ccb8cdcb4
commit fe624596a1

@ -0,0 +1,3 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M34.6091 16.3846C35.3416 17.1171 35.3416 18.3043 34.6091 19.0364L22.0305 31.6154C21.2981 32.3474 20.1112 32.3474 19.3788 31.6154L13.3909 25.6271C12.6584 24.895 12.6584 23.7078 13.3909 22.9757C14.1229 22.2433 15.3102 22.2433 16.0422 22.9757L20.7045 27.6379L31.9574 16.3846C32.6898 15.6526 33.8771 15.6526 34.6091 16.3846ZM48 24C48 37.266 37.2642 48 24 48C10.734 48 0 37.2642 0 24C0 10.734 10.7358 0 24 0C37.266 0 48 10.7358 48 24ZM44.25 24C44.25 12.8068 35.1918 3.75 24 3.75C12.8068 3.75 3.75 12.8082 3.75 24C3.75 35.1932 12.8082 44.25 24 44.25C35.1932 44.25 44.25 35.1918 44.25 24Z" fill="#62BE96"/>
</svg>

After

Width:  |  Height:  |  Size: 716 B

@ -0,0 +1,6 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13.1882 34.8114C12.6275 34.2508 11.7178 34.2508 11.1568 34.8114L0.420782 45.5478C-0.140261 46.1085 -0.140261 47.0181 0.420782 47.5792C0.701303 47.8597 1.06898 48 1.43666 48C1.80398 48 2.17166 47.8597 2.45218 47.5792L13.1882 36.8432C13.7496 36.2822 13.7496 35.3725 13.1882 34.8114Z" fill="#D02127"/>
<path d="M47.5798 0.420861C47.3041 0.145101 46.9302 -0.00394883 46.5383 7.95684e-05L28.6249 0.322716C28.0484 0.333336 27.5343 0.6871 27.3186 1.22141C27.1029 1.75572 27.2274 2.36766 27.635 2.7749L31.5022 6.64213L10.8125 27.3319C10.5433 27.6014 10.3917 27.9669 10.3917 28.3477C10.3917 28.7286 10.543 29.0941 10.8125 29.3636L18.6367 37.1871C18.9172 37.4676 19.2849 37.6079 19.6522 37.6079C20.0199 37.6079 20.3876 37.4676 20.6681 37.1871L41.3575 16.4977L45.2251 20.365C45.6323 20.7726 46.2442 20.8971 46.7786 20.6814C47.3129 20.4657 47.6666 19.9515 47.6769 19.3751L48.0002 1.46238C48.0072 1.07273 47.8556 0.696622 47.5798 0.420861ZM44.8654 15.9422L42.3733 13.4504C42.1042 13.1809 41.7387 13.0297 41.3578 13.0297C40.9766 13.0297 40.6111 13.1809 40.3419 13.4504L19.6522 34.1398L13.8598 28.3477L34.5495 7.65801C34.819 7.38848 34.9703 7.02336 34.9703 6.64213C34.9703 6.26127 34.819 5.89579 34.5495 5.62662L32.0578 3.13452L45.1009 2.89978L44.8654 15.9422Z" fill="#D02127"/>
<path d="M1.95925 39.6535C2.32693 39.6535 2.69461 39.5129 2.97476 39.2324L9.27623 32.9313C9.83728 32.3702 9.83728 31.4606 9.27623 30.8995C8.71519 30.3388 7.80588 30.3388 7.24484 30.8995L0.943365 37.201C0.382322 37.762 0.382322 38.6717 0.943365 39.2327C1.22389 39.5129 1.59157 39.6535 1.95925 39.6535Z" fill="#D02127"/>
<path d="M15.069 38.7238L8.76716 45.0249C8.20611 45.5859 8.20611 46.4956 8.76716 47.0567C9.04768 47.3372 9.41536 47.4774 9.78304 47.4774C10.1507 47.4774 10.5184 47.3372 10.7989 47.0567L17.1004 40.7552C17.6614 40.1941 17.6614 39.2845 17.1004 38.7238C16.5393 38.1627 15.6297 38.1627 15.069 38.7238Z" fill="#D02127"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

@ -0,0 +1,3 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M24 48C17.5894 48 11.5625 45.5035 7.02938 40.9706C2.49647 36.4375 0 30.4106 0 24V22.125H3.75V24C3.75 29.4089 5.85637 34.4942 9.68109 38.3189C13.5058 42.1436 18.5911 44.25 24 44.25C29.4089 44.25 34.4942 42.1436 38.3189 38.3189C42.1436 34.4942 44.25 29.4089 44.25 24C44.25 18.5911 42.1436 13.5058 38.3189 9.68109C34.4942 5.85637 29.4089 3.75 24 3.75H22.125V0H24C30.4106 0 36.4375 2.49647 40.9706 7.02938C45.5035 11.5625 48 17.5894 48 24C48 30.4106 45.5035 36.4375 40.9706 40.9706C36.4375 45.5035 30.4106 48 24 48ZM25.875 35.25H22.125V25.875H12.75V22.125H22.125V12.75H25.875V22.125H35.25V25.875H25.875V35.25ZM4.57397 17.9829L1.10934 16.5478L2.54456 13.0833L6.009 14.5184L4.57397 17.9829ZM8.35519 11.0069L5.70356 8.35528L8.35528 5.70356L11.0069 8.35519L8.35519 11.0069ZM14.5184 6.009L13.0833 2.54456L16.5478 1.10934L17.9829 4.57397L14.5184 6.009Z" fill="#75BDE0"/>
</svg>

After

Width:  |  Height:  |  Size: 977 B

@ -0,0 +1,4 @@
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M23.9998 0C10.7663 0 0 10.7661 0 23.9993C0 37.2335 10.7663 48 23.9998 48C37.233 48 47.9991 37.2333 47.9991 23.9993C47.9991 10.7661 37.233 0 23.9998 0ZM23.9998 44.5596C12.6633 44.5596 3.44037 35.3362 3.44037 23.9993C3.44037 12.6631 12.6633 3.44037 23.9998 3.44037C35.336 3.44037 44.5587 12.6631 44.5587 23.9993C44.5587 35.3362 35.336 44.5596 23.9998 44.5596Z" fill="#FFEDBC"/>
<path d="M36.3401 23.5977H25.0617V11.2693C25.0617 10.3193 24.2918 9.54907 23.3415 9.54907C22.3915 9.54907 21.6213 10.3193 21.6213 11.2693V25.3179C21.6213 26.2679 22.3915 27.0381 23.3415 27.0381H36.3401C37.2904 27.0381 38.0603 26.2679 38.0603 25.3179C38.0603 24.3679 37.2901 23.5977 36.3401 23.5977Z" fill="#FFEDBC"/>
</svg>

After

Width:  |  Height:  |  Size: 805 B

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.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/new_views/pages/new_gas_refill_request_page.dart';
import 'package:test_sa/views/pages/device_transfer/request_device_transfer.dart';
@ -31,7 +32,7 @@ class _AppFloatingActionButtonState extends State<AppFloatingActionButton> {
@override
Widget build(BuildContext context) {
const duration = Duration(milliseconds: 500);
const duration = Duration(milliseconds: 250);
return Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.end,
@ -44,19 +45,26 @@ class _AppFloatingActionButtonState extends State<AppFloatingActionButton> {
child: AnimatedOpacity(
opacity: turns != 0 ? 1 : 0,
duration: duration,
child: Card(
shape: Theme.of(context).cardTheme.copyWith().shape,
margin: EdgeInsetsDirectional.only(start: 60.toScreenWidth),
child: Container(
width: MediaQuery.of(context).size.width * .66,
padding: EdgeInsets.all(16),
decoration: ShapeDecoration(
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
shadows: const [BoxShadow(color: Color(0x0C000000), blurRadius: 10, offset: Offset(0, 0), spreadRadius: 0)],
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
_FloatingButtonListTile(iconName: "gas_refill_request", label: context.translation.gasRefillRequest, routeName: NewGasRefillRequestPage.routeName),
const Divider().defaultStyle(context).paddingOnly(start: 16, end: 16),
_FloatingButtonListTile(iconName: "transfer_request", label: context.translation.transferRequest, routeName: RequestDeviceTransfer.id),
const Divider().defaultStyle(context).paddingOnly(start: 16, end: 16),
_FloatingButtonListTile(iconName: "service_request", label: context.translation.serviceRequest, routeName: CreateServiceRequestPage.id),
fabItem(context.translation.gasRefillRequest, "gas_refill_request", NewGasRefillRequestPage.routeName),
1.divider.paddingOnly(top: 16, bottom: 16),
fabItem(context.translation.transferRequest, "transfer_request", RequestDeviceTransfer.id),
1.divider.paddingOnly(top: 16, bottom: 16),
fabItem(context.translation.serviceRequest, "service_request", CreateServiceRequestPage.id),
],
).paddingOnly(top: 8, bottom: 8),
),
),
),
),
@ -74,37 +82,33 @@ class _AppFloatingActionButtonState extends State<AppFloatingActionButton> {
],
);
}
}
class _FloatingButtonListTile extends StatelessWidget {
final String iconName, routeName;
final String label;
const _FloatingButtonListTile({
@required this.iconName,
@required this.routeName,
@required this.label,
Key key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
Navigator.of(context).pushNamed(routeName);
},
child: ListTile(
horizontalTitleGap: 40.toScreenWidth,
leading: SvgPicture.asset(
"assets/images/$iconName.svg",
height: 28.toScreenWidth,
color: context.isDark ? AppColor.primary40 : AppColor.primary70,
),
title: Text(
Widget fabItem(String label, String iconName, routeName) {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
flex: 4,
child: Text(
label,
style: Theme.of(context).textTheme.titleLarge?.copyWith(fontWeight: FontWeight.w500),
textAlign: TextAlign.center,
style: AppTextStyles.heading5.copyWith(color: AppColor.neutral50),
),
),
);
// 4.width,
Expanded(
flex: 1,
child: SvgPicture.asset(
"assets/images/$iconName.svg",
height: 24.toScreenHeight,
width: 24.toScreenWidth,
color: context.isDark ? AppColor.primary40 : AppColor.primary70,
),
)
],
).onPress(() {
_rotate();
Navigator.of(context).pushNamed(routeName);
});
}
}

@ -0,0 +1,11 @@
import 'package:flutter/material.dart';
class ProgressFragment extends StatelessWidget {
ProgressFragment({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
// TODO: implement build
return Container();
}
}

@ -0,0 +1,11 @@
import 'package:flutter/material.dart';
class RecentActivitiesFragment extends StatelessWidget {
RecentActivitiesFragment({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
// TODO: implement build
return Container();
}
}

@ -0,0 +1,84 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.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/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/common_widgets/app_floating_action_button.dart';
class RequestsFragment extends StatelessWidget {
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: GridView(
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, childAspectRatio: 191 / 237, crossAxisSpacing: 16, mainAxisSpacing: 16),
children: [
gridItem("12", "high_priority", "High Priority\nRequests"),
gridItem("12", "overdue", "Overdue\nRequests"),
gridItem("12", "new_request", "New\nRequests"),
gridItem("12", "complete_request", "Completed\nRequests"),
],
),
);
}
Widget gridItem(String value, String icon, String title) {
return Container(
padding: const EdgeInsets.all(16),
decoration: ShapeDecoration(
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
shadows: const [
BoxShadow(
color: Color(0x07000000),
blurRadius: 14,
offset: Offset(0, 0),
spreadRadius: 0,
)
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
value,
style: AppTextStyles.heading1.copyWith(color: AppColor.neutral70, height: 1),
).expanded,
SvgPicture.asset('assets/images/$icon.svg', height: 35, width: 35),
],
).expanded,
Text(
title,
style: AppTextStyles.heading5.copyWith(color: AppColor.neutral50),
),
8.height,
Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'View Details',
style: AppTextStyles.bodyText.copyWith(color: const Color(0xFF4A8DB7)),
),
4.width,
const Icon(
Icons.arrow_forward,
color: Color(0xFF4A8DB7),
size: 14,
)
],
),
],
),
);
}
}

@ -7,6 +7,10 @@ import 'package:test_sa/models/enums/translation_keys.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/common_widgets/app_drawer.dart';
import 'package:test_sa/new_views/common_widgets/app_floating_action_button.dart';
import 'package:test_sa/new_views/pages/land_page/dashboard_fragments/progress_fragment.dart';
import 'package:test_sa/new_views/pages/land_page/dashboard_fragments/recent_activites_fragment.dart';
import 'package:test_sa/new_views/pages/land_page/dashboard_fragments/requests_fragment.dart';
import 'package:test_sa/views/pages/user/notifications/notifications_page.dart';
import 'dashboard_page_indicator.dart';
@ -42,7 +46,6 @@ class _DashboardPageState extends State<DashboardPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
floatingActionButton: const AppFloatingActionButton(),
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: const Color(0xffF8F9FB),
@ -86,12 +89,18 @@ class _DashboardPageState extends State<DashboardPage> {
),
)
],
),
).onPress(() {
Navigator.of(context).pushNamed(NotificationsPage.id);
}),
],
).paddingOnly(start: 16, end: 16),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
context.translation.welcome,
@ -116,25 +125,20 @@ class _DashboardPageState extends State<DashboardPage> {
),
],
),
8.height,
],
).paddingOnly(start: 16, end: 16, top: 8, bottom: 8),
Expanded(
child: PageView(
controller: _controller,
children: const [
Center(
child: Text('First Page'),
),
Center(
child: Text('Second Page'),
),
Center(
child: Text('Third Page'),
),
children: [
RequestsFragment(),
ProgressFragment(),
RecentActivitiesFragment(),
],
),
),
],
).paddingAll(16),
),
);
}
}

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:test_sa/extensions/context_extension.dart';
import 'package:test_sa/extensions/int_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/models/system_notification_model.dart';
import 'package:test_sa/views/widgets/loaders/lazy_loading.dart';
@ -22,28 +23,40 @@ class NotificationsList extends StatelessWidget {
nextPage: nextPage,
onLazyLoad: onLazyLoad,
child: SingleChildScrollView(
child: Card(
child: ListView.builder(
padding: const EdgeInsets.all(16),
child: Container(
decoration: ShapeDecoration(
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
shadows: const [
BoxShadow(
color: Color(0x07000000),
blurRadius: 14,
offset: Offset(0, 0),
spreadRadius: 0,
)
],
),
child: ListView.separated(
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
padding: const EdgeInsets.all(16),
itemCount: notifications.length,
shrinkWrap: true,
separatorBuilder: (context, itemIndex) => 1.divider.paddingOnly(top: 16, bottom: 16),
itemBuilder: (context, itemIndex) {
return Column(
children: [
NotificationItem(
return NotificationItem(
notification: notifications[itemIndex],
onPressed: (notification) {
// todo @sikander, check notifications payload, because notification model is different to need to check from backend
//Navigator.of(context).pushNamed(FutureRequestServiceDetails.id, arguments: notification.requestId);
},
),
if (itemIndex != (notifications.length - 1)) const Divider().defaultStyle(context).paddingOnly(start: 16, end: 16),
],
);
},
),
),
).paddingAll(16),
),
);
}
}

@ -4,6 +4,7 @@ import 'package:test_sa/extensions/string_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/extensions/widget_extensions.dart';
import 'package:test_sa/models/system_notification_model.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
class NotificationItem extends StatelessWidget {
final SystemNotificationModel notification;
@ -19,22 +20,25 @@ class NotificationItem extends StatelessWidget {
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
(notification.title ?? "No Hospital Found").heading6(context),
8.height,
(notification.text ?? "complaint not available").bodyText2(context),
Text(
notification.title ?? "",
style: AppTextStyles.heading6.copyWith(color: AppColor.neutral50),
).expanded,
8.width,
Text(
notification.createdOn.toServiceRequestCardFormat ?? "",
textAlign: TextAlign.right,
style: AppTextStyles.tinyFont.copyWith(color: AppColor.neutral50),
),
],
),
Text(
notification.text ?? "",
style: AppTextStyles.bodyText2.copyWith(color: Color(0xFF757575)),
),
(notification.createdOn.toServiceRequestCardFormat ?? "complaint not available").tinyFont(context),
],
).onPress(() {
onPressed(notification);
}),
],
).paddingAll(16);
});
}
}

Loading…
Cancel
Save