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) if (isNurse)
IconButton( IconButton(
icon: 'qr'.toSvgAsset(height: 24, width: 24), icon: 'qr'.toSvgAsset(height: 24, width: 24, color: AppColor.icon2Color(context)),
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
visualDensity: VisualDensity.compact, visualDensity: VisualDensity.compact,
tooltip: "QR Code",
onPressed: () { onPressed: () {
ServiceRequestBottomSheet.getQRCodeBottomSheet(context: context); ServiceRequestBottomSheet.getQRCodeBottomSheet(context: context);
}, },

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

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

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

@ -18,8 +18,11 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
final bool showBackButton; final bool showBackButton;
final VoidCallback? onWillPopScope; final VoidCallback? onWillPopScope;
final TextStyle? titleStyle; 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -46,7 +49,7 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
title: Row( title: Row(
children: [ children: [
if (showBackButton) 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) { if (onWillPopScope != null) {
showDialog( showDialog(
context: context, context: context,
@ -65,11 +68,10 @@ class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
}), }),
10.width, 12.width,
Text( Text(
title ?? "", title ?? "",
style: titleStyle ?? style: titleStyle ?? (AppTextStyles.heading5).copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
(context.isTablet() ? AppTextStyles.heading4 : AppTextStyles.heading3).copyWith(fontWeight: FontWeight.w500, color: context.isDark ? AppColor.neutral30 : AppColor.neutral50),
).expanded, ).expanded,
], ],
), ),

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

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

@ -194,7 +194,7 @@ class _MyRequestsPageState extends State<MyRequestsPage> with SingleTickerProvid
], ],
), ),
).onPress(() async { ).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) { if (result != null) {
_search = result; _search = result;
setState(() {}); setState(() {});
@ -227,7 +227,7 @@ class _MyRequestsPageState extends State<MyRequestsPage> with SingleTickerProvid
visualDensity: VisualDensity.compact, visualDensity: VisualDensity.compact,
tooltip: "Filter", tooltip: "Filter",
onPressed: () async { 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) { if (result != null) {
_search = result; _search = result;
setState(() {}); setState(() {});

@ -124,7 +124,7 @@ class _MyAssetsPageState extends State<MyAssetsPage> with SingleTickerProviderSt
], ],
), ),
).onPress(() async { ).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) { if (result != null) {
_searchAsset = result; _searchAsset = result;
} }
@ -167,7 +167,7 @@ class _MyAssetsPageState extends State<MyAssetsPage> with SingleTickerProviderSt
visualDensity: VisualDensity.compact, visualDensity: VisualDensity.compact,
tooltip: "Filter", tooltip: "Filter",
onPressed: () async { 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) { if (result != null) {
_searchAsset = result; _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/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/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/app_filled_button.dart';
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
typedef SelectionBuilderString = String Function(dynamic); typedef SelectionBuilderString = String Function(dynamic);
@ -61,8 +62,9 @@ class _SelectionBottomSheetState<T extends Base> extends State<MultipleSelection
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isAllSelected = _selectedValue.isNotEmpty && (widget.items?.length ?? 0) == _selectedValue.length; bool isAllSelected = _selectedValue.isNotEmpty && (widget.items?.length ?? 0) == _selectedValue.length;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: DefaultAppBar(
title: widget.title.heading5(context).custom(color: AppColor.textStyleColor(context)), title: widget.title,
showBackButtonAsCancel: true,
actions: [ actions: [
if (widget.showCancel) if (widget.showCancel)
AnimatedContainer( 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/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/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/app_filled_button.dart';
import 'package:test_sa/new_views/common_widgets/default_app_bar.dart';
typedef SelectionBuilderString = String Function(dynamic); typedef SelectionBuilderString = String Function(dynamic);
@ -57,8 +58,9 @@ class _SelectionBottomSheetState<T extends Base> extends State<SelectionFullScre
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: DefaultAppBar(
title: widget.title.heading5(context).custom(color: AppColor.textStyleColor(context)), title: widget.title,
showBackButtonAsCancel: true,
actions: [ actions: [
if (widget.showCancel) if (widget.showCancel)
AnimatedContainer( AnimatedContainer(

Loading…
Cancel
Save