Skip to content

Commit e8b7fe0

Browse files
committed
chore: add shadow in top bottomsheet
1 parent 554a17c commit e8b7fe0

5 files changed

Lines changed: 44 additions & 25 deletions

File tree

app/lib/l10n/gen/ouds_flutter_app_localizations_ar.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ class AppLocalizationsAr extends AppLocalizations {
270270

271271
@override
272272
String get app_components_bottomSheet_description_text =>
273-
'تعرض الأوراق السفلية محتوى ثانوياً مثبتاً في أسفل الشاشة.';
273+
'تعرض Bottom Sheet محتوى ثانوياً مثبتاً في أسفل الشاشة.';
274274

275275
@override
276276
String get app_components_bottomSheet_sheetContent_text =>
@@ -331,7 +331,7 @@ class AppLocalizationsAr extends AppLocalizations {
331331

332332
@override
333333
String get app_components_bottomSheet_modalBottomSheet_showButton_label =>
334-
'إظهار الورقة السفلية';
334+
'إظهار Bottom Sheet';
335335

336336
@override
337337
String get app_components_bottomSheet_modalBottomSheet_close_label => 'إغلاق';

app/lib/l10n/ouds_flutter_ar.arb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@
6060

6161

6262
"@_components_bottom_sheet": {},
63-
"app_components_bottomSheet_description_text": "تعرض الأوراق السفلية محتوى ثانوياً مثبتاً في أسفل الشاشة.",
63+
"app_components_bottomSheet_description_text": "تعرض Bottom Sheet محتوى ثانوياً مثبتاً في أسفل الشاشة.",
6464
"app_components_bottomSheet_sheetContent_text": "محتوى الـ Bottom Sheet.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Donec bibendum erat vel lectus bibendum ultricies. Fusce non vestibulum nibh, sed fermentum purus. Quisque at dui ipsum. Sed maximus nibh vel vestibulum aliquam. Donec porta quam blandit elit ultrices, eget rhoncus mauris faucibus. Duis a elit sit amet tellus aliquam pellentesque. Sed in felis quis ex lacinia suscipit. Vestibulum vel tempus ante, sit amet viverra sem. Proin venenatis urna sit amet tristique consequat. Phasellus ultricies odio non risus vulputate, vel pulvinar sapien pretium. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Proin suscipit purus augue, aliquet finibus libero malesuada eu. Nulla non magna mi.",
6565
"app_components_bottomSheet_standardBottomSheet_description_text": "تتعايش الـ Bottom Sheet القياسية مع محتوى الشاشة الرئيسية، مما يتيح التفاعل مع الاثنين في نفس الوقت.",
6666
"app_components_bottomSheet_standardBottomSheet_collapse_label": "طي",
6767
"app_components_bottomSheet_modalBottomSheet_description_text": "تعرض الـ Bottom Sheet النموذجية محتوى يحجب مؤقتاً التفاعل مع الشاشة الرئيسية.",
68-
"app_components_bottomSheet_modalBottomSheet_showButton_label": "إظهار الورقة السفلية",
68+
"app_components_bottomSheet_modalBottomSheet_showButton_label": "إظهار Bottom Sheet",
6969
"app_components_bottomSheet_modalBottomSheet_close_label": "إغلاق",
7070

7171
"@_components_button": {},

ouds_core/lib/components/bottom_sheet/ouds_bottom_sheet_scaffold.dart

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -257,25 +257,44 @@ class OudsBottomSheetScaffoldState extends State<OudsBottomSheetScaffold>
257257
}
258258
}
259259
: null,
260-
child: Material(
261-
color: bottomSheetTheme.backgroundColor,
262-
elevation: bottomSheetTheme.elevation ?? 0,
263-
shadowColor: bottomSheetTheme.shadowColor,
264-
shape: bottomSheetTheme.shape,
265-
clipBehavior: bottomSheetTheme.clipBehavior ?? Clip.none,
266-
child: SizedBox(
267-
height: _currentHeight,
268-
child: DefaultTextStyle(
269-
style: TextStyle(color: contentColor),
270-
child: IconTheme(
271-
data: IconThemeData(color: contentColor),
272-
child: Column(
273-
mainAxisSize: MainAxisSize.min,
274-
children: [
275-
if (widget.sheetDragHandle)
276-
OudsBottomSheetDefaults.dragHandle(context),
277-
Flexible(child: widget.sheetContent(context)),
278-
],
260+
// Wrap with Container for top shadow, matching Android's
261+
// sheetShadowElevation = OudsTheme.elevations.emphasized.
262+
child: Container(
263+
decoration: BoxDecoration(
264+
borderRadius:
265+
(bottomSheetTheme.shape as RoundedRectangleBorder?)
266+
?.borderRadius,
267+
boxShadow: [
268+
BoxShadow(
269+
color: theme
270+
.colorScheme(context)
271+
.alwaysBlack
272+
.withAlpha((0.30 * 255).round()),
273+
offset: Offset(0, 1),
274+
blurRadius: 2,
275+
spreadRadius: 0,
276+
),
277+
],
278+
),
279+
child: Material(
280+
color: bottomSheetTheme.backgroundColor,
281+
elevation: 0,
282+
shape: bottomSheetTheme.shape,
283+
clipBehavior: bottomSheetTheme.clipBehavior ?? Clip.none,
284+
child: SizedBox(
285+
height: _currentHeight,
286+
child: DefaultTextStyle(
287+
style: TextStyle(color: contentColor),
288+
child: IconTheme(
289+
data: IconThemeData(color: contentColor),
290+
child: Column(
291+
mainAxisSize: MainAxisSize.min,
292+
children: [
293+
if (widget.sheetDragHandle)
294+
OudsBottomSheetDefaults.dragHandle(context),
295+
Flexible(child: widget.sheetContent(context)),
296+
],
297+
),
279298
),
280299
),
281300
),

ouds_core/lib/l10n/gen/ouds_localizations_ar.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class OudsLocalizationsAr extends OudsLocalizations {
3333
String get core_button_icon_only_a11y => 'أيقونة';
3434

3535
@override
36-
String get core_bottom_sheets_label_a11y => 'النافذة السفلية';
36+
String get core_bottom_sheets_label_a11y => 'Bottom Sheet';
3737

3838
@override
3939
String get core_bottom_sheets_expanded_a11y => 'مفتوحة';

ouds_core/lib/l10n/ouds_flutter_ar.arb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"core_button_icon_only_a11y": "أيقونة",
1212

1313
"@_OUDS_BOTTOM_SHEETS": {},
14-
"core_bottom_sheets_label_a11y": "النافذة السفلية",
14+
"core_bottom_sheets_label_a11y": "Bottom Sheet",
1515
"core_bottom_sheets_expanded_a11y": "مفتوحة",
1616
"core_bottom_sheets_collapsed_a11y": "مطوية",
1717
"core_bottomSheet_dragHandle_a11y": "مقبض السحب",

0 commit comments

Comments
 (0)