Skip to content

Commit c8fa69b

Browse files
committed
refactor: run dart fix
- apply manually fixes for cast_nullable_to_non_nullable and prefer_final_locals
1 parent 8369736 commit c8fa69b

9 files changed

+243
-202
lines changed

lib/src/animated_icon.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@ part of '../styled_widget.dart';
22

33
// TODO: why extend icon
44
class _StyledAnimatedIconContainer extends Icon {
5+
@override
56
final IconData? icon;
7+
@override
68
final double? size;
9+
@override
710
final Color? color;
11+
@override
812
final String? semanticLabel;
13+
@override
914
final TextDirection? textDirection;
1015

11-
_StyledAnimatedIconContainer(
16+
const _StyledAnimatedIconContainer(
1217
this.icon, {
1318
this.color,
1419
this.semanticLabel,
@@ -24,7 +29,7 @@ class _StyledAnimatedIconContainer extends Icon {
2429

2530
@override
2631
Widget build(BuildContext context) {
27-
_StyledAnimatedModel? animation =
32+
final _StyledAnimatedModel? animation =
2833
_StyledInheritedAnimation.of(context)?.animation;
2934
if (animation == null) {
3035
return super.build(context);
@@ -47,7 +52,7 @@ class _AnimatedIcon extends ImplicitlyAnimatedWidget {
4752
/// Creates a container that animates its parameters implicitly.
4853
///
4954
/// The [curve] and [duration] arguments must not be null.
50-
_AnimatedIcon(
55+
const _AnimatedIcon(
5156
this.icon, {
5257
Key? key,
5358
this.color,
@@ -70,12 +75,6 @@ class _AnimatedIcon extends ImplicitlyAnimatedWidget {
7075

7176
@override
7277
_AnimatedIconState createState() => _AnimatedIconState();
73-
74-
@override
75-
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
76-
super.debugFillProperties(properties);
77-
// TODO: debug
78-
}
7978
}
8079

8180
class _AnimatedIconState extends AnimatedWidgetBaseState<_AnimatedIcon> {

lib/src/animated_text.dart

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,32 @@ part of '../styled_widget.dart';
22

33
// TODO: why extend text
44
class _StyledAnimatedTextContainer extends Text {
5+
@override
56
final String data;
7+
@override
68
final TextStyle? style;
9+
@override
710
final StrutStyle? strutStyle;
11+
@override
812
final TextAlign? textAlign;
13+
@override
914
final TextDirection? textDirection;
15+
@override
1016
final Locale? locale;
17+
@override
1118
final bool? softWrap;
19+
@override
1220
final TextOverflow? overflow;
21+
@override
1322
final double? textScaleFactor;
23+
@override
1424
final int? maxLines;
25+
@override
1526
final String? semanticsLabel;
27+
@override
1628
final TextWidthBasis? textWidthBasis;
1729

18-
_StyledAnimatedTextContainer(
30+
const _StyledAnimatedTextContainer(
1931
this.data, {
2032
this.locale,
2133
this.maxLines,
@@ -45,7 +57,7 @@ class _StyledAnimatedTextContainer extends Text {
4557

4658
@override
4759
Widget build(BuildContext context) {
48-
_StyledAnimatedModel? animation =
60+
final _StyledAnimatedModel? animation =
4961
_StyledInheritedAnimation.of(context)?.animation;
5062
if (animation == null) {
5163
return super.build(context);
@@ -75,7 +87,7 @@ class _AnimatedText extends ImplicitlyAnimatedWidget {
7587
/// Creates a container that animates its parameters implicitly.
7688
///
7789
/// The [curve] and [duration] arguments must not be null.
78-
_AnimatedText(
90+
const _AnimatedText(
7991
this.data, {
8092
Key? key,
8193
this.locale,
@@ -109,12 +121,6 @@ class _AnimatedText extends ImplicitlyAnimatedWidget {
109121

110122
@override
111123
_AnimatedTextState createState() => _AnimatedTextState();
112-
113-
@override
114-
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
115-
super.debugFillProperties(properties);
116-
// TODO: denug variables
117-
}
118124
}
119125

120126
class _AnimatedTextState extends AnimatedWidgetBaseState<_AnimatedText> {
@@ -131,21 +137,31 @@ class _AnimatedTextState extends AnimatedWidgetBaseState<_AnimatedText> {
131137

132138
@override
133139
void forEachTween(TweenVisitor<dynamic> visitor) {
134-
_textScaleFactor = visitor(_textScaleFactor, widget.textScaleFactor,
135-
(dynamic value) => Tween<double>(begin: value as double))
136-
as Tween<double>?;
137-
_fontSize = visitor(_fontSize, widget.style?.fontSize,
138-
(dynamic value) => Tween<double>(begin: value as double))
139-
as Tween<double>?;
140-
_letterSpacing = visitor(_letterSpacing, widget.style?.letterSpacing,
141-
(dynamic value) => Tween<double>(begin: value as double))
142-
as Tween<double>?;
143-
_wordSpacing = visitor(_wordSpacing, widget.style?.wordSpacing,
144-
(dynamic value) => Tween<double>(begin: value as double))
145-
as Tween<double>?;
146-
_height = visitor(_height, widget.style?.height,
147-
(dynamic value) => Tween<double>(begin: value as double))
148-
as Tween<double>?;
140+
_textScaleFactor = visitor(
141+
_textScaleFactor,
142+
widget.textScaleFactor,
143+
(dynamic value) => Tween<double>(begin: value as double),
144+
) as Tween<double>?;
145+
_fontSize = visitor(
146+
_fontSize,
147+
widget.style?.fontSize,
148+
(dynamic value) => Tween<double>(begin: value as double),
149+
) as Tween<double>?;
150+
_letterSpacing = visitor(
151+
_letterSpacing,
152+
widget.style?.letterSpacing,
153+
(dynamic value) => Tween<double>(begin: value as double),
154+
) as Tween<double>?;
155+
_wordSpacing = visitor(
156+
_wordSpacing,
157+
widget.style?.wordSpacing,
158+
(dynamic value) => Tween<double>(begin: value as double),
159+
) as Tween<double>?;
160+
_height = visitor(
161+
_height,
162+
widget.style?.height,
163+
(dynamic value) => Tween<double>(begin: value as double),
164+
) as Tween<double>?;
149165
_decorationThickness = visitor(
150166
_decorationThickness,
151167
widget.style?.decorationThickness,

0 commit comments

Comments
 (0)