improvements

ui_ux_rollout_merge
Sikander Saleem 2 weeks ago
parent cb1a1475fa
commit 897a75e2c7

@ -121,9 +121,10 @@ class _CMDetailPageState extends State<CMDetailPage> {
}),
if (isNurse)
IconButton(
icon: 'qr'.toSvgAsset(height: 24, width: 24),
icon: 'qr'.toSvgAsset(height: 24, width: 24, color: AppColor.icon2Color(context)),
padding: EdgeInsets.zero,
visualDensity: VisualDensity.compact,
tooltip: "QR Code",
onPressed: () {
ServiceRequestBottomSheet.getQRCodeBottomSheet(context: context);
},

@ -50,6 +50,7 @@ class ExportApiProvider extends ChangeNotifier {
valueColor: textColor,
elevation: 4,
msgFontSize: 14,
borderRadius: 14,
backgroundColor: backgroundColor,
cancel: Cancel(
cancelClicked: () {

@ -7,6 +7,7 @@ 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_filled_button.dart';
import 'package:test_sa/views/widgets/item_views/info_header_widget.dart';
/// Reusable success dialog for file operations (export, print, etc.)
class FileSuccessDialog {
@ -31,47 +32,25 @@ class FileSuccessDialog {
return Dialog(
backgroundColor: AppColor.background(context),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
side: BorderSide(color: AppColor.borderColor(context)),
borderRadius: BorderRadius.circular(14),
),
child: Padding(
padding: const EdgeInsets.all(24.0),
padding: const EdgeInsets.all(16.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// Close button
Align(
alignment: Alignment.topRight,
child: 'clear'.toSvgAsset(
color: AppColor.icon2Color(context),
width: 18,
height: 18,
).onPress(() {
child: 'clear'.toSvgAsset(color: AppColor.icon2Color(context), width: 18, height: 18).onPress(() {
Navigator.of(dialogContext).pop();
}),
),
// Success icon
'done'.toSvgAsset(color: AppColor.green70, width: 56, height: 56),
const SizedBox(height: 24),
// Title
Text(
title,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: AppColor.headingTextColor(context),
),
textAlign: TextAlign.center,
),
title.heading5(context).custom(fontWeight: FontWeight.w600, color: AppColor.textStyleColor(context)),
const SizedBox(height: 12),
// Message
Text(
message,
style: TextStyle(
fontSize: 18,
color: AppColor.lightTextColor(context),
),
textAlign: TextAlign.center,
),
message.heading6(context).custom(align: TextAlign.center, fontWeight: FontWeight.w500, color: AppColor.lightTextColor(context)),
const SizedBox(height: 32),
// Action buttons
Row(
@ -84,14 +63,13 @@ class FileSuccessDialog {
final result = await OpenFile.open(filePath);
if (result.type != ResultType.done) {
log('⚠️ Could not open file: ${result.message}');
'No app found to open this file type. File saved to: $filePath'
.showToast;
'No app found to open this file type. File saved to: $filePath'.showToast;
}
},
label: 'Open',
// buttonColor: AppColor.primary10,
showIcon: true,
icon: Icon(Icons.folder_open, color: AppColor.background(context)),
icon: Icon(Icons.folder_open, color: AppColor.background(context)),
height: 48,
),
),
@ -131,4 +109,3 @@ class FileSuccessDialog {
);
}
}

@ -91,6 +91,7 @@ class _DeviceFilterScreenState extends State<DeviceFilterScreen> {
return Scaffold(
appBar: DefaultAppBar(
title: context.translation.filter,
showBackButtonAsCancel: true,
actions: [
if (loading == false && _showResetButton())
TextButton(

@ -61,6 +61,7 @@ class _DeviceSearchScreenState extends State<DeviceSearchScreen> {
return Scaffold(
appBar: DefaultAppBar(
title: context.translation.search,
showBackButtonAsCancel: true,
actions: [
if (_showResetButton())
TextButton(

@ -18,8 +18,11 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
final bool showBackButton;
final VoidCallback? onWillPopScope;
final TextStyle? titleStyle;
final bool showBackButtonAsCancel;
const DefaultAppBar({this.title, this.onBackPress, this.onWillPopScope, this.actions, this.titleStyle, this.showHomeActionButton = false, this.showBackButton = true, Key? key}) : super(key: key);
const DefaultAppBar(
{this.title, this.onBackPress, this.onWillPopScope, this.actions, this.titleStyle, this.showHomeActionButton = false, this.showBackButton = true, this.showBackButtonAsCancel = false, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
@ -46,7 +49,7 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
title: Row(
children: [
if (showBackButton)
Icon(Platform.isIOS ? Icons.arrow_back_ios : Icons.arrow_back).onPress(() {
Icon(showBackButtonAsCancel ? Icons.clear : (Platform.isIOS ? Icons.arrow_back_ios : Icons.arrow_back)).onPress(() {
if (onWillPopScope != null) {
showDialog(
context: context,
@ -65,11 +68,10 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
Navigator.of(context).pop();
}
}),
10.width,
12.width,
Text(
title ?? "",
style: titleStyle ??
(context.isTablet() ? AppTextStyles.heading4 : AppTextStyles.heading3).copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
style: titleStyle ?? (AppTextStyles.heading5).copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
).expanded,
],
),

@ -169,7 +169,7 @@ class _AllRequestsFilterPageState extends State<AllRequestsFilterPage> {
}
return Scaffold(
appBar: DefaultAppBar(
title: context.translation.filter,
title: context.translation.filter,showBackButtonAsCancel: true,
actions: [
if (_showResetButton())
TextButton(

@ -88,6 +88,7 @@ class _AllRequestsSearchPageState extends State<AllRequestsSearchPage> {
// ).paddingOnly(bottom: 75),
appBar: DefaultAppBar(
title: context.translation.search,
showBackButtonAsCancel: true,
actions: [
if (_showResetButton())
TextButton(

@ -194,7 +194,7 @@ class _MyRequestsPageState extends State<MyRequestsPage> with SingleTickerProvid
],
),
).onPress(() async {
final result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => AllRequestsSearchPage(data: _search)));
final result = await Navigator.push(context, CupertinoPageRoute(fullscreenDialog: true, builder: (context) => AllRequestsSearchPage(data: _search)));
if (result != null) {
_search = result;
setState(() {});
@ -227,7 +227,7 @@ class _MyRequestsPageState extends State<MyRequestsPage> with SingleTickerProvid
visualDensity: VisualDensity.compact,
tooltip: "Filter",
onPressed: () async {
final result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => AllRequestsFilterPage(data: _search)));
final result = await Navigator.push(context, CupertinoPageRoute(fullscreenDialog: true, builder: (context) => AllRequestsFilterPage(data: _search)));
if (result != null) {
_search = result;
setState(() {});

@ -99,7 +99,7 @@ class _MyAssetsPageState extends State<MyAssetsPage> with SingleTickerProviderSt
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (!widget.fromBottomBar)
Icon(Platform.isIOS ? Icons.arrow_back_ios : Icons.arrow_back).onPress(() {
Icon(Platform.isIOS ? Icons.arrow_back_ios : Icons.arrow_back).onPress(() {
Navigator.of(context).pop();
}),
Container(
@ -124,7 +124,7 @@ class _MyAssetsPageState extends State<MyAssetsPage> with SingleTickerProviderSt
],
),
).onPress(() async {
final result = await Navigator.push(context, MaterialPageRoute(builder: (context) => const DeviceSearchScreen()));
final result = await Navigator.push(context, CupertinoPageRoute(fullscreenDialog: true, builder: (context) => const DeviceSearchScreen()));
if (result != null) {
_searchAsset = result;
}
@ -167,7 +167,7 @@ class _MyAssetsPageState extends State<MyAssetsPage> with SingleTickerProviderSt
visualDensity: VisualDensity.compact,
tooltip: "Filter",
onPressed: () async {
final result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => DeviceFilterScreen(data: _searchAsset)));
final result = await Navigator.push(context, CupertinoPageRoute(fullscreenDialog: true, builder: (context) => DeviceFilterScreen(data: _searchAsset)));
if (result != null) {
_searchAsset = result;
}

@ -7,6 +7,7 @@ import 'package:test_sa/models/base.dart';
import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
typedef SelectionBuilderString = String Function(dynamic);
@ -61,8 +62,9 @@ class _SelectionBottomSheetState<T extends Base> extends State<MultipleSelection
Widget build(BuildContext context) {
bool isAllSelected = _selectedValue.isNotEmpty && (widget.items?.length ?? 0) == _selectedValue.length;
return Scaffold(
appBar: AppBar(
title: widget.title.heading5(context).custom(color: AppColor.textStyleColor(context)),
appBar: DefaultAppBar(
title: widget.title,
showBackButtonAsCancel: true,
actions: [
if (widget.showCancel)
AnimatedContainer(

@ -7,6 +7,7 @@ import 'package:test_sa/models/base.dart';
import 'package:test_sa/modules/cm_module/views/components/action_button/footer_action_button.dart';
import 'package:test_sa/new_views/app_style/app_color.dart';
import 'package:test_sa/new_views/common_widgets/app_filled_button.dart';
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
typedef SelectionBuilderString = String Function(dynamic);
@ -57,35 +58,36 @@ class _SelectionBottomSheetState<T extends Base> extends State<SelectionFullScre
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: widget.title.heading5(context).custom(color: AppColor.textStyleColor(context)),
appBar: DefaultAppBar(
title: widget.title,
showBackButtonAsCancel: true,
actions: [
if (widget.showCancel)
AnimatedContainer(
height: 24,
duration: const Duration(milliseconds: 250),
margin: const EdgeInsets.only(right: 16),
decoration: BoxDecoration(color: _selectedValue != null ? const Color(0xffF63939).withOpacity(.75) : Colors.grey.withOpacity(.75), borderRadius: BorderRadius.circular(30)),
padding: const EdgeInsets.only(left: 4, right: 8, top: 4, bottom: 4),
alignment: Alignment.center,
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Icon(Icons.clear, color: Colors.white, size: 16),
4.width,
const Text(
"Clear",
style: TextStyle(fontSize: 14, color: Colors.white, height: 1),
)
],
).onPress(_selectedValue != null
? () {
Navigator.pop(context);
widget.onSelect(null);
}
: null),
),
AnimatedContainer(
height: 24,
duration: const Duration(milliseconds: 250),
margin: const EdgeInsets.only(right: 16),
decoration: BoxDecoration(color: _selectedValue != null ? const Color(0xffF63939).withOpacity(.75) : Colors.grey.withOpacity(.75), borderRadius: BorderRadius.circular(30)),
padding: const EdgeInsets.only(left: 4, right: 8, top: 4, bottom: 4),
alignment: Alignment.center,
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Icon(Icons.clear, color: Colors.white, size: 16),
4.width,
const Text(
"Clear",
style: TextStyle(fontSize: 14, color: Colors.white, height: 1),
)
],
).onPress(_selectedValue != null
? () {
Navigator.pop(context);
widget.onSelect(null);
}
: null),
),
],
),
body: Column(

Loading…
Cancel
Save