-
-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored code to move default logic from the State class to the StatefulWidget #131
Conversation
Codecov Report
@@ Coverage Diff @@
## master #131 +/- ##
==========================================
- Coverage 68.86% 64.22% -4.65%
==========================================
Files 8 8
Lines 713 763 +50
==========================================
- Hits 491 490 -1
- Misses 222 273 +51
Continue to review full report at Codecov.
|
_texts.add({ | ||
'text': text, | ||
'pause': widget.pause, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idk why do we need this anyways pause is constant..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YES! You're right! The refactoring helps make this crystal clear.
I'll go one step further... Why should _texts
exist? It should simply reference widget.text
.
I did not remove it because I wondered if there was a grand agenda to its existence. (🤔 I often wonder, "What was the original author thinking?")
I'm happy to reconsider removing it, but I would prefer doing it as a follow-up PR because it will impact other classes and the recent emoji-related changes may need to be tweaked. (I like to avoid too many ideas in a PR because it makes it more challenging to understand what was changed and why.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yaa I also felt that but I haven't included it WavyAnimatedTexKit, maybe it was a thing that all the authors that it might have some use can but never had one 🤔 @aagarwal1012 do you have any idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have seen the code but not ran it(trusting @awhitford with it)
_duration
and_pause
defaults to theStatefulWidget
.textWidgetList
variables._texts
final.const
keywords.