Is CustomScrollView is better approach than nested listview by applying shrinkwrap true in flutter
I read so many articles and watched many videos
Related
Can flutter flame (https://flame-engine.org/) be used to create a "flame widget" which can be used within a Flutter app? (i.e. as opposed to having a full flame game, for which you might do flutter widget overlays)
For example say you had a Flutter app, but say within Screen/Page XXX one wanted to have a clock widget (analogue). So in this case in terms of in Flutter how you would create the graphics for an analogue clock could Flame be used for this?
If yes are there any examples of how to do this? (be trying to find some with no success so far, so not sure).
All Flame games are added to the GameWidget, and this GameWidget can be put anywhere inside of your Flutter widget tree.
Do note that if you don't want your game to be reset when the widget tree is rebuilt, keep a reference to is outside of the GameWidget.
final game = YourGame();
/// Your flutter widget tree
...
child: GameWidget(game: game);
...
For the specific example you had with an analogue clock it might be possible to use a SpriteAnimationWidget.
When I developed a screen on my android mobile then its looks perfect...but when I run screen on another android mobile then its not looks perfect...what is the solution of this problem
You shouldn't use absolute positioning and absolute sizing, you need to make your app flexible. The main problem that new flutter users face is their content gets overflowed. Most of the times to fix this issue you must wrap your widgets with some sort of scroll, such as SingleChildScrollView.
Check this link for more details regarding overflowing and this link for more details on adaptive apps.
Adding to what Mohammed said, also endeavor to declare your media query heights, widths and work with it at every point you need absolute values.
You can always use MediaQuery to make your app responsive and fit well in any screen. Here, you can find some info about it and a nice video that explains how it works.
use flutter_screenutil plugin , for adapting screen and font size ,
this is the link
https://pub.dev/packages/flutter_screenutil
In addition to what Mohammed said, I'll recommend using "Device preview" during development to see how your app is faring across multiple screen sizes and platforms, and I'll also not recommend fix positioning and sizing instead go for flexible positioning, this is here your use of minAxisSize, maxAxisSize, crossAxisAlignment.stretch and so on will be more useful.
I can't find solution to implement kind of ProgressBar in Widget. I see, that Text component should be changed if has type .timer for example. I see default widget Clock, with nice animation of moving arrow. But am I able to implement custom animation in widget?
According to a Frameworks Engineer on Developer Apple Forum:
Animations and pan/zoom gesture do not work in widgets built with WidgetKits. Checkout https://developer.apple.com/videos/play/wwdc2020/10028/, where what works and doesn't.
Throughout the WWDC20 Meet WidgetKit video mentioned above, Apple stresses that Widgets are not mini-apps, so they don't support gesture based views (like scroll views) or animations. Widgets are meant to only have glanceable information. From WWDC20 Meet WidgetKit Video Transcript:
These widgets are not mini-apps. We do not support scrolling within the widget, interactive elements like switches and other system controls, nor videos or animated images.
I had an app idea and i want to develop it in either flutter or react native. I chose flutter because I want to learn a new language (Dart) and i know it's still in beta but I don't need to care about a lot of users for at-least 2-3 months since i am gonna learn dart first and then develop it. So my question is
Do i have to take care of different screen sizes just like in android or does flutter handle that for me?
Do i have to take care of API levels like android or does flutter take care of that? Thank you.
Do i have to take care of different screen sizes just like in android or does flutter handle that for me?
Like Android, Flutter use DP as unit when sizing it's widgets. So pixel density has no effect.
On the other hand, you still have to make your app "responsive".
Flutter provides a few widgets that help. Such as AspectRatio.
Do i have to take care of API levels like android or does flutter take care of that? Thank you.
Usually, no. There's a plugin for quite a lot of the "low level api".
Sometimes you may need one that hasn't been implemented yet. And you'll need to create it yourself using Platform Channel. You can find help here
This is a late answer, but I hope it will help someone
In responsive UI we don’t use hard-coded values for dimension and
positions.
Use MediaQuery to get the real time size of the window.
Use Flexible and Expanded widgets to get a flexible UI that works
with percentage rather than hard coded values.
Use LayoutBuilder to get the ConstraintBox of the parent widget.
You can get the orientation of the device using MediaQuery or
OrientationBuilder.
from this article
Yes, you have to adjust the size of the UI according to screen size, you can use.
MediaQueryData media = MediaQuery.of(context);
var size = media.size;
this will give you screen size of the device.
I'm creating an Android app for a large screen device. From the User's perspective, I'd like to have at least two, maybe three, lists of objects that they can scroll through.
I was originally thinking of using ListView, but after reading the documentation, it seems ListView is better suited for occupying the entire screen, or activity
Can I have multiple ListViews on the same screen? If not, what would be the easiest way to accomplish this?