UAT Improvements.

export_module_ui_ux_enhancement
Sikander Saleem 1 month ago
parent 154187fbaa
commit 7d25f2be01

@ -130,10 +130,11 @@ class _RequestCategoryFragmentState extends State<RequestCategoryFragment> with
spacing: 16, spacing: 16,
children: [ children: [
Text(context.translation.allWorkOrder, style: AppTextStyles.heading4.copyWith(color: AppColor.headingTextColor(context))).expanded, Text(context.translation.allWorkOrder, style: AppTextStyles.heading4.copyWith(color: AppColor.headingTextColor(context))).expanded,
if (!isFMSEngineer) // todo commenting this code, for FM
'search'.toSvgAsset(width: 24, height: 24, color: AppColor.headingTextColor(context)).onPress(() { // if (!isFMSEngineer)
Navigator.of(context).pushNamed('/cleaner_search'); // 'search'.toSvgAsset(width: 24, height: 24, color: AppColor.headingTextColor(context)).onPress(() {
}), // Navigator.of(context).pushNamed('/cleaner_search');
// }),
Transform.flip( Transform.flip(
flipY: isAscending, flipY: isAscending,
child: 'dashboard/sort_descending'.toSvgAsset(width: 24, height: 24, color: AppColor.headingTextColor(context)).onPress(() { child: 'dashboard/sort_descending'.toSvgAsset(width: 24, height: 24, color: AppColor.headingTextColor(context)).onPress(() {

@ -4,8 +4,9 @@ class SiteContactInfoModel {
int? siteId; int? siteId;
String? siteName; String? siteName;
String? phoneNumber; String? phoneNumber;
String? extensionNumber;
SiteContactInfoModel({this.id, this.assetGroupId, this.siteId, this.siteName, this.phoneNumber}); SiteContactInfoModel({this.id, this.assetGroupId, this.siteId, this.siteName, this.phoneNumber, this.extensionNumber});
SiteContactInfoModel.fromJson(Map<String, dynamic> json) { SiteContactInfoModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@ -13,6 +14,7 @@ class SiteContactInfoModel {
siteId = json['siteId']; siteId = json['siteId'];
siteName = json['siteName']; siteName = json['siteName'];
phoneNumber = json['phoneNumber']; phoneNumber = json['phoneNumber'];
extensionNumber = json['extensionNumber'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -22,6 +24,7 @@ class SiteContactInfoModel {
data['siteId'] = this.siteId; data['siteId'] = this.siteId;
data['siteName'] = this.siteName; data['siteName'] = this.siteName;
data['phoneNumber'] = this.phoneNumber; data['phoneNumber'] = this.phoneNumber;
data['extensionNumber'] = this.extensionNumber;
return data; return data;
} }
} }

@ -47,6 +47,13 @@ class _ExportFormViewState<T> extends State<ExportFormView<T>> {
List<AssetColumnMetadata> selectedColumns = []; List<AssetColumnMetadata> selectedColumns = [];
Lookup? selectedFormat; Lookup? selectedFormat;
@override
void initState() {
// TODO: implement initState
super.initState();
Provider.of<AssetColumnsProvider>(context, listen: false).reset();
}
void _updateSelectedColumns(List<AssetColumnMetadata>? value) { void _updateSelectedColumns(List<AssetColumnMetadata>? value) {
if (value != null && mounted) { if (value != null && mounted) {
setState(() { setState(() {
@ -135,7 +142,9 @@ class _ExportFormViewState<T> extends State<ExportFormView<T>> {
final filePath = await exportProvider.exportData(exportRequest, widget.moduleType, context); final filePath = await exportProvider.exportData(exportRequest, widget.moduleType, context);
if (!mounted) return; if (!mounted) return;
if (filePath != null && filePath.isNotEmpty) { if (filePath != null && filePath.isEmpty) {
// do nothing, as toast handled in method
} else if (filePath != null && filePath.isNotEmpty) {
await FileSuccessDialog.show( await FileSuccessDialog.show(
context: context, context: context,
filePath: filePath, filePath: filePath,
@ -167,7 +176,6 @@ class _ExportFormViewState<T> extends State<ExportFormView<T>> {
); );
} }
//check if we need we can show this as well @waseem //check if we need we can show this as well @waseem
String _getAppSuggestion(String format) { String _getAppSuggestion(String format) {

@ -3,10 +3,13 @@ import 'dart:developer';
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:sn_progress_dialog/sn_progress_dialog.dart'; import 'package:sn_progress_dialog/sn_progress_dialog.dart';
import 'package:test_sa/controllers/api_routes/api_manager.dart'; import 'package:test_sa/controllers/api_routes/api_manager.dart';
import 'package:test_sa/controllers/api_routes/urls.dart'; import 'package:test_sa/controllers/api_routes/urls.dart';
import 'package:test_sa/extensions/string_extensions.dart';
import 'package:test_sa/extensions/text_extensions.dart';
import 'package:test_sa/modules/export_module/models/export_form_model.dart'; import 'package:test_sa/modules/export_module/models/export_form_model.dart';
import 'package:test_sa/modules/export_module/models/export_module_type.dart'; import 'package:test_sa/modules/export_module/models/export_module_type.dart';
import 'package:test_sa/new_views/app_style/app_color.dart'; import 'package:test_sa/new_views/app_style/app_color.dart';
@ -34,7 +37,7 @@ class ExportApiProvider extends ChangeNotifier {
// Use isDarkNotListen to safely access provider without listening // Use isDarkNotListen to safely access provider without listening
final backgroundColor = context.isDarkNotListen ? AppColor.containerDark : Colors.white; final backgroundColor = context.isDarkNotListen ? AppColor.containerDark : Colors.white;
final textColor = context.isDarkNotListen ? AppColor.white10 : AppColor.white936; final textColor = context.isDarkNotListen ? AppColor.white10 : AppColor.white936;
bool isPdCancel = false;
ProgressDialog pd = ProgressDialog(context: context); ProgressDialog pd = ProgressDialog(context: context);
pd.show( pd.show(
max: 100, max: 100,
@ -48,6 +51,14 @@ class ExportApiProvider extends ChangeNotifier {
elevation: 4, elevation: 4,
msgFontSize: 14, msgFontSize: 14,
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
cancel: Cancel(
cancelClicked: () {
isPdCancel = true;
'Export Canceled'.showToast;
pd.close();
},
cancelImageColor: AppColor.icon2ColorNotListen(context),
),
); );
IOSink? sink; IOSink? sink;
@ -100,16 +111,11 @@ class ExportApiProvider extends ChangeNotifier {
lastProgress = progress; lastProgress = progress;
final downloadedMB = (received / 1024 / 1024).toStringAsFixed(2); final downloadedMB = (received / 1024 / 1024).toStringAsFixed(2);
final totalMB = (contentLength / 1024 / 1024).toStringAsFixed(2); final totalMB = (contentLength / 1024 / 1024).toStringAsFixed(2);
pd.update( pd.update(value: progress, msg: 'Exporting: $downloadedMB MB / $totalMB MB');
value: progress,
msg: 'Exporting: $downloadedMB MB / $totalMB MB',
);
} }
} else { } else {
final downloadedMB = (received / 1024 / 1024).toStringAsFixed(2); final downloadedMB = (received / 1024 / 1024).toStringAsFixed(2);
pd.update( pd.update(msg: 'Exporting: $downloadedMB MB');
msg: 'Exporting: $downloadedMB MB',
);
} }
} }
await sink.close(); await sink.close();
@ -123,6 +129,9 @@ class ExportApiProvider extends ChangeNotifier {
} }
pd.close(); pd.close();
final totalTime = DateTime.now().difference(startTime).inMilliseconds; final totalTime = DateTime.now().difference(startTime).inMilliseconds;
if (isPdCancel) {
return "";
}
return filePath; return filePath;
} else { } else {
if (context.mounted) { if (context.mounted) {

@ -182,6 +182,7 @@ class AppColor {
static Color iconColor(BuildContext context) => context.isDark ? neutral30 : neutral50; static Color iconColor(BuildContext context) => context.isDark ? neutral30 : neutral50;
static Color icon2Color(BuildContext context) => context.isDark ? white10 : neutral50; static Color icon2Color(BuildContext context) => context.isDark ? white10 : neutral50;
static Color icon2ColorNotListen(BuildContext context) => context.isDarkNotListen ? white10 : neutral50;
static Color textStyleColor(BuildContext context) => context.isDark ? white10 : neutral50; static Color textStyleColor(BuildContext context) => context.isDark ? white10 : neutral50;

@ -65,10 +65,9 @@ class ContactUsBottomSheet extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 4, spacing: 4,
children: [ children: [
InfoHeaderWidget( InfoHeaderWidget(sites[index].siteName ?? ""),
sites[index].siteName ?? "", InfoTextWidget(label: "Phone Number", value: sites[index].phoneNumber ?? ""),
), InfoTextWidget(label: "Extension", value: sites[index].extensionNumber ?? "-"),
InfoTextWidget(label: sites[index].phoneNumber ?? "", isMsg: true, showEmptyValue: true),
], ],
).expanded, ).expanded,
IconButton( IconButton(

@ -90,13 +90,8 @@ class _AllRequestsSearchPageState extends State<AllRequestsSearchPage> {
title: context.translation.search, title: context.translation.search,
actions: [ actions: [
if (_showResetButton()) if (_showResetButton())
Row( TextButton(
crossAxisAlignment: CrossAxisAlignment.center, onPressed: () {
children: [
Text(
context.translation.reset,
style: AppTextStyles.bodyText2.copyWith(color: const Color(0xFF4A8DB7)),
).paddingAll(8).onPress(() {
setState(() { setState(() {
// search!.resetSearchValues(); // search!.resetSearchValues();
search?.resetSearchValuesAndController(except: null); search?.resetSearchValuesAndController(except: null);
@ -104,9 +99,13 @@ class _AllRequestsSearchPageState extends State<AllRequestsSearchPage> {
search!.endDate = null; search!.endDate = null;
selectedSortOption = SortOrder.descending; selectedSortOption = SortOrder.descending;
}); });
}), },
], style: TextButton.styleFrom(padding: EdgeInsets.zero, tapTargetSize: MaterialTapTargetSize.shrinkWrap),
) child: Text(
'Clear',
style: AppTextStyles.bodyText2.copyWith(color: AppColor.red30),
),
),
], ],
), ),
body: Form( body: Form(

Loading…
Cancel
Save