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

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

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

Flutter test goldens : possibility to emulate system bars to test SafeArea?

I have a android/ios flutter app.
I handle SafeArea so my design/buttons does (or does not depending on the cases) conflits with system bars (navigation bar, status bar, notch)
But when i run my integration widgets tests (testing the full app with flutter test in headless mode, not in a real/emulated device) and I use the goldens matches (screenshot of the app), no SafeArea is used by the runner, so I can't test theses cases.
Question: is there a way to force/simulate fake SystemsArea to appear on each of my goldens to ensure my app behave normally with it ?
Thanks

Flutter widget preview

Let's suppose i am debugging an already built app and i needed to see the widget/screen and how it looks(without running the application and going through all the different screens to reach the desired one) ,
i know there is an annotation (#preview) in jetpack compose for native android to preview the widget in question isolated from the whole app ,
in the meantime to preview a certain widget i put it in
void main() => runApp(ParticularScreen());
is there any other option ?
ps : i think there is a plugin for vs code called preview
https://marketplace.visualstudio.com/items?itemName=jamesblasco.flutter-preview
i am looking for exactly the same but with android studio

Download file and encrypted file that can only view in my flutter application

I developed flutter app that can download file. But downloaded file (eg image file) can be viewed in Gallery. I want to develop downloaded file that can be viewed only in my flutter app. I used flutter_downloader.
please use this line code:--
String dir = (await getExternalStorageDirectory()).path;
more details visit more...
Flutter or any other framework manages stack for screen navigation,
So in flutter if you navigate to another screen, the old screen goes to the stack in memory, it does not dispose.
In your case
you can use Navigator.pushReplacement instead if Navigator.push.
With Navigator.pushReplacement flutter framework will remove Login Page from stack.
Or
If you don't want to remove your Login Page from your stack,
Just clear your TextField using controller before navigation.