@@ -7,6 +7,7 @@ import 'package:flutter/widgets.dart';
7
7
import 'constants.dart' ;
8
8
import 'debug.dart' ;
9
9
import 'material_state.dart' ;
10
+ import 'radio_theme.dart' ;
10
11
import 'theme.dart' ;
11
12
import 'theme_data.dart' ;
12
13
import 'toggleable.dart' ;
@@ -371,11 +372,12 @@ class _RadioState<T> extends State<Radio<T>> with TickerProviderStateMixin, Togg
371
372
Widget build (BuildContext context) {
372
373
assert (debugCheckHasMaterial (context));
373
374
final ThemeData themeData = Theme .of (context);
375
+ final RadioThemeData radioTheme = RadioTheme .of (context);
374
376
final MaterialTapTargetSize effectiveMaterialTapTargetSize = widget.materialTapTargetSize
375
- ?? themeData. radioTheme.materialTapTargetSize
377
+ ?? radioTheme.materialTapTargetSize
376
378
?? themeData.materialTapTargetSize;
377
379
final VisualDensity effectiveVisualDensity = widget.visualDensity
378
- ?? themeData. radioTheme.visualDensity
380
+ ?? radioTheme.visualDensity
379
381
?? themeData.visualDensity;
380
382
Size size;
381
383
switch (effectiveMaterialTapTargetSize) {
@@ -390,7 +392,7 @@ class _RadioState<T> extends State<Radio<T>> with TickerProviderStateMixin, Togg
390
392
391
393
final MaterialStateProperty <MouseCursor > effectiveMouseCursor = MaterialStateProperty .resolveWith <MouseCursor >((Set <MaterialState > states) {
392
394
return MaterialStateProperty .resolveAs <MouseCursor ?>(widget.mouseCursor, states)
393
- ?? themeData. radioTheme.mouseCursor? .resolve (states)
395
+ ?? radioTheme.mouseCursor? .resolve (states)
394
396
?? MaterialStateProperty .resolveAs <MouseCursor >(MaterialStateMouseCursor .clickable, states);
395
397
});
396
398
@@ -400,33 +402,33 @@ class _RadioState<T> extends State<Radio<T>> with TickerProviderStateMixin, Togg
400
402
final Set <MaterialState > inactiveStates = states..remove (MaterialState .selected);
401
403
final Color effectiveActiveColor = widget.fillColor? .resolve (activeStates)
402
404
?? _widgetFillColor.resolve (activeStates)
403
- ?? themeData. radioTheme.fillColor? .resolve (activeStates)
405
+ ?? radioTheme.fillColor? .resolve (activeStates)
404
406
?? _defaultFillColor.resolve (activeStates);
405
407
final Color effectiveInactiveColor = widget.fillColor? .resolve (inactiveStates)
406
408
?? _widgetFillColor.resolve (inactiveStates)
407
- ?? themeData. radioTheme.fillColor? .resolve (inactiveStates)
409
+ ?? radioTheme.fillColor? .resolve (inactiveStates)
408
410
?? _defaultFillColor.resolve (inactiveStates);
409
411
410
412
final Set <MaterialState > focusedStates = states..add (MaterialState .focused);
411
413
final Color effectiveFocusOverlayColor = widget.overlayColor? .resolve (focusedStates)
412
414
?? widget.focusColor
413
- ?? themeData. radioTheme.overlayColor? .resolve (focusedStates)
415
+ ?? radioTheme.overlayColor? .resolve (focusedStates)
414
416
?? themeData.focusColor;
415
417
416
418
final Set <MaterialState > hoveredStates = states..add (MaterialState .hovered);
417
419
final Color effectiveHoverOverlayColor = widget.overlayColor? .resolve (hoveredStates)
418
420
?? widget.hoverColor
419
- ?? themeData. radioTheme.overlayColor? .resolve (hoveredStates)
421
+ ?? radioTheme.overlayColor? .resolve (hoveredStates)
420
422
?? themeData.hoverColor;
421
423
422
424
final Set <MaterialState > activePressedStates = activeStates..add (MaterialState .pressed);
423
425
final Color effectiveActivePressedOverlayColor = widget.overlayColor? .resolve (activePressedStates)
424
- ?? themeData. radioTheme.overlayColor? .resolve (activePressedStates)
426
+ ?? radioTheme.overlayColor? .resolve (activePressedStates)
425
427
?? effectiveActiveColor.withAlpha (kRadialReactionAlpha);
426
428
427
429
final Set <MaterialState > inactivePressedStates = inactiveStates..add (MaterialState .pressed);
428
430
final Color effectiveInactivePressedOverlayColor = widget.overlayColor? .resolve (inactivePressedStates)
429
- ?? themeData. radioTheme.overlayColor? .resolve (inactivePressedStates)
431
+ ?? radioTheme.overlayColor? .resolve (inactivePressedStates)
430
432
?? effectiveActiveColor.withAlpha (kRadialReactionAlpha);
431
433
432
434
return Semantics (
@@ -446,7 +448,7 @@ class _RadioState<T> extends State<Radio<T>> with TickerProviderStateMixin, Togg
446
448
..reactionColor = effectiveActivePressedOverlayColor
447
449
..hoverColor = effectiveHoverOverlayColor
448
450
..focusColor = effectiveFocusOverlayColor
449
- ..splashRadius = widget.splashRadius ?? themeData. radioTheme.splashRadius ?? kRadialReactionRadius
451
+ ..splashRadius = widget.splashRadius ?? radioTheme.splashRadius ?? kRadialReactionRadius
450
452
..downPosition = downPosition
451
453
..isFocused = states.contains (MaterialState .focused)
452
454
..isHovered = states.contains (MaterialState .hovered)
0 commit comments