Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Andrious Solutions
    @Andrious
    I did make some changes to the latest version of mxc_application to make it not fail so blatantly. However, I suspect you'll still get an error on your side. That's because I believe you're returning a 'null' from the init() function for some reason. It would be either Future<false> or Future<true>, but you'll have to 'step through that code' and determine why it is instead returning null.
    I have uploaded, the latest mxc_application package with these modifications. In the screenshot, I have red arrows where I made the changes and one on the init() function where your own code may be generating a 'null' only when in the release apk.
    image.png
    I suspect now what will happen is your app will not progress any farther once it starts up. It will constantly display the loading screen because, your code is returning 'null' in the init() function for one reason or another. That is what I suspect at this point in time.
    jasonlaw
    @jasonlaw
    Hi Greg, I have the same thought as well when I hit the error, which I have returning null from the init() function. However, I couldn't find it after I have checked the code many times. Really have no clue where the null coming from. Anyway, since this issue can be resolved easily so I would work with the solution, even it could be just a workaround.
    Btw, I have another problem with hot reload.
    I found that when hot reload the view is re-created as intended:
    image.png
    However, the initApp is not called after the recreation of view, since it is responsible in calling the AppController.init, failed to call it may give problem to the app, since most of the state value is reset after the recreation of view.
    image.png
    Do you see this a problem?
    jasonlaw
    @jasonlaw
    End up, I found the main culprit is not in initApp, but the AppView,initState is not called after re-create. It seems the sequence of AppView creation is different when in hot reload. After I added the following code in my AppViewState then I get the correct result.
    image.png
    Sorry, I mean the AppView.Init is not called
    Andrious Solutions
    @Andrious
    image.png
    This code in a controller object you wish to run with every hot reload. Possibly, you have it in the wrong controller? Without making such a change as you did above, simply place whatever code that seems to be necessary to run again with every 'reload' in the 'initState()' of the controller indicated in the screenshot.
    You see, looking at your modifications, the code in the 'init()' is obviously not 'asynchronous operations'. Anything in the 'init()' should return a type of Future<bool>, and yet you've placed in the initState() of the AppView?? I'm sorry, but that doesn't make sense to me.
    image.png
    image.png
    Andrious Solutions
    @Andrious
    image.png
    image.png
    Andrious Solutions
    @Andrious
    Above now is a sequence of screenshots conveying the 'path of execution' for a hot reload. I'm running 'an example app' called ContactsExampleApp. You can see its AppView's init() is being fired with every 'hot reload'. I don't understand the problem you're experiencing.
    jasonlaw
    @jasonlaw
    Hi Greg, thanks for looking into this issue, I have made some small change in your example to reproduce the error.
    image.png
    in _ContactListState:
    image.png
    demo mxc bug.gif
    Hope you are clear now. Thanks!
    jasonlaw
    @jasonlaw
    Hi Greg, one more thing about hot reload which is keep bothering me is it won't going back to the last page. This can be easily reproduced too by navigated to 2nd page and trigger the hot reload from there, like below:
    demo mxc hotreload 2nd page.gif
    Andrious Solutions
    @Andrious
    I've been attempting to run the app copy I received, but I'm receiving a git error I'm not familiar with, "git rev-list --max-count=1 version3" It doesn't know with the argument, 'version3', means: fatal: ambiguous argument 'version3': unknown revision or path not in the working tree.
    Have you encountered this error before?
    jasonlaw
    @jasonlaw
    if you are trying to run the copy I sent to you before, then it could be some of the external package reference has been removed. Anyway, you should be able to reproduce the issue with the mxc_application example.. just some minor changes as I have shown above..
    Andrious Solutions
    @Andrious
    Hi Jason. I found the problem. It's apparent 'the solution' I had first given with version 2.0.0 ( State createState() => App.createVW(); ) was not efficient or effective enough! Admittedly, I didn't like it. I took the day to 'step back' and take the approach I originally intended. It involves only changing 'how' one would start an 'MVC' app:
    image.png
    Thus, in the main.dart, you'd see the difference:
    image.png
    I'll have a demo and the source code available shortly. For example, it's been tested successfully using your demo (debugString = "Value before init()")
    jasonlaw
    @jasonlaw
    Thank you Greg for the fast action! Btw, regarding the "not going back to last page", I believe that is due to the usage of Future builder.
    Andrious Solutions
    @Andrious
    Yes, I would think so. Hot reload restarts the app, and it starts from the beginning. You'd have to write code to tell your app what page it last was.
    mxc_application 3.0.0 is now available.
    Andrious Solutions
    @Andrious
    @jasonlaw I you still using the MVC framework? Is the Hot Reload is still an annoyance?
    jasonlaw
    @jasonlaw
    Hi Greg, I removed the Future Builder from my copy and it works good now. Thanks for the great framework!
    Andrious Solutions
    @Andrious
    @jasonlaw With the removal of the Future Builder, does it go back to the last page when you hot reload? What does the framework now look like? Would you give me a copy of it so I can possibly understand how I could make changes for the better to the framework?
    jasonlaw
    @jasonlaw
    Esben
    @EsbenSoeltoft
    Hi Greg, I am trying to use your DBInterface for sqllite together with Bloc, and I am having a few issues I hoped you might be able to assist with. I have read from the comments on your Medium article that you don't advocate Bloc, but that it should work. My issue is that when the app starts it call the Open() function from DBInterface in the first screen to load and use DBInterface, and then I try to call the rawQuery from DBInterface using my Bloc class, and it tries to call Open() again, and it then proceed to try the query it itself, but return that the table I try to query does not exist. Any help you can give will be appreciated
    Andrious Solutions
    @Andrious
    @EsbenSoeltoft Hello, Esben. Would you have the source code on bitbucket or github? Nothing like 'walking through the code' to determine what's to be do. What are the 'errors' you're encountering? Opening the DBInterface again and again, for example, should not be an issue.
    kaweesha
    @kaweesha

    Hi all,
    I'm learning life cycle in widgets.

    I print the value of boolean property mounted in constructor method, initState() method, build() method, deactivate() method and dispose() method.

    In dispose() method, it prints the value as true. how can it be? because, dispose()method suppose to remove the widget from the widget tree.

      @override
      void dispose() {
        super.dispose();
        print("dispose() secondPage mounted: "+ this.mounted.toString());
      }

    this prints dispose() secondPage mounted: true

    can anyone explain how this happens?

    Andrious Solutions
    @Andrious
    Yes, I don't readily know that answer, Kaweesh. I'm sure the much larger gitter community, Flutter, will have an immediate answer for you.
    kaweesha
    @kaweesha
    thanks