improvements

main_design2.0
Sikander Saleem 2 years ago
parent e98bd62be9
commit 593cecbe55

@ -119,8 +119,8 @@ class AllRequestsProvider extends ChangeNotifier {
Response response;
try {
Map<String, dynamic> body = {
"typeTransaction": [1, 2, 3, 4],
"statusTransaction": [1, 2, 3,4],
"typeTransaction": [1],
"statusTransaction": [1, 2, 4],
"priority": [1],
"displayData": []
};
@ -149,7 +149,7 @@ class AllRequestsProvider extends ChangeNotifier {
try {
Map<String, dynamic> body = {
"typeTransaction": [1, 2, 3, 4],
"statusTransaction": [1, 2, 3,4],
"statusTransaction": [1, 2, 4],
"priority": [],
"displayData": [1]
};

@ -222,7 +222,7 @@ class MyApp extends StatelessWidget {
RequestGasRefill.id: (_) => const RequestGasRefill(),
CreateServiceRequestPage.id: (_) => const CreateServiceRequestPage(),
SingleHospitalPicker.id: (_) => SingleHospitalPicker(),
SingleDevicePicker.id: (_) => const SingleDevicePicker(),
MyAssetsPage.id: (_) => const MyAssetsPage(),
SingleDepartmentPicker.id: (_) => SingleDepartmentPicker(),
NotificationsPage.id: (_) => NotificationsPage(),
FutureRequestServiceDetails.id: (_) => FutureRequestServiceDetails(),

@ -111,6 +111,8 @@ class RequestsDetails {
String assetTransferTo;
String code;
String date;
String siteTransferFrom;
String siteTransferTo;
RequestsDetails(
{this.id,
@ -131,6 +133,8 @@ class RequestsDetails {
this.assetTransferFrom,
this.assetTransferTo,
this.code,
this.siteTransferFrom,
this.siteTransferTo,
this.date});
RequestsDetails.fromJson(Map<String, dynamic> json) {
@ -153,6 +157,8 @@ class RequestsDetails {
assetTransferTo = json['assetTransferTo'];
code = json['code'];
date = json['date'];
siteTransferFrom = json['siteTransferFrom'];
siteTransferTo = json['siteTransferTo'];
}
Map<String, dynamic> toJson() {
@ -176,6 +182,8 @@ class RequestsDetails {
data['assetTransferTo'] = assetTransferTo;
data['code'] = code;
data['date'] = date;
data['siteTransferFrom'] = siteTransferFrom;
data['siteTransferTo'] = siteTransferTo;
return data;
}
}

@ -77,18 +77,19 @@ class _DashboardPageState extends State<DashboardPage> {
color: Color(0xff767676),
size: 30,
).paddingOnly(top: 6, end: 0),
Positioned(
top: 0,
right: 0,
child: Container(
padding: const EdgeInsets.all(4),
decoration: const ShapeDecoration(
color: Color(0xFFD02127),
shape: CircleBorder(),
),
child: Text("3", style: AppTextStyles.bodyText),
),
)
// todo @sikander will add count for unread notifications
// Positioned(
// top: 0,
// right: 0,
// child: Container(
// padding: const EdgeInsets.all(4),
// decoration: const ShapeDecoration(
// color: Color(0xFFD02127),
// shape: CircleBorder(),
// ),
// child: Text("", style: AppTextStyles.bodyText),
// ),
// )
],
).onPress(() {
Navigator.of(context).pushNamed(NotificationsPage.id);

@ -46,7 +46,7 @@ class _LandPageState extends State<LandPage> {
})),
// const old_page.LandPage(),
MyRequestsPage(),
const SingleDevicePicker(),
const MyAssetsPage(fromBottomBar: true),
if (_userProvider.user.type == UsersTypes.engineer) const CalendarPage(),
];
}

@ -49,11 +49,15 @@ class AssetItemView extends StatelessWidget {
style: AppTextStyles.heading5.copyWith(color: Color(0xFF3B3D4A)),
),
Text(
"${context.translation.from} : ${request.assetTransferFrom}",
"${context.translation.from} : ${request.siteTransferFrom}",
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
),
Text(
"${context.translation.to} : ${request.assetTransferTo}",
"${context.translation.to} : ${request.siteTransferTo}",
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
),
Text(
"${request.status.replaceAll("=", ":")}",
style: AppTextStyles.bodyText.copyWith(color: Color(0xFF757575)),
),
],

@ -37,7 +37,7 @@ class _CommentsBottomSheetState extends State<CommentsBottomSheet> {
@override
Widget build(BuildContext context) {
final commentsProvider = Provider.of<CommentsProvider>(context);
final commentsProvider = Provider.of<CommentsProvider>(context, listen: false);
final userProvider = Provider.of<UserProvider>(context, listen: false);
return Container(
height: MediaQuery.of(context).size.height * 0.55,
@ -50,7 +50,9 @@ class _CommentsBottomSheetState extends State<CommentsBottomSheet> {
padding: EdgeInsets.symmetric(horizontal: 16.toScreenWidth, vertical: 8.toScreenHeight),
child: Form(
key: _formKey,
child: LoadingManager(
child: Column(
children: [
LoadingManager(
isLoading: commentsProvider.isLoading,
isFailedLoading: commentsProvider.comments == null,
stateCode: commentsProvider.stateCode,
@ -99,8 +101,11 @@ class _CommentsBottomSheetState extends State<CommentsBottomSheet> {
},
),
).expanded,
],
),
).expanded,
if (userProvider.user.type == UsersTypes.normal_user) 8.height,
if (userProvider.user.type == UsersTypes.normal_user)
if (userProvider.user.type == UsersTypes.normal_user) // todo its keeps loading when open keyboard or dismiss
AppTextFormField(
labelText: "Type any comment",
backgroundColor: AppColor.neutral30,
@ -123,7 +128,6 @@ class _CommentsBottomSheetState extends State<CommentsBottomSheet> {
],
),
),
),
);
}
}

@ -37,7 +37,7 @@ class PickAsset extends StatelessWidget {
context.translation.pickAsset.bodyText(context).custom(color: context.isDark ? AppColor.neutral40 : AppColor.neutral50),
],
).onPress(() async {
Asset device = await Navigator.of(context).pushNamed(SingleDevicePicker.id) as Asset;
Asset device = await Navigator.of(context).pushNamed(MyAssetsPage.id) as Asset;
onPickAsset(device);
}).expanded,
"qr".toSvgAsset(height: 24, fit: BoxFit.fitHeight, color: context.isDark ? AppColor.primary40 : AppColor.primary70),

@ -20,16 +20,17 @@ import '../../pages/device_transfer/asset_filter_screen.dart';
import '../../pages/device_transfer/asset_search_screen.dart';
import '../qr/scan_qr.dart';
class SingleDevicePicker extends StatefulWidget {
class MyAssetsPage extends StatefulWidget {
static final String id = "/single-device-Picker";
final bool fromBottomBar;
const SingleDevicePicker({Key key}) : super(key: key);
const MyAssetsPage({Key key, this.fromBottomBar = false}) : super(key: key);
@override
_SingleDevicePickerState createState() => _SingleDevicePickerState();
_MyAssetsPageState createState() => _MyAssetsPageState();
}
class _SingleDevicePickerState extends State<SingleDevicePicker> {
class _MyAssetsPageState extends State<MyAssetsPage> {
AssetProvider _devicesProvider;
UserProvider _userProvider;
SettingProvider _settingProvider;
@ -195,7 +196,9 @@ class _SingleDevicePickerState extends State<SingleDevicePicker> {
),
),
),
floatingActionButton: FloatingActionButton(
floatingActionButton: widget.fromBottomBar
? null
: FloatingActionButton(
heroTag: "some tag 2",
child: "qr".toSvgAsset(height: 32, fit: BoxFit.fitHeight, color: Theme.of(context).scaffoldBackgroundColor),
onPressed: () async {

Loading…
Cancel
Save