long1eu / circle_indicator

Small library that build a circle indicator for the PagerViewer. This can be used in Android and iOS apps.
BSD 3-Clause "New" or "Revised" License
38 stars 14 forks source link

Circles color are always white and not moving #7

Open fvisticot opened 6 years ago

fvisticot commented 6 years ago

The circle_indicator is correctly displayed but colors circles are always white and selected circle is not moving Is something wrong with my code ?

return new Scaffold(
      appBar: new AppBar(title: new Text("Moods"),),
      body: new Container(
          padding: new EdgeInsets.only(top: 16.0,),
          decoration: new BoxDecoration(
              color: Colors.yellow
          ),
          child: new Stack(
              alignment: FractionalOffset.bottomCenter,
              children: <Widget>[
                new PageView.builder(
                  physics: new AlwaysScrollableScrollPhysics(),
                  controller: _controller,
                  itemCount: _pages.length,
                  itemBuilder: (BuildContext context, int index) {
                    return _pages[index];
                  },
                  onPageChanged: _onPageChanged,
                ),
                new Container(
                    margin: new EdgeInsets.only(
                      top: 16.0,
                      bottom: 16.0,
                    ),
                    child: new CircleIndicator(_controller, _pages.length,
                        8.0, Colors.blue, Colors.red)
                ),
              ]
          )),
      floatingActionButton: new FloatingActionButton(
          child: new Icon(Icons.add), onPressed: () {
        _displayAddMenu();
      }),
    );
HelenGuov commented 6 years ago

I also have the same problem as above. Anyone else has the same issue, and found a solution to that?

albertjimenez commented 6 years ago

Didn't find a solution yet, but what I could notice is that the length of the pages is 1 less than your array of widgets on pagelist attribute

leocavalcante commented 6 years ago

Have the same problem with colors, it was always using always white, then I forked and changed the dependency to the path, to trying to solve and PR, but now colors are working. Some fix that haven't published?

leocavalcante commented 6 years ago

@fvisticot @HelenGuov Have tried to use this library, but unfortunately it does not fit my needs, so I build: https://github.com/leocavalcante/page_view_indicator

albertjimenez commented 6 years ago

wonderful, and did you notice the bug here on the last page of any array, the circle doesn't show up, I saw your gif and seems fixed, is it? thank you very much

leocavalcante commented 6 years ago

@albertjimenez It's not a fix, I really tried to fork+PR this repo, but it started to get way more different, my built is an entire new package from the ground up, not a fixed fork: https://pub.dartlang.org/packages/page_view_indicator

albertjimenez commented 6 years ago

thank you @leocavalcante I'm going to check it out asap and see. Best Regards.