Does Flutter have widgets other than material and cupertino? - flutter

As far as I know Flutter have build in widget system that named material and cupertino. But is there any other widgets sets. I want to build site with Flutter but do not want to make it look as mobile app.

No there isn't any other widget set. Flutters material and cupertino are ment to get your app a native look. They don't have any special functionality than visual design.
If you just want to do your own styling and elements, you can build your widgets by your own. You can read more about it here:
https://www.raywenderlich.com/10126984-creating-reusable-custom-widgets-in-flutter

Related

Flutter: Make text/images selectable in whole web app

In the Flutter web apps, there is no default functionality which makes text and images in the app selectable.
Is there a way to enable selection functionality for text/image on web?
I did check SelectableText widget but it is only for text and I would need to use it over every text. Also, you can't select text in multiple SelectableText widgets at once, you can only select text in one of them. I'm looking for a solution to select all text in the app without making change to every text widget.
Let me know if there’s one step solution to achieve this thing in whole web app.
In Flutter 3.3, with the introduction of the SelectableArea widget, any child of the SelectableArea widget has selection enabled for free!
To take advantage of this powerful new feature, simply wrap your route body (such as the Scaffold) with the SelectionArea widget and let Flutter do the rest.
For a more comprehensive deep dive into this awesome new feature, please visit the SelectableArea API page.
Flutter Web currently does not support multiple text selection across SelectableText widgets.
However, there are some experimental widgets that people are currently working on. According to a guide available at:
Custom SelectableScope Widget
They have proposed a custom widget, a Selectable scope, which basically allows for anything within it to be selectable (currently text and images)
NOTE: THIS IS CURRENTLY UNDER EXPERIMENTATION AND MIGHT CHANGE AS MENTIONED IN THE PROVIDED LINK.

Serialize Flutter Widget

Is there any way to serialize the Build layout of a stateless flutter widget and save it to a database?
I would like to design many simple Badge widgets and don‘t want to update the App each Time I have a new one.
I would like to save new widgets to a db instead.
Remote flutter widgets - may be the direction. It has mechanism for rendering widgets based on declarative UI descriptions that can be obtained & rendered at runtime.

Flutter to native- Calling native android or ios screen as a widget in flutter

I got a requirement to use the natively developed screen as a form of widget in the flutter code.
say i have a screen where half of the screen contains google-map for some height and rest of the design includes some other widgets. Here i want the google-map widget-a natively developed screen in the flutter as a widget(not as a screen directly but as a form of widget).
I want to know whether it is possible to do this way or not if yes how can we achieve this if anyone have any resources or links please share , it would be helpful to me.
Thanks in advance.

how exactly does flutter render widgets?

I mean an illustration of a customized widget in flutter showing how >layouts and >painting are been done during the rendering process?

Is it possible to auto-theme widgets in Flutter?

In Google's mobile framework Flutter, you can build your app using either Cupterino (iOS) widgets or Material Design (Android) widgets. This means you have to build your app twice in order to create two different styles consistent to each device -- one time using Cupertino widgets to build for iOS, and then another time using Material Design widgets to build for Android. Is there a way to auto-theme these widgets to tailor to each platform so I can avoid building a Flutter app twice?
Yes, of course this is possible. You can use the inherited Theme widget to get the ThemeData object of your MaterialApp.
ThemeData has a property called platform, which can be used to supply different widgets for different platforms. In your Android-iOS case, it would look something like this:
#override
Widget build(BuildContext contect) =>
Theme.of(context).platform == TargetPlatform.iOS ? // ternary if statement to check for iOS
CupertinoAlertDialog() : // Cupertino style dialog
AlertDialog(); // Material style dialog
As you can see, you can use a TargetPlatform constant to check on what platform your application is running.
This can obviously also be applied to icons etc.
If you are using the Flutter plugin for Android Studio or IntelliJ IDEA, you can also use the Flutter Inspector to switch the TargetPlatform on the fly, i.e. emulate that the Flutter SDK is running on iOS even though you are on Android and vise versa.