Merge remote-tracking branch 'origin/main_design2.0' into main_design2.0

main_design2.0
zaid_daoud 2 years ago
commit a024185229

@ -32,6 +32,7 @@ class _MonthlyFragmentState extends State<MonthlyFragment> {
focusedDay: DateTime.now(),
calendarFormat: CalendarFormat.month,
weekendDays: const [],
rowHeight: 45,
availableGestures: AvailableGestures.none,
onCalendarCreated: (controller) {
_controller = controller;

@ -1,145 +0,0 @@
// import 'package:flutter/material.dart';
// import 'package:table_calendar/table_calendar.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/pages/land_page/calender_fragments/monthly_fragment.dart';
// import 'package:test_sa/new_views/pages/land_page/calender_fragments/weekly_fragment.dart';
//
// class CalenderPage extends StatefulWidget {
// CalenderPage({Key key}) : super(key: key);
//
// @override
// _CalenderPageState createState() {
// return _CalenderPageState();
// }
// }
//
// class _CalenderPageState extends State<CalenderPage> {
// int selectedIndex = 0;
// DateTime currentDateTime = DateTime.now();
//
// PageController _pageController;
//
// @override
// void initState() {
// _pageController = PageController();
// super.initState();
// }
//
// @override
// void dispose() {
// _pageController.dispose();
// super.dispose();
// }
//
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// body: Column(
// children: [
// // todo @sikander, hiding My shift view, later when they add data, then will us it.
// Container(
// width: double.infinity,
// 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,
// mainAxisSize: MainAxisSize.min,
// children: [
// Text(
// 'My Shift',
// style: AppTextStyles.heading5.copyWith(color: AppColor.neutral50),
// ),
// 8.height,
// Text(
// 'Sunday to Thursday',
// style: AppTextStyles.bodyText.copyWith(color: const Color(0xFF757575)),
// ),
// Text(
// '09:00 to 18:00',
// style: AppTextStyles.bodyText.copyWith(color: AppColor.neutral50),
// ),
// ],
// ),
// ),
//
// Container(
// width: double.infinity,
// padding: const EdgeInsets.all(4),
// decoration: ShapeDecoration(
// color: const Color(0xFFEAF1F4),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(16),
// ),
// shadows: const [
// BoxShadow(
// color: Color(0x07000000),
// blurRadius: 14,
// offset: Offset(0, 0),
// spreadRadius: 0,
// )
// ],
// ),
// child: Row(
// children: [
// tabItem("Monthly", 0, selectedIndex, () => onTabPress(0)),
// tabItem("Weekly", 1, selectedIndex, () => onTabPress(1)),
// tabItem("Daily", 2, selectedIndex, () => onTabPress(2)),
// ],
// ),
// ),
// 8.height,
// PageView(
// controller: _pageController,
// onPageChanged: (index) => onTabPress(index),
// children: [
// MonthlyFragment(),
// WeeklyFragment(),
// Container(),
// ],
// ).expanded,
// ],
// ),
// );
// }
//
// void onTabPress(index) {
// if (selectedIndex != index) {
// setState(() {
// selectedIndex = index;
// });
// _pageController.jumpToPage(index);
// }
// }
//
// Widget tabItem(String title, int index, int selectedIndex, VoidCallback onPress) {
// return Container(
// alignment: Alignment.center,
// padding: const EdgeInsets.only(top: 14, bottom: 14),
// decoration: ShapeDecoration(
// color: index == selectedIndex ? Colors.white : Colors.transparent,
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(13),
// ),
// ),
// child: Text(
// title,
// style: AppTextStyles.bodyText.copyWith(color: index == selectedIndex ? AppColor.neutral60 : const Color(0xFF757575)),
// )).onPress(onPress).expanded;
// }
// }

@ -14,83 +14,73 @@ class AssetItemListView extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(16),
decoration: ShapeDecoration(
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
return Row(
children: [
Container(
width: 95,
height: 95,
decoration: ShapeDecoration(
color: const Color(0xFFEAF1F4),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(device.assetPhoto != null ? URLs.getFileUrl(device.assetPhoto) : "https://www.lasteelcraft.com/images/no-image-available.png"),
)),
),
shadows: const [BoxShadow(color: Color(0x07000000), blurRadius: 14, offset: Offset(0, 0), spreadRadius: 0)],
),
child: Row(
children: [
Container(
width: 95,
height: 95,
decoration: ShapeDecoration(
color: const Color(0xFFEAF1F4),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
15.width,
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
device.modelDefinition.assetName,
maxLines: 2,
style: AppTextStyles.heading5.copyWith(color: Color(0xFF3B3D4A)),
),
image: DecorationImage(
fit: BoxFit.cover,
image: NetworkImage(device.assetPhoto != null ? URLs.getFileUrl(device.assetPhoto) : "https://www.lasteelcraft.com/images/no-image-available.png"),
)),
),
15.width,
Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
device.modelDefinition.assetName,
maxLines: 2,
style: AppTextStyles.heading5.copyWith(color: Color(0xFF3B3D4A)),
),
Text(
"${context.translation.assetNumber} : ${device.assetNumber}",
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
),
Text(
"${context.translation.model} : ${device.modelDefinition.modelDefCode}",
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"${context.translation.serialNo} : ${device.assetSerialNo}",
maxLines: 2,
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
).expanded,
Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
context.translation.viewDetails,
style: AppTextStyles.bodyText.copyWith(color: const Color(0xFF4A8DB7)),
),
4.width,
const Icon(
Icons.arrow_forward,
color: Color(0xFF4A8DB7),
size: 14,
)
],
),
],
)
],
).expanded
],
),
).onPress(() => onPressed(device));
Text(
"${context.translation.assetNumber} : ${device.assetNumber}",
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
),
Text(
"${context.translation.model} : ${device.modelDefinition.modelDefCode}",
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"${context.translation.serialNo} : ${device.assetSerialNo}",
maxLines: 2,
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
).expanded,
Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
context.translation.viewDetails,
style: AppTextStyles.bodyText.copyWith(color: const Color(0xFF4A8DB7)),
),
4.width,
const Icon(
Icons.arrow_forward,
color: Color(0xFF4A8DB7),
size: 14,
)
],
),
],
)
],
).expanded
],
).toShadowContainer(context).onPress(() => onPressed(device));
}
}

Loading…
Cancel
Save