waft-material 0.16.0

Material Design widgets for Waft
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
//! Flutter counterpart: material_ui's `drawer_theme.dart`.

use waft_embedder::{Clip, Color, lerp_double};
use waft_foundation::{App, DiagnosticsProperty, DoubleProperty};
use waft_painting::{ColorProperty, ShapeBorderRef};
use waft_widgets::{BuildContext, InheritedTheme, InheritedWidget, IntoWidget, KeyRef, WidgetRef};

use crate::theme::Theme;

/// Defines default property values for descendant `Drawer` widgets.
///
/// Descendant widgets obtain the current [`DrawerThemeData`] object
/// using [`DrawerTheme::of`]. Instances of [`DrawerThemeData`] can be
/// customized with [`DrawerThemeData::copy_with`].
///
/// Typically a [`DrawerThemeData`] is specified as part of the
/// overall `Theme` with `ThemeData::drawer_theme`.
///
/// All [`DrawerThemeData`] properties are `null` by default.
///
/// See also:
///
///  * [`DrawerTheme`], an `InheritedWidget` that propagates the theme down its
///    subtree.
///  * `ThemeData`, which describes the overall theme information for the
///    application and can customize a drawer using `ThemeData::drawer_theme`.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct DrawerThemeData {
    /// Overrides the default value of `Drawer::background_color`.
    pub background_color: Option<Color>,

    /// Overrides the default value of `DrawerController::scrim_color`.
    pub scrim_color: Option<Color>,

    /// Overrides the default value of `Drawer::elevation`.
    pub elevation: Option<f64>,

    /// Overrides the default value for `Drawer::shadow_color`.
    pub shadow_color: Option<Color>,

    /// Overrides the default value for `Drawer::surface_tint_color`.
    pub surface_tint_color: Option<Color>,

    /// Overrides the default value of `Drawer::shape`.
    pub shape: Option<ShapeBorderRef>,

    /// Overrides the default value of `Drawer::shape` for an end drawer.
    pub end_shape: Option<ShapeBorderRef>,

    /// Overrides the default value of `Drawer::width`.
    pub width: Option<f64>,

    /// Overrides the default value of `Drawer::clip_behavior`.
    pub clip_behavior: Option<Clip>,
}

crate::theme_data_getters::theme_data_getters! {
    /// Dart's getters of `DrawerThemeData`: the theme data answers with its fields, and a defaults
    /// subclass (Dart's `_...Defaults...(context)`) computes the ones it overrides when they
    /// are read.
    pub trait DrawerThemeDataGetters for DrawerThemeData, fields: drawer_theme_data {
        background_color: Option<Color>,
        scrim_color: Option<Color>,
        elevation: Option<f64>,
        shadow_color: Option<Color>,
        surface_tint_color: Option<Color>,
        shape: Option<ShapeBorderRef>,
        end_shape: Option<ShapeBorderRef>,
        width: Option<f64>,
        clip_behavior: Option<Clip>,
    }
}

impl DrawerThemeData {
    /// Creates a theme that can be used for `ThemeData::drawer_theme` and
    /// [`DrawerTheme`]; Dart's optional named arguments are the fluent setters.
    pub fn new() -> DrawerThemeData {
        DrawerThemeData::default()
    }

    /// Dart `DrawerThemeData(backgroundColor:)`.
    pub fn background_color(mut self, background_color: Color) -> DrawerThemeData {
        self.background_color = Some(background_color);
        self
    }

    /// Dart `DrawerThemeData(scrimColor:)`.
    pub fn scrim_color(mut self, scrim_color: Color) -> DrawerThemeData {
        self.scrim_color = Some(scrim_color);
        self
    }

    /// Dart `DrawerThemeData(elevation:)`.
    pub fn elevation(mut self, elevation: f64) -> DrawerThemeData {
        self.elevation = Some(elevation);
        self
    }

    /// Dart `DrawerThemeData(shadowColor:)`.
    pub fn shadow_color(mut self, shadow_color: Color) -> DrawerThemeData {
        self.shadow_color = Some(shadow_color);
        self
    }

    /// Dart `DrawerThemeData(surfaceTintColor:)`.
    pub fn surface_tint_color(mut self, surface_tint_color: Color) -> DrawerThemeData {
        self.surface_tint_color = Some(surface_tint_color);
        self
    }

    /// Dart `DrawerThemeData(shape:)`.
    pub fn shape(mut self, shape: impl Into<ShapeBorderRef>) -> DrawerThemeData {
        self.shape = Some(shape.into());
        self
    }

    /// Dart `DrawerThemeData(endShape:)`.
    pub fn end_shape(mut self, end_shape: impl Into<ShapeBorderRef>) -> DrawerThemeData {
        self.end_shape = Some(end_shape.into());
        self
    }

    /// Dart `DrawerThemeData(width:)`.
    pub fn width(mut self, width: f64) -> DrawerThemeData {
        self.width = Some(width);
        self
    }

    /// Dart `DrawerThemeData(clipBehavior:)`.
    pub fn clip_behavior(mut self, clip_behavior: Clip) -> DrawerThemeData {
        self.clip_behavior = Some(clip_behavior);
        self
    }

    /// Creates a copy of this object with the given fields replaced with the
    /// new values.
    ///
    /// Dart's named arguments are the fluent setters on the copy
    /// (`data.copy_with().width(300.0)`).
    pub fn copy_with(&self) -> DrawerThemeData {
        self.clone()
    }

    /// Linearly interpolate between two drawer themes.
    ///
    /// If both arguments are null, then null is returned.
    ///
    /// {@macro dart.ui.shadow.lerp}
    pub fn lerp(
        a: Option<&DrawerThemeData>,
        b: Option<&DrawerThemeData>,
        t: f64,
    ) -> Option<DrawerThemeData> {
        match (a, b) {
            (None, None) => return None,
            (Some(a), Some(b)) if std::ptr::eq(a, b) => return Some(a.clone()),
            _ => {}
        }
        Some(DrawerThemeData {
            background_color: Color::lerp(
                a.and_then(|a| a.background_color),
                b.and_then(|b| b.background_color),
                t,
            ),
            scrim_color: Color::lerp(
                a.and_then(|a| a.scrim_color),
                b.and_then(|b| b.scrim_color),
                t,
            ),
            elevation: lerp_double(a.and_then(|a| a.elevation), b.and_then(|b| b.elevation), t),
            shadow_color: Color::lerp(
                a.and_then(|a| a.shadow_color),
                b.and_then(|b| b.shadow_color),
                t,
            ),
            surface_tint_color: Color::lerp(
                a.and_then(|a| a.surface_tint_color),
                b.and_then(|b| b.surface_tint_color),
                t,
            ),
            shape: ShapeBorderRef::lerp(
                a.and_then(|a| a.shape.as_ref()),
                b.and_then(|b| b.shape.as_ref()),
                t,
            ),
            end_shape: ShapeBorderRef::lerp(
                a.and_then(|a| a.end_shape.as_ref()),
                b.and_then(|b| b.end_shape.as_ref()),
                t,
            ),
            width: lerp_double(a.and_then(|a| a.width), b.and_then(|b| b.width), t),
            clip_behavior: if t < 0.5 {
                a.and_then(|a| a.clip_behavior)
            } else {
                b.and_then(|b| b.clip_behavior)
            },
        })
    }
}

/// An inherited widget that defines visual properties for `Drawer`s in this
/// widget's subtree.
///
/// Values specified here are used for `Drawer` properties that are not
/// given an explicit non-null value.
///
/// Using this would allow you to override the `ThemeData::drawer_theme`.
#[derive(Debug)]
pub struct DrawerTheme {
    pub key: Option<KeyRef>,
    /// Specifies the background color, scrim color, elevation, and shape for
    /// descendant `Drawer` widgets.
    pub data: DrawerThemeData,
    pub child: WidgetRef,
}

impl DrawerTheme {
    /// Creates a theme that defines the [`DrawerThemeData`] properties for a
    /// `Drawer`.
    #[cfg_attr(debug_assertions, track_caller)]
    pub fn new<K>(data: DrawerThemeData, child: impl IntoWidget<K>) -> DrawerTheme {
        DrawerTheme {
            key: None,
            data,
            child: child.into_widget(),
        }
    }

    /// Dart `DrawerTheme(key:)`.
    pub fn key(mut self, key: KeyRef) -> DrawerTheme {
        self.key = Some(key);
        self
    }

    /// Retrieves the [`DrawerThemeData`] from the closest ancestor [`DrawerTheme`].
    ///
    /// If there is no enclosing [`DrawerTheme`] widget, then
    /// `ThemeData::drawer_theme` is used.
    ///
    /// Typical usage is as follows:
    ///
    /// ```text
    /// let theme = DrawerTheme::of(app, context);
    /// ```
    pub fn of(app: &mut App, context: BuildContext) -> DrawerThemeData {
        match context.depend_on_inherited_widget_of_exact_type::<DrawerTheme>(app) {
            Some(drawer_theme) => drawer_theme.data.clone(),
            None => Theme::of(app, context).drawer_theme.clone(),
        }
    }
}

impl InheritedTheme for DrawerTheme {
    fn wrap(&self, _app: &mut App, _context: BuildContext, child: WidgetRef) -> WidgetRef {
        DrawerTheme::new(self.data.clone(), child).into_widget()
    }
}

impl InheritedWidget for DrawerTheme {
    fn key(&self) -> Option<&KeyRef> {
        self.key.as_ref()
    }

    fn child(&self) -> &WidgetRef {
        &self.child
    }

    fn update_should_notify(&self, old_widget: &DrawerTheme) -> bool {
        self.data != old_widget.data
    }

    fn as_inherited_theme(&self) -> Option<&dyn InheritedTheme> {
        Some(self)
    }
}

impl waft_foundation::Diagnosticable for DrawerThemeData {
    fn debug_fill_properties(&self, properties: &mut waft_foundation::DiagnosticPropertiesBuilder) {
        properties
            .add(ColorProperty::new("backgroundColor", self.background_color).default_value(None));
        properties.add(ColorProperty::new("scrimColor", self.scrim_color).default_value(None));
        properties.add(DoubleProperty::new("elevation", self.elevation).default_value(None));
        properties.add(ColorProperty::new("shadowColor", self.shadow_color).default_value(None));
        properties.add(
            ColorProperty::new("surfaceTintColor", self.surface_tint_color).default_value(None),
        );
        properties.add(
            DiagnosticsProperty::<ShapeBorderRef>::new("shape", self.shape.clone())
                .default_value(None),
        );
        properties.add(
            DiagnosticsProperty::<ShapeBorderRef>::new("endShape", self.end_shape.clone())
                .default_value(None),
        );
        properties.add(DoubleProperty::new("width", self.width).default_value(None));
        properties.add(
            DiagnosticsProperty::<waft_foundation::DartEnum<Clip>>::new(
                "clipBehavior",
                self.clip_behavior.map(waft_foundation::DartEnum),
            )
            .default_value(None),
        );
    }
}

impl std::fmt::Display for DrawerThemeData {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(&waft_foundation::Diagnosticable::to_string(self))
    }
}

#[cfg(test)]
pub(crate) mod tests {
    use std::cell::RefCell;
    use std::rc::Rc;
    use waft_painting::ShapeBorder;

    use waft_painting::{BorderRadiusGeometry, BorderSide, RoundedRectangleBorder};
    use waft_widgets::{Builder, SizedBox};

    use waft_widgets::testing::{WidgetTester, test_widgets};

    use super::*;
    use crate::colors::Colors;
    use crate::theme_data::ThemeData;

    /// Builds `wrap(probe)` and returns what `read` saw at the probe's context.
    pub(crate) fn probe<T: 'static>(
        tester: &mut WidgetTester,
        wrap: impl FnOnce(&App, WidgetRef) -> WidgetRef,
        read: impl Fn(&mut App, BuildContext) -> T + 'static,
    ) -> T {
        let seen = Rc::new(RefCell::new(None));
        let probe = Builder::new({
            let seen = Rc::clone(&seen);
            move |app, context| {
                *seen.borrow_mut() = Some(read(app, context));
                SizedBox::shrink().into_widget()
            }
        })
        .into_widget();
        let root = wrap(&tester.cell.borrow(), probe);
        tester.pump_widget(root);
        let value = seen.borrow_mut().take();
        value.expect("the probe built")
    }

    /// What `read` sees at a probe that is wrapped, by `<dyn InheritedTheme>::capture`, in the
    /// inherited themes above a first probe, and then built under `shadowed_by`.
    ///
    /// Dart's `InheritedTheme.captureAll` / `CapturedThemes.wrap` on a theme `captured_under`
    /// puts above the first probe: the wrapped probe sees that theme, not the one
    /// `shadowed_by` puts above it.
    pub(crate) fn theme_seen_through_capture<T: 'static>(
        tester: &mut WidgetTester,
        captured_under: impl FnOnce(WidgetRef) -> WidgetRef,
        shadowed_by: impl FnOnce(WidgetRef) -> WidgetRef,
        read: impl Fn(&mut App, BuildContext) -> T + 'static,
    ) -> T {
        let captured = Rc::new(RefCell::new(None));
        let capturing_probe = Builder::new({
            let captured = Rc::clone(&captured);
            move |app, context| {
                *captured.borrow_mut() = Some(<dyn waft_widgets::InheritedTheme>::capture(
                    app, context, None,
                ));
                SizedBox::shrink().into_widget()
            }
        })
        .into_widget();
        tester.pump_widget(captured_under(capturing_probe));
        let captured = captured.borrow_mut().take().expect("the probe built");
        probe(
            tester,
            |_, reading_probe| shadowed_by(captured.wrap(reading_probe)),
            read,
        )
    }

    fn rounded(radius: f64) -> RoundedRectangleBorder {
        RoundedRectangleBorder::new(BorderSide::NONE, BorderRadiusGeometry::circular(radius))
    }

    #[test]
    fn copy_with_equality_basics() {
        assert_eq!(DrawerThemeData::new(), DrawerThemeData::new().copy_with());

        let theme = DrawerThemeData::new().elevation(4.0).shape(rounded(8.0));
        assert_eq!(theme.copy_with(), theme);
        assert_eq!(theme.copy_with().width(300.0).width, Some(300.0));
        assert_eq!(theme.copy_with().width(300.0).elevation, Some(4.0));
        assert_ne!(theme.copy_with().elevation(5.0), theme);
        assert_ne!(theme.copy_with().shape(rounded(9.0)), theme);
    }

    #[test]
    fn drawer_theme_data_lerp_special_cases() {
        assert_eq!(DrawerThemeData::lerp(None, None, 0.0), None);
        let data = DrawerThemeData::new();
        assert_eq!(
            DrawerThemeData::lerp(Some(&data), Some(&data), 0.5),
            Some(data)
        );
    }

    #[test]
    fn drawer_theme_data_null_fields_by_default() {
        let theme = DrawerThemeData::new();
        assert_eq!(theme.background_color, None);
        assert_eq!(theme.scrim_color, None);
        assert_eq!(theme.elevation, None);
        assert_eq!(theme.shadow_color, None);
        assert_eq!(theme.surface_tint_color, None);
        assert!(theme.shape.is_none());
        assert!(theme.end_shape.is_none());
        assert_eq!(theme.width, None);
        assert_eq!(theme.clip_behavior, None);
    }

    #[test]
    fn drawer_theme_data_lerps_each_field() {
        let a = DrawerThemeData::new()
            .background_color(Colors::BLACK)
            .elevation(2.0)
            .shape(rounded(4.0))
            .width(100.0)
            .clip_behavior(Clip::HardEdge);
        let b = DrawerThemeData::new()
            .background_color(Colors::WHITE)
            .scrim_color(Colors::RED.primary())
            .elevation(6.0)
            .shape(rounded(8.0))
            .end_shape(rounded(8.0))
            .width(300.0)
            .clip_behavior(Clip::AntiAlias);

        let halfway = DrawerThemeData::lerp(Some(&a), Some(&b), 0.5).expect("both given");

        assert_eq!(
            halfway.background_color,
            Color::lerp(Some(Colors::BLACK), Some(Colors::WHITE), 0.5)
        );
        assert_eq!(
            halfway.scrim_color,
            Color::lerp(None, Some(Colors::RED.primary()), 0.5)
        );
        assert_eq!(halfway.elevation, Some(4.0));
        assert_eq!(
            halfway.shape.as_deref(),
            Some(&rounded(6.0) as &dyn ShapeBorder)
        );
        assert_eq!(
            halfway.end_shape.as_deref(),
            ShapeBorderRef::lerp(None, Some(&ShapeBorderRef::new(rounded(8.0))), 0.5).as_deref()
        );
        assert_eq!(halfway.width, Some(200.0));
        assert_eq!(halfway.clip_behavior, Some(Clip::AntiAlias));
        assert_eq!(
            DrawerThemeData::lerp(Some(&a), Some(&b), 0.25)
                .expect("both given")
                .clip_behavior,
            Some(Clip::HardEdge)
        );
    }

    #[test]
    fn of_returns_the_theme_data_drawer_theme_without_an_ancestor() {
        test_widgets(|tester| {
            let expected = DrawerThemeData::new().width(280.0).elevation(3.0);
            let theme_data_drawer = expected.clone();

            let seen = probe(
                tester,
                move |app, child| {
                    let data = ThemeData::builder()
                        .drawer_theme(theme_data_drawer.clone())
                        .build(app);
                    crate::theme::Theme::new(data, child).into_widget()
                },
                DrawerTheme::of,
            );

            assert_eq!(seen, expected);
        });
    }

    #[test]
    fn of_returns_the_closest_drawer_theme_over_theme_data() {
        test_widgets(|tester| {
            let widget_drawer = DrawerThemeData::new().width(100.0);
            let expected = widget_drawer.clone();

            let seen = probe(
                tester,
                move |app, child| {
                    let data = ThemeData::builder()
                        .drawer_theme(DrawerThemeData::new().width(280.0))
                        .build(app);
                    crate::theme::Theme::new(data, DrawerTheme::new(widget_drawer.clone(), child))
                        .into_widget()
                },
                DrawerTheme::of,
            );

            assert_eq!(seen, expected);
        });
    }

    #[test]
    fn a_captured_drawer_theme_is_kept_under_another_drawer_theme() {
        test_widgets(|tester| {
            let captured = DrawerThemeData::new().width(111.0);
            let shadowing = DrawerThemeData::new().width(222.0);

            let seen = theme_seen_through_capture(
                tester,
                |probe| DrawerTheme::new(captured.clone(), probe).into_widget(),
                |wrapped| DrawerTheme::new(shadowing.clone(), wrapped).into_widget(),
                DrawerTheme::of,
            );

            assert_eq!(seen.width, Some(111.0));
        });
    }

    #[test]
    fn update_should_notify_only_when_the_data_differs() {
        let theme = |data: DrawerThemeData| DrawerTheme::new(data, SizedBox::shrink());
        let old = theme(DrawerThemeData::new().width(1.0));

        assert!(!theme(DrawerThemeData::new().width(1.0)).update_should_notify(&old));
        assert!(theme(DrawerThemeData::new().width(2.0)).update_should_notify(&old));
    }

    #[test]
    fn theme_data_holds_the_drawer_theme() {
        test_widgets(|tester| {
            let app = tester.cell.borrow();
            let theme = ThemeData::new(&app);
            assert_eq!(theme.drawer_theme, DrawerThemeData::new());

            let wide = ThemeData::builder()
                .drawer_theme(DrawerThemeData::new().width(300.0))
                .build(&app);
            assert_eq!(wide.drawer_theme.width, Some(300.0));
            assert_ne!(theme, wide);
            assert_eq!(
                theme
                    .copy_with()
                    .drawer_theme(wide.drawer_theme.clone())
                    .build(),
                wide
            );

            let narrow = ThemeData::builder()
                .drawer_theme(DrawerThemeData::new().width(100.0))
                .build(&app);
            assert_eq!(
                ThemeData::lerp(&narrow, &wide, 0.5).drawer_theme.width,
                Some(200.0)
            );
        });
    }
    // Flutter's "Default DrawerThemeData debugFillProperties".
    #[test]
    fn a_drawer_theme_data_describes_nothing_by_default() {
        assert_eq!(
            waft_widgets::testing::describe_properties(|properties| {
                waft_foundation::Diagnosticable::debug_fill_properties(
                    &DrawerThemeData::new(),
                    properties,
                )
            }),
            Vec::<String>::new()
        );
    }

    // drawer_theme_test.dart 'Custom debugFillProperties'.
    #[test]
    fn an_assigned_drawer_theme_describes_every_property() {
        let theme = DrawerThemeData::new()
            .background_color(Color::new(0x00000099))
            .scrim_color(Color::new(0x00000098))
            .elevation(5.0)
            .shadow_color(Color::new(0x00000097))
            .surface_tint_color(Color::new(0x00000096))
            .shape(RoundedRectangleBorder::new(
                BorderSide::NONE,
                BorderRadiusGeometry::circular(2.0),
            ))
            .width(200.0)
            .clip_behavior(Clip::HardEdge);
        let description = waft_widgets::testing::describe_properties(|properties| {
            waft_foundation::Diagnosticable::debug_fill_properties(&theme, properties)
        });
        let description: Vec<String> = description
            .iter()
            .map(|line| waft_rendering::testing::ignoring_hash_codes(line))
            .collect();
        assert_eq!(
            description,
            [
                format!("backgroundColor: {}", Color::new(0x00000099)),
                format!("scrimColor: {}", Color::new(0x00000098)),
                "elevation: 5.0".to_string(),
                format!("shadowColor: {}", Color::new(0x00000097)),
                format!("surfaceTintColor: {}", Color::new(0x00000096)),
                format!(
                    "shape: {}",
                    waft_painting::ShapeBorderRef::from(RoundedRectangleBorder::new(
                        BorderSide::NONE,
                        BorderRadiusGeometry::circular(2.0)
                    ))
                ),
                "width: 200.0".to_string(),
                "clipBehavior: Clip.hardEdge".to_string(),
            ]
        );
    }
}