Flutter Hive box empty need hot restart the app - flutter

My flutter app contains hive boxes where it loads objectlist from firebase with a streamprovider for each box.
After uninstall the hole app including the data from the device (real device or simulator) and reinstall the app only loads data in one box, the other 6 boxes contains nothing.
I have to make an hot restart to load all the data from firebase in the other boxes and I don't understand why?
This code runs before the mainscreen of the app is reached, the code is for all boxes the same. Box listAllPeoples is never empty and is called first:
final listAllPeoples = Provider.of<List<People>>(context);
loadingPeoplesStreamInLocalDb(listAllPeoples);
Future loadingPeoplesStreamInLocalDb(List<Peoples> listAllPeoples)async{
await Hive.openBox('listAllPeoples');
await Hive.box('listAllPeoples').clear();
await Hive.box('listAllPeoples').addAll(listAllPeoples);
}

Related

Flutter Firebase DebugView not sending events

Initially the person before me set up a screen observer so that whenever the page changes, setCurrentScreen is triggered to send a event and log the screen. Because we use a bunch of open containers to animate page opening, the screen observer doesnt get triggered. So I went through the app and added some setCurrentScreen for those that the screenObserver missed, and while there I also added some logEvents to see if people are using specific parts of the app.
The way I set enabled debug view was in xcode, going to Product -> Scheme -> Edit Scheme and adding -FIRAnalyticsDebugEnabled and -FIRDebugEnabled Edit scheme
After ticking both of the above (or just one or the other), only these events are being triggered then the app stops sending events. Completely. What am I missing? output
I cannot find another issue about this. I am using the same package name in the app and firebase, otherwise I would have no output. All other issues are talking about no output at all. I have tried to do this on simulator and on actual iPhone and they both yield the same result. I have also set up a android emulator and have an actual phone. Tried it on both and same result. The above screenshot is from iPhone as I am on Mac and more comfortable working on a iPhone.
i have set IS_ANALYTICS_ENABLED to true in the .plist file and this did not work

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

How to Tap on native iOS popup to allow Notifications. (Flutter Integration Test)

Flutter Driver code has to tap on the native "Allow" button to continue and simulate the correct user behaviour.
See this screenshot. Native iOS popup before app starts - Allow Notifications
App has not yet completely started and is waiting for this tap.
How does one get the driver to tap on the native iOS popup?
Any suggestions and ideas are welcome.
Here is the code for one attempt to wait for the app before continuing with other tests; it just awaits indefinitely:
setUpAll(() async {
driver = await FlutterDriver.connect();
await driver.waitUntilFirstFrameRasterized();
});
Here is another attempt at finding the word "Allow" in the popup and tapping on it:
test('Allow app to send Notifications.', () async {
final allow = find.byTooltip("Allow");
await delay(750);
await driver.tap(allow);
});
It does not find the word.
The issue is probably that Flutter Driver is not aware of the iOS native popup.
Other tests are very simple once in the app, for example, to tap on fields, enter text, scroll pages, etc.
Any ideas on how to do this?
Unfortunately this feature is currently not possible. Flutter Driver can't interact with native elements (v1.20.4).
https://github.com/flutter/flutter/issues/34345
https://github.com/flutter/flutter/issues/12561

Flutter not loading HomePage during first run, but loads properly with Hot Reload

I created a navigation menu with the home page as the starting item, but after editing my HomePage and running the app it only shows text with "Home Page" in the center. When I do Hot Reload, it works properly, but not on the first run (Also to note, this occurs only for iOS run, it works properly for Android)
UPDATE: I changed the name of the application via Xcode. So, then in ios/Runner.xcodeproj/project.pbxproj find /* Debug */ = { section, and there change value of PRODUCT_NAME to Runner. After that use flutter clean && flutter run to run the app. It should fix the issue.

Detox test stalls when moving between text inputs iPad

I have followed the instructions at https://github.com/wix/detox, created a few simple tests and run them successfully on an iPhone sim. However, when using an iPad (ios 11.2) it stalls after entering text in the first of two text inputs (for a login screen). My test is as follows
it('should log in and take user to feed', async () => {
await element(by.id('email')).typeText('email')
await element(by.id('password')).typeText('password')
await element(by.id('loginButton')).tap()
await expect(element(by.id('feed'))).toBeVisible()
})
As I say, all tests pass on iPhone but not iPad, and when viewing the sim it clearly hangs between the first and second text field. I've also tried replaceText() which results in a failed test, I think due to this issue with EarlGrey https://github.com/wix/detox/issues/151.
I searched around the problem and I think it's related to this https://github.com/google/EarlGrey/issues/239#issuecomment-247737738. If anyone knows a fix I'd be very grateful.
Thanks.