Actions (Widget of the Week)
HTML-код
- Опубликовано: 7 окт 2024
- Learn more about Actions → goo.gle/3dvrLQK
Abstract: In this Widget of the Week, learn about the widget which complements Focus and Shortcuts to complete Flutter's keyboard shortcuts system.
This video is also subtitled in Chinese, Indonesian, Italian, Japanese, Korean, Portuguese, Spanish, Arabic, and Vietnamese.
Get more tips! → goo.gle/Flutte...
Subscribe to Flutter! → goo.gle/FlutterYT
#WidgetOfTheWeek #Widgets #Flutter
Thanks, very good
Thanks
Is this wonderfully overcomplicated or am I just not understanding how Flutter makes things so fiddlesome?
probably both
Have you seen the video on focus nodes and shortcuts? This video is more of a continuation of that. You shouldn't have a hard time understanding it.
Moreover, I bet you'll understand even better by practice. I oftentimes dedicate a whole day to learn new stuff such as this. You'll feel more powerful at the end. Trust me
I second this as I can't understand (as of now) why didn't Flutter expose a InheritedWidget for intents, actions, etc. I guess there's a precise reason for this not being the case
it is overcomplicated
For most simple use cases, you won't need any of this and should instead use the FocusableActionDetector widget. However, as is true with all software, the larger your app gets, the more abstractions like this start to transition out of "tedious boilerplate" territory and into "helpful organizational guides" territory.
I always wait for new video
Lovely widget
There's certainly beauty in variety! An important part of widgets is convenience and accessibility. We've got all of this for you right here 🙌↓
goo.gle/3y4KfP8
Good 😍
Final?
@@myxzlabs5635 Forgot to rename what?
So what is intent class about?
😍
Thats complex 😓
tak remote control
Sorry, but background music distributes me.
First framework to reach 11.050 open issues, congratulations ...
… and also with over 60k issues closed, while also providing platform support all across mobile and desktop.
Truly this is all thanks to the amazing maintainers and the community that surrounds them - you’re right, that’s worth to be congratulated for 😉
Millions by month of income and thousands of users, yet our bank app made with Flutter has none framework related problem.
Please help I just want want to show a star for 2 sec on list view item or something added or updated into it. For example in OutSystems when a file is updated at different folders then a shining star is appeared and disappeared just like that on list view.
I assume your issue is making it disappear after 2 seconds?
Create a StatefulWidget with a timer you manage from the setter, don't forget to do timer.cancel() in the dispose.
Something like this:
/// Whether star indicator is visible
bool _starIsVisible = false;
bool get starIsVisible => _starIsVisible;
/// Set starIsVisible to true for 1.5 seconds, after which it'll be false again
set starIsVisible(bool value) {
_starIsVisible = value;
// Cancel if still visible so it doesn't disappear after remaining time
_starVisibleTimer?.cancel();
// Set timer to make widget disappear after 1500ms + animation of 500 ms
_starVisibleTimer = Timer(
const Duration(milliseconds: 1500),
() => setState(() => _starIsVisible = false),
);
}
/// Timer to automatically set [starIsVisible] to false to hide the widget,
/// acts like a Future.delayed which can be cancelled
Timer? _starVisibleTimer;
@override
void dispose() {
super.dispose();
_starVisibleTimer?.cancel();
}
Widget build(BuildContext context) {
return AnimatedOpacity(
// On enter ms:200, on leave ms:500
duration: starIsVisible
? const Duration(milliseconds: 200)
: const Duration(milliseconds: 500),
opacity: starIsVisible ? 1.0 : 0.0,
child: Text("Your star Widget/Icon here"),
)
}