@@ -122,30 +122,30 @@ class MenuStyle with Diagnosticable {
122
122
});
123
123
124
124
/// The menu's background fill color.
125
- final MaterialStateProperty <Color ?>? backgroundColor;
125
+ final WidgetStateProperty <Color ?>? backgroundColor;
126
126
127
127
/// The shadow color of the menu's [Material] .
128
128
///
129
129
/// The material's elevation shadow can be difficult to see for dark themes,
130
130
/// so by default the menu classes add a semi-transparent overlay to indicate
131
131
/// elevation. See [ThemeData.applyElevationOverlayColor] .
132
- final MaterialStateProperty <Color ?>? shadowColor;
132
+ final WidgetStateProperty <Color ?>? shadowColor;
133
133
134
134
/// The surface tint color of the menu's [Material] .
135
135
///
136
136
/// See [Material.surfaceTintColor] for more details.
137
- final MaterialStateProperty <Color ?>? surfaceTintColor;
137
+ final WidgetStateProperty <Color ?>? surfaceTintColor;
138
138
139
139
/// The elevation of the menu's [Material] .
140
- final MaterialStateProperty <double ?>? elevation;
140
+ final WidgetStateProperty <double ?>? elevation;
141
141
142
142
/// The padding between the menu's boundary and its child.
143
- final MaterialStateProperty <EdgeInsetsGeometry ?>? padding;
143
+ final WidgetStateProperty <EdgeInsetsGeometry ?>? padding;
144
144
145
145
/// The minimum size of the menu itself.
146
146
///
147
147
/// This value must be less than or equal to [maximumSize] .
148
- final MaterialStateProperty <Size ?>? minimumSize;
148
+ final WidgetStateProperty <Size ?>? minimumSize;
149
149
150
150
/// The menu's size.
151
151
///
@@ -156,31 +156,31 @@ class MenuStyle with Diagnosticable {
156
156
/// To specify menus with a fixed width and the default height use `fixedSize:
157
157
/// Size.fromWidth(320)`. Similarly, to specify a fixed height and the default
158
158
/// width use `fixedSize: Size.fromHeight(100)` .
159
- final MaterialStateProperty <Size ?>? fixedSize;
159
+ final WidgetStateProperty <Size ?>? fixedSize;
160
160
161
161
/// The maximum size of the menu itself.
162
162
///
163
163
/// A [Size.infinite] or null value for this property means that the menu's
164
164
/// maximum size is not constrained.
165
165
///
166
166
/// This value must be greater than or equal to [minimumSize] .
167
- final MaterialStateProperty <Size ?>? maximumSize;
167
+ final WidgetStateProperty <Size ?>? maximumSize;
168
168
169
169
/// The color and weight of the menu's outline.
170
170
///
171
171
/// This value is combined with [shape] to create a shape decorated with an
172
172
/// outline.
173
- final MaterialStateProperty <BorderSide ?>? side;
173
+ final WidgetStateProperty <BorderSide ?>? side;
174
174
175
175
/// The shape of the menu's underlying [Material] .
176
176
///
177
177
/// This shape is combined with [side] to create a shape decorated with an
178
178
/// outline.
179
- final MaterialStateProperty <OutlinedBorder ?>? shape;
179
+ final WidgetStateProperty <OutlinedBorder ?>? shape;
180
180
181
181
/// The cursor for a mouse pointer when it enters or is hovering over this
182
182
/// menu's [InkWell] .
183
- final MaterialStateProperty <MouseCursor ?>? mouseCursor;
183
+ final WidgetStateProperty <MouseCursor ?>? mouseCursor;
184
184
185
185
/// Defines how compact the menu's layout will be.
186
186
///
@@ -250,17 +250,17 @@ class MenuStyle with Diagnosticable {
250
250
/// Returns a copy of this MenuStyle with the given fields replaced with
251
251
/// the new values.
252
252
MenuStyle copyWith ({
253
- MaterialStateProperty <Color ?>? backgroundColor,
254
- MaterialStateProperty <Color ?>? shadowColor,
255
- MaterialStateProperty <Color ?>? surfaceTintColor,
256
- MaterialStateProperty <double ?>? elevation,
257
- MaterialStateProperty <EdgeInsetsGeometry ?>? padding,
258
- MaterialStateProperty <Size ?>? minimumSize,
259
- MaterialStateProperty <Size ?>? fixedSize,
260
- MaterialStateProperty <Size ?>? maximumSize,
261
- MaterialStateProperty <BorderSide ?>? side,
262
- MaterialStateProperty <OutlinedBorder ?>? shape,
263
- MaterialStateProperty <MouseCursor ?>? mouseCursor,
253
+ WidgetStateProperty <Color ?>? backgroundColor,
254
+ WidgetStateProperty <Color ?>? shadowColor,
255
+ WidgetStateProperty <Color ?>? surfaceTintColor,
256
+ WidgetStateProperty <double ?>? elevation,
257
+ WidgetStateProperty <EdgeInsetsGeometry ?>? padding,
258
+ WidgetStateProperty <Size ?>? minimumSize,
259
+ WidgetStateProperty <Size ?>? fixedSize,
260
+ WidgetStateProperty <Size ?>? maximumSize,
261
+ WidgetStateProperty <BorderSide ?>? side,
262
+ WidgetStateProperty <OutlinedBorder ?>? shape,
263
+ WidgetStateProperty <MouseCursor ?>? mouseCursor,
264
264
VisualDensity ? visualDensity,
265
265
AlignmentGeometry ? alignment,
266
266
}) {
@@ -313,41 +313,31 @@ class MenuStyle with Diagnosticable {
313
313
return a;
314
314
}
315
315
return MenuStyle (
316
- backgroundColor: MaterialStateProperty .lerp <Color ?>(
316
+ backgroundColor: WidgetStateProperty .lerp <Color ?>(
317
317
a? .backgroundColor,
318
318
b? .backgroundColor,
319
319
t,
320
320
Color .lerp,
321
321
),
322
- shadowColor: MaterialStateProperty .lerp <Color ?>(
323
- a? .shadowColor,
324
- b? .shadowColor,
325
- t,
326
- Color .lerp,
327
- ),
328
- surfaceTintColor: MaterialStateProperty .lerp <Color ?>(
322
+ shadowColor: WidgetStateProperty .lerp <Color ?>(a? .shadowColor, b? .shadowColor, t, Color .lerp),
323
+ surfaceTintColor: WidgetStateProperty .lerp <Color ?>(
329
324
a? .surfaceTintColor,
330
325
b? .surfaceTintColor,
331
326
t,
332
327
Color .lerp,
333
328
),
334
- elevation: MaterialStateProperty .lerp <double ?>(a? .elevation, b? .elevation, t, lerpDouble),
335
- padding: MaterialStateProperty .lerp <EdgeInsetsGeometry ?>(
329
+ elevation: WidgetStateProperty .lerp <double ?>(a? .elevation, b? .elevation, t, lerpDouble),
330
+ padding: WidgetStateProperty .lerp <EdgeInsetsGeometry ?>(
336
331
a? .padding,
337
332
b? .padding,
338
333
t,
339
334
EdgeInsetsGeometry .lerp,
340
335
),
341
- minimumSize: MaterialStateProperty .lerp <Size ?>(a? .minimumSize, b? .minimumSize, t, Size .lerp),
342
- fixedSize: MaterialStateProperty .lerp <Size ?>(a? .fixedSize, b? .fixedSize, t, Size .lerp),
343
- maximumSize: MaterialStateProperty .lerp <Size ?>(a? .maximumSize, b? .maximumSize, t, Size .lerp),
336
+ minimumSize: WidgetStateProperty .lerp <Size ?>(a? .minimumSize, b? .minimumSize, t, Size .lerp),
337
+ fixedSize: WidgetStateProperty .lerp <Size ?>(a? .fixedSize, b? .fixedSize, t, Size .lerp),
338
+ maximumSize: WidgetStateProperty .lerp <Size ?>(a? .maximumSize, b? .maximumSize, t, Size .lerp),
344
339
side: MaterialStateBorderSide .lerp (a? .side, b? .side, t),
345
- shape: MaterialStateProperty .lerp <OutlinedBorder ?>(
346
- a? .shape,
347
- b? .shape,
348
- t,
349
- OutlinedBorder .lerp,
350
- ),
340
+ shape: WidgetStateProperty .lerp <OutlinedBorder ?>(a? .shape, b? .shape, t, OutlinedBorder .lerp),
351
341
mouseCursor: t < 0.5 ? a? .mouseCursor : b? .mouseCursor,
352
342
visualDensity: t < 0.5 ? a? .visualDensity : b? .visualDensity,
353
343
alignment: AlignmentGeometry .lerp (a? .alignment, b? .alignment, t),
@@ -358,69 +348,61 @@ class MenuStyle with Diagnosticable {
358
348
void debugFillProperties (DiagnosticPropertiesBuilder properties) {
359
349
super .debugFillProperties (properties);
360
350
properties.add (
361
- DiagnosticsProperty <MaterialStateProperty <Color ?>>(
351
+ DiagnosticsProperty <WidgetStateProperty <Color ?>>(
362
352
'backgroundColor' ,
363
353
backgroundColor,
364
354
defaultValue: null ,
365
355
),
366
356
);
367
357
properties.add (
368
- DiagnosticsProperty <MaterialStateProperty <Color ?>>(
358
+ DiagnosticsProperty <WidgetStateProperty <Color ?>>(
369
359
'shadowColor' ,
370
360
shadowColor,
371
361
defaultValue: null ,
372
362
),
373
363
);
374
364
properties.add (
375
- DiagnosticsProperty <MaterialStateProperty <Color ?>>(
365
+ DiagnosticsProperty <WidgetStateProperty <Color ?>>(
376
366
'surfaceTintColor' ,
377
367
surfaceTintColor,
378
368
defaultValue: null ,
379
369
),
380
370
);
381
371
properties.add (
382
- DiagnosticsProperty <MaterialStateProperty <double ?>>(
383
- 'elevation' ,
384
- elevation,
385
- defaultValue: null ,
386
- ),
372
+ DiagnosticsProperty <WidgetStateProperty <double ?>>('elevation' , elevation, defaultValue: null ),
387
373
);
388
374
properties.add (
389
- DiagnosticsProperty <MaterialStateProperty <EdgeInsetsGeometry ?>>(
375
+ DiagnosticsProperty <WidgetStateProperty <EdgeInsetsGeometry ?>>(
390
376
'padding' ,
391
377
padding,
392
378
defaultValue: null ,
393
379
),
394
380
);
395
381
properties.add (
396
- DiagnosticsProperty <MaterialStateProperty <Size ?>>(
382
+ DiagnosticsProperty <WidgetStateProperty <Size ?>>(
397
383
'minimumSize' ,
398
384
minimumSize,
399
385
defaultValue: null ,
400
386
),
401
387
);
402
388
properties.add (
403
- DiagnosticsProperty <MaterialStateProperty <Size ?>>('fixedSize' , fixedSize, defaultValue: null ),
389
+ DiagnosticsProperty <WidgetStateProperty <Size ?>>('fixedSize' , fixedSize, defaultValue: null ),
404
390
);
405
391
properties.add (
406
- DiagnosticsProperty <MaterialStateProperty <Size ?>>(
392
+ DiagnosticsProperty <WidgetStateProperty <Size ?>>(
407
393
'maximumSize' ,
408
394
maximumSize,
409
395
defaultValue: null ,
410
396
),
411
397
);
412
398
properties.add (
413
- DiagnosticsProperty <MaterialStateProperty <BorderSide ?>>('side' , side, defaultValue: null ),
399
+ DiagnosticsProperty <WidgetStateProperty <BorderSide ?>>('side' , side, defaultValue: null ),
414
400
);
415
401
properties.add (
416
- DiagnosticsProperty <MaterialStateProperty <OutlinedBorder ?>>(
417
- 'shape' ,
418
- shape,
419
- defaultValue: null ,
420
- ),
402
+ DiagnosticsProperty <WidgetStateProperty <OutlinedBorder ?>>('shape' , shape, defaultValue: null ),
421
403
);
422
404
properties.add (
423
- DiagnosticsProperty <MaterialStateProperty <MouseCursor ?>>(
405
+ DiagnosticsProperty <WidgetStateProperty <MouseCursor ?>>(
424
406
'mouseCursor' ,
425
407
mouseCursor,
426
408
defaultValue: null ,
0 commit comments