Create a central sqflite database for many apps - flutter

I have searched but in vain for an answer to the question: Using sqflite and Flutter is it possible to create a central database which can be accessed by several different Flutter apps? Any suggestion appreciated!

In the case of Android, it is possible with a configuration in the manifest.
Share SQLite database between 2 android apps?
But in iOS, every app runs in a sandbox. Then, the same code won't run in both platforms.

In iOS, Using app group, and you can access shared space with
-[NSFileManagre containerURLForSecurityApplicationGroupIdentifier:] (ref)
you can put your sqflite in that path.

Related

Is it possible to run flutter module on Web

I have existing flutter module being used in native Android/iOS apps.Flutter module is used as I wanted to embed it in existing native Android/iOS app. After searching on internet I came to know that module cannot be used as it is to support web platform.
I am thinking about below approach
Creating new flutter app and copy existing module code (Not a good solution as per me because I will have to maintain 2 repos one for module(to support native platforms) and one for web app support).
Queries:
Has anyone came across such issue and what are the possible ways to
handle this scenario?
Can I embed this flutter app(not flutter module) in native apps?Will this create any
problem?
Please suggest possible solutions?

Changing published mobile application developing language from ionic to flutter

I have a mobile application developed using Ionic. Now I want to redevelop it in flutter and publish a new update, would that be possible? will google play and AppStore allow that?
There is no constraint on development language. But,
You need to use same certificates/keys for iOS App
You need to use same key-store/keys for Android App
If you are using local database or file storage, then you should follow the same path in your newly created app as well. If you are using any third-party library to manage the db or file paths, then it may be in different location altogether. (This one actually happened to me. When I migrated my app from a cross-platform framework to Native the database path got changed in release version)

No implementation found for method getDatabasesPath on channel com.tekartik.sqflite

I have a flutter app, works well on mobile, am trying to have the same app on web. am using moor to sync and store data locally incase there is no internet and when internet is back it syncs with the server. Now when I try to run the same app on the web, moor is complaining
Error: MissingPluginException(No implementation found for method getDatabasesPath on channel com.tekartik.sqflite)
the plugin says it supports web, from here. Am not finding much information on how to resolve this, how can I configure moor to run on the web without that error?
The plugin moor you are using is built on top of sqlite, which itself is not supported on web, and at bottom of moor plugin page also it's mentioned that web support is experimental now.
Sqlite plugin doesn't has support for web yet, but it does support android, ios and Macos. I would suggest anyone facing this problem to use other databases or cloud based databases instead of sqlite if you are using flutter web. Hope the plugin gets supported on web also.
Update:
You can try this example to use sqlite on web, it might work.
Got the same error when first run the web app.
If you follow clean architecture you can easily provide the right "database" instance.
This is what I did:
Create a local data store interface
Check if web using kIsWeb
If kIsWeb it true I return an in memory cache otherwise I just return the mobile app database that you already implemented for you Android and iOS apps

Flutter - How to use SQFLite package as local storage for Flutter web

I have an existing flutter mobile application, which I want to convert into flutter web application. I used SQFlite as a local storage DB in mobile app, how can I use that for web application?
As far as i know, the web does not support sqlite in any acceptable ways (yes there are in memory solution but no
persistency, see https://github.com/tekartik/sqflite/issues/212).
Since there is no decent solution on the web, as of today, support is not planned.
IndexedDB or any solution on top of it should be considered for storage on the Web.

Is it possible to Flutter apps to write on iCloud/Google drive?

I am new to flutter and am trying to figure out if there is a way in flutter to write a file to iCloud (iOS) or google drive (Android). There seem to be APIs to do this in Swift/Android native dev, but I can't find anything in a flutter.
I essentially want my app to write on a text file in iCloud so that another install of the same app on a different phone by the same user can access that file. I'm trying to do this without my own cloud setup (no firebase etc, since it's so simple and small), so I thought iCloud/gDrive would be perfect.
The icloud_storage package does upload and download with iCloud.
The googleapis package provides rudimentary support for the Drive API. You'd want to use the google_sign_in for authentication as shown here.
I looked into it a while back but didn't continue due to how young it looked.
I've got no experience with iCloud so I can't really help you there, but I think you'd need to write your own platform plugin or use an HTTP API, if one exists.
I know that I'm late to the party but there is this module
https://pub.dev/packages/file_picker
I haven't used it myself but they seem to support iCloud