Skip to content

Commit db34537

Browse files
committed
[Button] added a bunch of missing passdown props for Pbuttons
1 parent 3d1cafa commit db34537

File tree

1 file changed

+61
-1
lines changed

1 file changed

+61
-1
lines changed

lib/src/widgets/button.dart

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class PButton extends PlatformAdaptingWidget {
1616
final Color androidTextColor;
1717
final Color androidSplashColor;
1818
final double androidElevation;
19+
final double androidFocusElevation;
20+
final double androidHoverElevation;
1921
final double androidHighlightElevation;
2022
final double androidDisabledElevation;
2123
final Clip androidClipBehavior;
@@ -25,8 +27,12 @@ class PButton extends PlatformAdaptingWidget {
2527
final ShapeBorder androidShape;
2628
final Color androidHighlightColor;
2729
final ButtonTextTheme androidTextTheme;
28-
30+
final ValueChanged<bool> androidOnHighlightChanged;
2931
final Color androidDisabledTextColor;
32+
final Color androidFocusColor;
33+
final Color androidHoverColor;
34+
final FocusNode androidFocusNode;
35+
final bool androidAutofocus;
3036

3137
final BorderRadius iosBorderRadius;
3238
final double iosPressedOpacity;
@@ -55,6 +61,13 @@ class PButton extends PlatformAdaptingWidget {
5561
this.androidHighlightColor,
5662
this.androidTextTheme,
5763
this.androidDisabledTextColor,
64+
this.androidOnHighlightChanged,
65+
this.androidFocusColor,
66+
this.androidHoverColor,
67+
this.androidFocusNode,
68+
this.androidAutofocus = false,
69+
this.androidFocusElevation,
70+
this.androidHoverElevation,
5871
TargetPlatform renderPlatform})
5972
: super(key: key, renderPlatform: renderPlatform);
6073

@@ -80,6 +93,13 @@ class PButton extends PlatformAdaptingWidget {
8093
highlightColor: androidHighlightColor,
8194
textTheme: androidTextTheme,
8295
disabledTextColor: androidDisabledTextColor,
96+
onHighlightChanged: androidOnHighlightChanged,
97+
focusColor: androidFocusColor,
98+
hoverColor: androidHoverColor,
99+
focusNode: androidFocusNode,
100+
autofocus: androidAutofocus,
101+
focusElevation: androidFocusElevation,
102+
hoverElevation: androidHoverElevation,
83103
);
84104
};
85105

@@ -131,6 +151,20 @@ class PFlatButton extends PlatformAdaptingWidget {
131151
final double iosMinSize;
132152
final PAlertData iosAlertData;
133153

154+
final ValueChanged<bool> androidOnHighlightChanged;
155+
final ButtonTextTheme androidTextTheme;
156+
final Color androidTextColor;
157+
final Color androidDisabledTextColor;
158+
final Color androidFocusColor;
159+
final Color androidHoverColor;
160+
final Color androidHighlightColor;
161+
final Color androidSplashColor;
162+
final Brightness androidColorBrightness;
163+
final Clip androidClipBehavior;
164+
final FocusNode androidFocusNode;
165+
final bool androidAutofocus;
166+
final MaterialTapTargetSize androidMaterialTapTargetSize;
167+
134168
const PFlatButton(
135169
{Key key,
136170
@required this.child,
@@ -143,6 +177,19 @@ class PFlatButton extends PlatformAdaptingWidget {
143177
this.iosPressedOpacity = 0.1,
144178
this.iosMinSize = 44.0,
145179
this.iosAlertData,
180+
this.androidOnHighlightChanged,
181+
this.androidTextTheme,
182+
this.androidTextColor,
183+
this.androidDisabledTextColor,
184+
this.androidFocusColor,
185+
this.androidHoverColor,
186+
this.androidHighlightColor,
187+
this.androidSplashColor,
188+
this.androidColorBrightness,
189+
this.androidClipBehavior = Clip.none,
190+
this.androidFocusNode,
191+
this.androidAutofocus = false,
192+
this.androidMaterialTapTargetSize,
146193
TargetPlatform renderPlatform})
147194
: super(key: key, renderPlatform: renderPlatform);
148195

@@ -181,6 +228,19 @@ class PFlatButton extends PlatformAdaptingWidget {
181228
disabledColor: disabledColor,
182229
padding: padding,
183230
shape: androidShape,
231+
onHighlightChanged: androidOnHighlightChanged,
232+
textTheme: androidTextTheme,
233+
textColor: androidTextColor,
234+
disabledTextColor: androidDisabledTextColor,
235+
focusColor: androidFocusColor,
236+
hoverColor: androidHoverColor,
237+
highlightColor: androidHighlightColor,
238+
splashColor: androidSplashColor,
239+
colorBrightness: androidColorBrightness,
240+
clipBehavior: androidClipBehavior,
241+
focusNode: androidFocusNode,
242+
autofocus: androidAutofocus,
243+
materialTapTargetSize: androidMaterialTapTargetSize,
184244
);
185245
};
186246

0 commit comments

Comments
 (0)