@@ -345,50 +345,6 @@ class FilledButton extends ButtonStyleButton {
345
345
/// shape's [OutlinedBorder.side] . Typically the default value of an
346
346
/// [OutlinedBorder] 's side is [BorderSide.none] , so an outline is not drawn.
347
347
///
348
- /// ## Material 3 defaults
349
- ///
350
- /// If [ThemeData.useMaterial3] is set to true the following defaults will
351
- /// be used:
352
- ///
353
- /// * `textStyle` - Theme.textTheme.labelLarge
354
- /// * `backgroundColor`
355
- /// * disabled - Theme.colorScheme.onSurface(0.12)
356
- /// * others - Theme.colorScheme.secondaryContainer
357
- /// * `foregroundColor`
358
- /// * disabled - Theme.colorScheme.onSurface(0.38)
359
- /// * others - Theme.colorScheme.onSecondaryContainer
360
- /// * `overlayColor`
361
- /// * hovered - Theme.colorScheme.onSecondaryContainer(0.08)
362
- /// * focused or pressed - Theme.colorScheme.onSecondaryContainer(0.12)
363
- /// * `shadowColor` - Theme.colorScheme.shadow
364
- /// * `surfaceTintColor` - Colors.transparent
365
- /// * `elevation`
366
- /// * disabled - 0
367
- /// * default - 1
368
- /// * hovered - 3
369
- /// * focused or pressed - 1
370
- /// * `padding`
371
- /// * `textScaleFactor <= 1` - horizontal(24)
372
- /// * `1 < textScaleFactor <= 2` - lerp(horizontal(24), horizontal(12))
373
- /// * `2 < textScaleFactor <= 3` - lerp(horizontal(12), horizontal(6))
374
- /// * `3 < textScaleFactor` - horizontal(6)
375
- /// * `minimumSize` - Size(64, 40)
376
- /// * `fixedSize` - null
377
- /// * `maximumSize` - Size.infinite
378
- /// * `side` - null
379
- /// * `shape` - StadiumBorder()
380
- /// * `mouseCursor`
381
- /// * disabled - SystemMouseCursors.basic
382
- /// * others - SystemMouseCursors.click
383
- /// * `visualDensity` - Theme.visualDensity
384
- /// * `tapTargetSize` - Theme.materialTapTargetSize
385
- /// * `animationDuration` - kThemeChangeDuration
386
- /// * `enableFeedback` - true
387
- /// * `alignment` - Alignment.center
388
- /// * `splashFactory` - Theme.splashFactory
389
- ///
390
- /// For the [FilledButton.icon] factory, the start (generally the left) value of
391
- /// [padding] is reduced from 24 to 16.
392
348
@override
393
349
ButtonStyle defaultStyleOf (BuildContext context) {
394
350
switch (_variant) {
@@ -408,12 +364,10 @@ class FilledButton extends ButtonStyleButton {
408
364
}
409
365
410
366
EdgeInsetsGeometry _scaledPadding (BuildContext context) {
411
- final bool useMaterial3 = Theme .of (context).useMaterial3;
412
- final double padding1x = useMaterial3 ? 24.0 : 16.0 ;
413
367
return ButtonStyleButton .scaledPadding (
414
- EdgeInsets .symmetric (horizontal: padding1x ),
415
- EdgeInsets .symmetric (horizontal: padding1x / 2 ),
416
- EdgeInsets .symmetric (horizontal: padding1x / 2 / 2 ),
368
+ const EdgeInsets .symmetric (horizontal: 16 ),
369
+ const EdgeInsets .symmetric (horizontal: 8 ),
370
+ const EdgeInsets .symmetric (horizontal: 4 ),
417
371
MediaQuery .textScaleFactorOf (context),
418
372
);
419
373
}
@@ -513,13 +467,7 @@ class _FilledButtonWithIcon extends FilledButton {
513
467
514
468
@override
515
469
ButtonStyle defaultStyleOf (BuildContext context) {
516
- final bool useMaterial3 = Theme .of (context).useMaterial3;
517
- final EdgeInsetsGeometry scaledPadding = useMaterial3 ? ButtonStyleButton .scaledPadding (
518
- const EdgeInsetsDirectional .fromSTEB (16 , 0 , 24 , 0 ),
519
- const EdgeInsetsDirectional .fromSTEB (8 , 0 , 12 , 0 ),
520
- const EdgeInsetsDirectional .fromSTEB (4 , 0 , 6 , 0 ),
521
- MediaQuery .textScaleFactorOf (context),
522
- ) : ButtonStyleButton .scaledPadding (
470
+ final EdgeInsetsGeometry scaledPadding = ButtonStyleButton .scaledPadding (
523
471
const EdgeInsetsDirectional .fromSTEB (12 , 0 , 16 , 0 ),
524
472
const EdgeInsets .symmetric (horizontal: 8 ),
525
473
const EdgeInsetsDirectional .fromSTEB (8 , 0 , 4 , 0 ),
0 commit comments