improvements.

design_3.0_internal_audit_module
Sikander Saleem 2 years ago
parent b51555c2f4
commit f519841c04

@ -48,23 +48,25 @@ extension WidgetExtensions on Widget {
).toShadowContainer(context)
: this;
Widget toShadowContainer(BuildContext context) => Container(
padding: const EdgeInsets.all(16),
decoration: ShapeDecoration(
color: Theme.of(context).cardColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
shadows: const [
BoxShadow(
color: Color(0x07000000),
blurRadius: 14,
offset: Offset(0, 0),
spreadRadius: 0,
)
],
),
child: this);
Widget toShadowContainer(BuildContext context, {bool showShadow = true}) => showShadow
? Container(
padding: const EdgeInsets.all(16),
decoration: ShapeDecoration(
color: Theme.of(context).cardColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
shadows: const [
BoxShadow(
color: Color(0x07000000),
blurRadius: 14,
offset: Offset(0, 0),
spreadRadius: 0,
)
],
),
child: this)
: this;
}
extension DividerExtension on Divider {

@ -36,6 +36,7 @@ class _DailyFragmentState extends State<DailyFragment> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: const EdgeInsets.only(left: 16, right: 16),
child: Consumer<AllRequestsProvider>(builder: (context, snapshot, _) {
return Column(
mainAxisSize: MainAxisSize.min,
@ -74,7 +75,7 @@ class _DailyFragmentState extends State<DailyFragment> {
],
).toShadowContainer(context);
}),
).paddingOnly(start: 16, end: 16);
);
}
BoxDecoration cellDecoration({Color color}) => BoxDecoration(color: color ?? Colors.transparent, shape: BoxShape.circle);

@ -37,7 +37,7 @@ class _MonthlyFragmentState extends State<MonthlyFragment> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.only(left: 16,right: 16),
child: Column(
children: [
Consumer<AllRequestsProvider>(
@ -72,7 +72,7 @@ class _MonthlyFragmentState extends State<MonthlyFragment> {
final day = DateFormat("d").format(dateTime);
return CalendarDaysCard(
day: day,
fill: snapshot.calendarRequests.requestsDetails?.firstWhere(
fill: snapshot.calendarRequests?.requestsDetails?.firstWhere(
(element) => (element.date != null) && (DateTime.tryParse(element.date)?.difference(dateTime)?.inDays == 0),
orElse: () => null,
) !=

@ -44,6 +44,7 @@ class _WeeklyFragmentState extends State<WeeklyFragment> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
padding: const EdgeInsets.only(left: 16,right: 16),
child: Consumer<AllRequestsProvider>(builder: (context, snapshot, _) {
return Column(
mainAxisSize: MainAxisSize.min,
@ -55,6 +56,10 @@ class _WeeklyFragmentState extends State<WeeklyFragment> {
calendarFormat: CalendarFormat.week,
weekendDays: const [],
onCalendarCreated: (controller) {},
onPageChanged: (date) {
_initialDate = date;
Provider.of<AllRequestsProvider>(context, listen: false).getCalenderRequests(from: date, to: date.add(const Duration(days: 7)));
},
calendarBuilders: CalendarBuilders(
headerTitleBuilder: (context, dateTime) => Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
@ -101,7 +106,7 @@ class _WeeklyFragmentState extends State<WeeklyFragment> {
bool isPPMs = list[index].nameOfType == "PPMs";
return isServiceRequest
? ServiceRequestItemView(list[index])
? ServiceRequestItemView(list[index], showShadow: false)
: isGasRefill
? GasRefillItemView(list[index])
: isPPMs
@ -114,34 +119,13 @@ class _WeeklyFragmentState extends State<WeeklyFragment> {
color: Colors.grey,
);
},
separatorBuilder: (cxt, index) => 8.height,
separatorBuilder: (cxt, index) => const Divider().defaultStyle(context),
itemCount: snapshot.isCalendarLoading ? 6 : snapshot.calendarRequests.requestsDetails.length,
),
// TableCalendar(
// headerVisible: false,
// calendarFormat: CalendarFormat.week,
// firstDay: DateTime.utc(2010, 10, 16),
// lastDay: DateTime.utc(2030, 3, 14),
// focusedDay: currentDateTime,
// currentDay: currentDateTime,
// rowHeight: 37,
// calendarStyle: CalendarStyle(
// todayDecoration: cellDecoration(),
// todayTextStyle: AppTextStyles.bodyText.copyWith(color: const Color(0xFF2B353E)),
// selectedTextStyle: AppTextStyles.bodyText.copyWith(color: const Color(0xFF2B353E)),
// rangeStartTextStyle: AppTextStyles.bodyText.copyWith(color: const Color(0xFF2B353E)),
// rangeEndTextStyle: AppTextStyles.bodyText.copyWith(color: const Color(0xFF2B353E)),
// ),
// daysOfWeekStyle: DaysOfWeekStyle(
// weekdayStyle: AppTextStyles.bodyText.copyWith(color: AppColor.neutral50),
// weekendStyle: AppTextStyles.bodyText.copyWith(color: AppColor.neutral50),
// ),
// availableGestures: AvailableGestures.none,
// ),
],
).toShadowContainer(context);
}),
).paddingOnly(start: 16, end: 16);
);
}
BoxDecoration cellDecoration({Color color}) => BoxDecoration(color: color ?? Colors.transparent, shape: BoxShape.circle);

@ -14,7 +14,7 @@ class RecentActivitiesFragment extends StatelessWidget {
@override
Widget build(BuildContext context) {
_notificationsProvider ??= Provider.of<NotificationsProvider>(context);
_notificationsProvider ??= Provider.of<NotificationsProvider>(context, listen: false);
return SingleChildScrollView(
padding: const EdgeInsets.all(16),
child: Container(

@ -10,8 +10,9 @@ import 'package:test_sa/views/widgets/requests/request_status.dart';
class ServiceRequestItemView extends StatelessWidget {
final RequestsDetails request;
final bool showShadow;
const ServiceRequestItemView(this.request, {Key key}) : super(key: key);
const ServiceRequestItemView(this.request, {Key key, this.showShadow = false}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -64,6 +65,6 @@ class ServiceRequestItemView extends StatelessWidget {
],
),
],
).toShadowContainer(context).onPress(() {});
).toShadowContainer(context, showShadow: showShadow).onPress(() {});
}
}

@ -22,6 +22,7 @@ import '../qr/scan_qr.dart';
class SingleDevicePicker extends StatefulWidget {
static final String id = "/single-device-Picker";
const SingleDevicePicker({Key key}) : super(key: key);
@override
@ -91,7 +92,7 @@ class _SingleDevicePickerState extends State<SingleDevicePicker> {
padding: const EdgeInsets.only(left: 16, right: 8),
alignment: Alignment.center,
decoration: ShapeDecoration(
color: context.isDark?Color(0xFF3B3D4A): Color(0xFFEAF1F4),
color: context.isDark ? Color(0xFF3B3D4A) : Color(0xFFEAF1F4),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
@ -149,7 +150,6 @@ class _SingleDevicePickerState extends State<SingleDevicePicker> {
},
child: Column(
children: [
const SizedBox(height: 16),
Expanded(
child: _searchableList.isEmpty
? NoItemFound(

Loading…
Cancel
Save