Skip to content

Commit 3cffad4

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

7 files changed

Lines changed: 49 additions & 27 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+
'Show bottom sheet';
335335

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

app/lib/l10n/gen/ouds_flutter_app_localizations_fr.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ class AppLocalizationsFr extends AppLocalizations {
333333

334334
@override
335335
String get app_components_bottomSheet_modalBottomSheet_showButton_label =>
336-
'Afficher la bottom sheet';
336+
'Show bottom sheet';
337337

338338
@override
339339
String get app_components_bottomSheet_modalBottomSheet_close_label =>

app/lib/l10n/ouds_flutter_ar.arb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,11 @@
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": "إظهار الورقة السفلية",
6968
"app_components_bottomSheet_modalBottomSheet_close_label": "إغلاق",
7069

7170
"@_components_button": {},

app/lib/l10n/ouds_flutter_fr.arb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
"app_components_bottomSheet_standardBottomSheet_description_text": "Les bottom sheets standards coexistent avec le contenu de l'écran principal, permettant aux utilisateurs d'interagir simultanément avec les deux.",
6161
"app_components_bottomSheet_standardBottomSheet_collapse_label": "Replier",
6262
"app_components_bottomSheet_modalBottomSheet_description_text": "La bottom sheet modale affiche un contenu qui bloque temporairement toute interaction avec l'écran principal.",
63-
"app_components_bottomSheet_modalBottomSheet_showButton_label": "Afficher la bottom sheet",
6463
"app_components_bottomSheet_modalBottomSheet_close_label": "Fermer",
6564

6665
"@_components_button": {},

ouds_core/lib/components/bottom_sheet/ouds_bottom_sheet_scaffold.dart

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -257,25 +257,49 @@ 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+
// Negative Y offset to cast shadow upward, since
274+
// the sheet is anchored at the bottom of the screen.
275+
offset: Offset(
276+
0,
277+
-theme.elevationTokens.emphasized / 2,
278+
),
279+
blurRadius: theme.elevationTokens.emphasized,
280+
spreadRadius: 0,
281+
),
282+
],
283+
),
284+
child: Material(
285+
color: bottomSheetTheme.backgroundColor,
286+
elevation: 0,
287+
shape: bottomSheetTheme.shape,
288+
clipBehavior: bottomSheetTheme.clipBehavior ?? Clip.none,
289+
child: SizedBox(
290+
height: _currentHeight,
291+
child: DefaultTextStyle(
292+
style: TextStyle(color: contentColor),
293+
child: IconTheme(
294+
data: IconThemeData(color: contentColor),
295+
child: Column(
296+
mainAxisSize: MainAxisSize.min,
297+
children: [
298+
if (widget.sheetDragHandle)
299+
OudsBottomSheetDefaults.dragHandle(context),
300+
Flexible(child: widget.sheetContent(context)),
301+
],
302+
),
279303
),
280304
),
281305
),

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)