Is runApp() method necessary to create a flutter app? - flutter

dart code
I expected this code to paint a black colored rectangle to screen but it didn't .I'm using flutter framework and I want to know that don't flutter support making apps like these or any mistake in my code. I just
wanted to make run flutter code without built-in flutter framework library
}

Yes, it's necessary. In dart only execute code inside the main method. Not like JavaScript or Python. It's like java/c. The only execution is the main method.

Related

How to make the flutter app shows as it's an IOS version app inside android

I have a flutter app on an android device, it shows the app with the android adaptive things such as the date picker, the app bar, the dialogs...
I want to try a version of the app like it's on IOS, I mean I want that date picker shows as the IOS's, also for the app bar.
I'm pretty sure that this is related to the MediaQuery, but I just don't know what is it.
I know that I can show forcefully the widgets from the Cupertino library, however, I don't want to do it, I want just to get how the app will show when it runs on IOS with the current code.
Thank you !
Wherever you're setting your theme, you can simply set the platform property on it to TargetPlatform.iOS.
This should allow the theming to use iOS-specific widgets rather than their android counterparts. Note that this may not work everywhere; if Dart:io's Platform were used incorrectly in your code or 3rd party code for theming, this would not be overridden.

ImageCache is reset to zero when I open iOS plugin by MethodChannel

I am trying to use iOS image picker plugin in my Flutter using MethodChannel.
But I found that if I open and close the image picker(My Image Picker button), ImageCache is reset to zero.
So NetworkImage gets loading again like it has never been downloaded before.
On the other hand, Flutter's image picker(Flutter Image Picker button) doesn't reset ImageCache to zero so it is fine.
Why is this happening? Did I miss something?
I have tried overriding ImageCache size like below but the problem is not solved:
overriding image cache in Flutter
Please help me...
my app home tab
my app image tab
flutter image picker
I recommend to use flutter package to make developer easier to code and even the package also use MethodChannel, inside code is also coded pretty well such as error handler etc. It is also works for IOS and Android, which is this is the function of Flutter that make developer easier to deploy IOS and Android apps.
You can explore more about this:
https://pub.dev/packages/image_picker
https://pub.dev/packages/cached_network_image/example

How to modify flutter app code automatically

Is it possible that we ship the android app, which just loads a file(like /data/data/com.example/files/data.txt) into the memory, like we load fonts dynamically with loadFontFronList, which can be manually updated by the app automatically.
Thanking you...
Well, it's not possible like you said. but there're plugins by which you can achieve dynamic code at some level.
e.g. : Dynamic Widget , Json Dynamic Widget

Can we add image path (of local database) to the android APP widget (Home Screen Widget)?

Context: I am creating a flutter app wherein the screenshot of a particular app-page needs to be shown in app widget.
On Android side, we are using Kotlin (which I have no idea of, I don't even know if this thing is possible).
Path provided by flutter will be like:
/data/user/0/com.example.myboardapp/app_flutter/20220613_151934.jpg

Custom Flutter Android FirebaseMessagingService

I'm trying to make a custom FirebaseMessagingService in Android for Flutter to execute Kotlin code on receiving a notification in the background. Does anyone have an example of how this can be done while still receiving the notification/message.data in the main flutter app?
Thanks!
I ended up creating a custom flutter plugin that is run in the background using the FirebaseMessaging.onBackgroundMessage(backgroundMessageHandler);