|
12 | 12 | */ |
13 | 13 |
|
14 | 14 | import 'package:flutter/material.dart'; |
15 | | -import 'package:ouds_flutter_demo/ui/components/alert/alert_message/alert_enum.dart'; |
| 15 | +import 'package:ouds_flutter_demo/ui/components/alert/alert_enum.dart'; |
16 | 16 | import 'package:ouds_flutter_demo/ui/utilities/component/status_enum.dart'; |
17 | 17 | import 'package:ouds_flutter_demo/ui/utilities/customizable/customizable_widget_state.dart'; |
18 | 18 |
|
19 | 19 | /// Section for InheritedWidget to pass data down the widget tree |
20 | | -class _AlertMessageCustomization extends InheritedWidget { |
21 | | - const _AlertMessageCustomization({required super.child, required this.data}); |
| 20 | +class _AlertCustomization extends InheritedWidget { |
| 21 | + const _AlertCustomization({required super.child, required this.data}); |
22 | 22 |
|
23 | | - final AlertMessageCustomizationState data; |
| 23 | + final AlertCustomizationState data; |
24 | 24 |
|
25 | 25 | @override |
26 | | - bool updateShouldNotify(_AlertMessageCustomization oldWidget) => true; |
| 26 | + bool updateShouldNotify(_AlertCustomization oldWidget) => true; |
27 | 27 | } |
28 | 28 |
|
29 | | -/// Main Widget class for AlertMessage customization |
30 | | -class AlertMessageCustomization extends StatefulWidget { |
31 | | - const AlertMessageCustomization({super.key, required this.child}); |
| 29 | +/// Main Widget class for Alert customization |
| 30 | +class AlertCustomization extends StatefulWidget { |
| 31 | + const AlertCustomization({super.key, required this.child}); |
32 | 32 |
|
33 | 33 | final Widget child; |
34 | 34 |
|
35 | 35 | @override |
36 | | - AlertMessageCustomizationState createState() => |
37 | | - AlertMessageCustomizationState(); |
| 36 | + AlertCustomizationState createState() => AlertCustomizationState(); |
38 | 37 |
|
39 | 38 | /// The state from the closest instance of this class that encloses the given context. |
40 | | - static AlertMessageCustomizationState? of(BuildContext context) { |
41 | | - return (context |
42 | | - .dependOnInheritedWidgetOfExactType<_AlertMessageCustomization>()) |
| 39 | + static AlertCustomizationState? of(BuildContext context) { |
| 40 | + return (context.dependOnInheritedWidgetOfExactType<_AlertCustomization>()) |
43 | 41 | ?.data; |
44 | 42 | } |
45 | 43 | } |
46 | 44 |
|
47 | | -/// State for [AlertMessageCustomization]. |
48 | | -class AlertMessageCustomizationState |
49 | | - extends CustomizationWidgetState<AlertMessageCustomization> { |
| 45 | +/// State for [AlertCustomization]. |
| 46 | +class AlertCustomizationState |
| 47 | + extends CustomizationWidgetState<AlertCustomization> { |
50 | 48 | late final StatusState statusState; |
51 | 49 | late final LabelTextState labelTextState; |
52 | 50 | late final DescriptionTextState descriptionTextState; |
@@ -117,7 +115,7 @@ class AlertMessageCustomizationState |
117 | 115 |
|
118 | 116 | @override |
119 | 117 | Widget build(BuildContext context) { |
120 | | - return _AlertMessageCustomization(data: this, child: widget.child); |
| 118 | + return _AlertCustomization(data: this, child: widget.child); |
121 | 119 | } |
122 | 120 | } |
123 | 121 |
|
|
0 commit comments