diff --git a/apps/health_campaign_field_worker_app/lib/pages/beneficiary/side_effects.dart b/apps/health_campaign_field_worker_app/lib/pages/beneficiary/side_effects.dart index 606ca265d..ec25d4145 100644 --- a/apps/health_campaign_field_worker_app/lib/pages/beneficiary/side_effects.dart +++ b/apps/health_campaign_field_worker_app/lib/pages/beneficiary/side_effects.dart @@ -229,11 +229,10 @@ class _SideEffectsPageState extends LocalizedState { ), ], ), - const DigitDivider(), Align( alignment: Alignment.topLeft, child: Padding( - padding: const EdgeInsets.all(8), + padding: const EdgeInsets.only(left: 0, right: kPadding, top: kPadding*2, bottom: kPadding*2), child: Text( '${localizations.translate( i18.adverseEvents diff --git a/packages/digit_components/lib/widgets/atoms/digit_dropdown.dart b/packages/digit_components/lib/widgets/atoms/digit_dropdown.dart index ce367c743..497058113 100644 --- a/packages/digit_components/lib/widgets/atoms/digit_dropdown.dart +++ b/packages/digit_components/lib/widgets/atoms/digit_dropdown.dart @@ -1,3 +1,4 @@ +import 'package:digit_components/digit_components.dart'; import 'package:flutter/material.dart'; import 'package:reactive_forms/reactive_forms.dart'; @@ -26,7 +27,7 @@ class DigitDropdown extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( - padding: const EdgeInsets.only(top: 16), + padding: const EdgeInsets.only(top: kPadding*2), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -34,7 +35,7 @@ class DigitDropdown extends StatelessWidget { '$label${isRequired ? ' *' : ''}', style: Theme.of(context).textTheme.bodyLarge, ), - const SizedBox(height: 8), + const SizedBox(height: kPadding), ReactiveDropdownField( onChanged: (control) { final value = control.value; @@ -44,7 +45,7 @@ class DigitDropdown extends StatelessWidget { validationMessages: validationMessages, formControlName: formControlName, decoration: const InputDecoration( - contentPadding: EdgeInsets.fromLTRB(16, 12, 0, 12), + contentPadding: EdgeInsets.fromLTRB(kPadding*2, 12, kPadding, 12), ), items: menuItems .map( diff --git a/packages/digit_components/lib/widgets/atoms/digit_reactive_dropdown.dart b/packages/digit_components/lib/widgets/atoms/digit_reactive_dropdown.dart index 270967c4a..3ff036778 100644 --- a/packages/digit_components/lib/widgets/atoms/digit_reactive_dropdown.dart +++ b/packages/digit_components/lib/widgets/atoms/digit_reactive_dropdown.dart @@ -33,7 +33,7 @@ class DigitReactiveDropdown extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( - padding: padding ?? const EdgeInsets.only(top: 16), + padding: padding ?? const EdgeInsets.only(top: kPadding*2), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -41,7 +41,7 @@ class DigitReactiveDropdown extends StatelessWidget { '$label${isRequired ? ' *' : ''}', style: Theme.of(context).textTheme.bodyLarge, ), - const SizedBox(height: 8), + const SizedBox(height: kPadding), Container( color: isDisabled ? const DigitColors().seaShellGray @@ -59,7 +59,7 @@ class DigitReactiveDropdown extends StatelessWidget { validationMessages: validationMessages, formControlName: formControlName, decoration: const InputDecoration( - contentPadding: EdgeInsets.fromLTRB(16, 12, 0, 12), + contentPadding: EdgeInsets.fromLTRB(kPadding*2, 12, kPadding, 12), ), items: menuItems .map( diff --git a/packages/digit_components/lib/widgets/atoms/digit_toaster.dart b/packages/digit_components/lib/widgets/atoms/digit_toaster.dart index 3851cdff5..ce0bf5960 100644 --- a/packages/digit_components/lib/widgets/atoms/digit_toaster.dart +++ b/packages/digit_components/lib/widgets/atoms/digit_toaster.dart @@ -1,3 +1,4 @@ +import 'package:digit_components/digit_components.dart'; import 'package:digit_components/theme/digit_theme.dart'; import 'package:flutter/material.dart'; import 'package:fluttertoast/fluttertoast.dart'; @@ -18,12 +19,15 @@ class DigitToast { }) { ftoast.init(context); + final theme = Theme.of(context); + return ftoast.showToast( child: Container( color: options.isError ? options.theme.colorScheme.error : options.theme.colorScheme.onSurfaceVariant, - padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 12.0), + padding: const EdgeInsets.symmetric( + horizontal: kPadding, vertical: 12.0), child: Row( mainAxisSize: MainAxisSize.min, children: [ @@ -32,22 +36,37 @@ class DigitToast { color: Colors.white, ), const SizedBox( - width: 12.0, + width: kPadding*2, ), Expanded( - child: Text( - options.message, - style: const TextStyle(color: Colors.white), - )), + child: Text( + options.message, + style: TextStyle( + fontSize: theme.textTheme.bodyLarge?.fontSize, + fontWeight: theme.textTheme.bodyLarge?.fontWeight, + color: const DigitColors().white, + ), + ), + ), + GestureDetector( + onTap: () { + ftoast.removeCustomToast(); + }, + child: Icon( + Icons.close, + color: const DigitColors().white, + ), + ), ], ), ), - gravity: ToastGravity.BOTTOM, + gravity: ToastGravity.SNACKBAR, toastDuration: DigitTheme.instance.toastDuration, ); } } + class DigitToastOptions { final String message; final bool isError; diff --git a/packages/digit_components/lib/widgets/digit_checkbox_tile.dart b/packages/digit_components/lib/widgets/digit_checkbox_tile.dart index 501f3ec09..fe7c10df4 100644 --- a/packages/digit_components/lib/widgets/digit_checkbox_tile.dart +++ b/packages/digit_components/lib/widgets/digit_checkbox_tile.dart @@ -1,3 +1,4 @@ +import 'package:digit_components/digit_components.dart'; import 'package:flutter/material.dart'; class DigitCheckboxTile extends StatelessWidget { @@ -21,24 +22,22 @@ class DigitCheckboxTile extends StatelessWidget { final theme = Theme.of(context); return Padding( - padding: margin ?? const EdgeInsets.all(8.0), + padding: padding ?? const EdgeInsets.all(0), child: InkWell( onTap: () => onChanged?.call(!value), child: Padding( - padding: padding ?? - const EdgeInsets.symmetric( - horizontal: 8, - vertical: 8, - ), + padding: const EdgeInsets.only(left: 0, bottom: kPadding*2), child: Row( + mainAxisAlignment: MainAxisAlignment.start, children: [ Icon( value ? Icons.check_box_outlined : Icons.check_box_outline_blank_sharp, color: theme.colorScheme.secondary, + size: kPadding*3, ), - const SizedBox(width: 16), + const SizedBox(width: kPadding*2), Expanded( child: Text( label,