Giter VIP home page Giter VIP logo

Comments (6)

lukef avatar lukef commented on May 13, 2024

This would be expected if you're telling the router to navigate back to a certain route on click. Can you share some information on how you're doing the navigation between tabs?

from fluro.

smkhalsa avatar smkhalsa commented on May 13, 2024

Sure. I'm using a tab bar with a MaterialApp in each tab. Here's my build function for my tabview:

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      bottomNavigationBar: new Material(
        child: new TabBar(
          controller: _tabController,
          tabs: <Widget>[
            new Tab(icon: new Icon(Icons.accessibility_new), text: 'Practice'),
            new Tab(icon: new Icon(Icons.video_library), text: 'Learn'),
            new Tab(icon: new Icon(Icons.headset), text: 'Listen'),
            new Tab(icon: new Icon(Icons.multiline_chart), text: 'Track'),
          ],
        ),
        color: Theme.of(context).primaryColor,
      ),
      body: new TabBarView(
        controller: _tabController,
        children: <Widget>[
          new MaterialApp(home: new Practice(), onGenerateRoute: Application.router.generator, theme: Theme.of(context), key: new PageStorageKey('PracticeTab')),
          new MaterialApp(home: new Learn(), onGenerateRoute: Application.router.generator, theme: Theme.of(context), key: new PageStorageKey('LearnTab')),
          new MaterialApp(home: new Listen(), onGenerateRoute: Application.router.generator, theme: Theme.of(context), key: new PageStorageKey('ListenTab')),
          new MaterialApp(home: new Track(), onGenerateRoute: Application.router.generator, theme: Theme.of(context), key: new PageStorageKey('TrackTab')),
        ],
      ),
    );
  }

from fluro.

smkhalsa avatar smkhalsa commented on May 13, 2024

As you can see from above, the TabBar is managing the navigation between tabs. I don't manage this directly.

from fluro.

lukef avatar lukef commented on May 13, 2024

Is there a reason you're using a new MaterialApp instance for each tab. That seems to be a bit odd.

from fluro.

smkhalsa avatar smkhalsa commented on May 13, 2024

@lukef, no. I've since changed this.

I'm closing this issue as I found a solution. For anyone else looking to do this, check out flutter/flutter#12130.

from fluro.

adriancmurray avatar adriancmurray commented on May 13, 2024

@smkhalsa I'm trying to do the same thing and my solution was to nest MaterialApps within a tab navigator as well. However, before I implemented that case I realized there had to be another solution. Which is how I found your referenced thread. Any chance you could explain where you implemented the TabSwitchingView section of the code? I'm at a loss here and just want a hybrid between iOS and Material UX designs.

from fluro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.