hacktons / convex_bottom_bar

A Flutter package which implements a ConvexAppBar to show a convex tab in the bottom bar. Theming supported.
https://bar.hacktons.cn
Apache License 2.0
801 stars 151 forks source link

Rerendering bar after setState() #120

Closed moth71 closed 3 years ago

moth71 commented 3 years ago

Hi, i create the bar instance depending on certain BlockState states. It is possible that the bar contains different elements. If so, the widget will not render correctly.

Best greetings.

Environment details

[✓] Flutter (Channel stable, 1.20.3, on macOS 11.0.1 20B29, locale de-DE)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 12.0.1) [✓] Android Studio (version 4.0) [✓] VS Code (version 1.51.1) [✓] Connected device (1 available)

• No issues found!

dependencies: convex_bottom_bar: ^2.6.0

To Reproduce

  1. create an bottom bar with 3 Items e.g. var _bottomTabBar = ConvexAppBar( items: [ TabItem(icon: Icons.help), TabItem(icon: Icons.help), TabItem(icon: Icons.help) ], style: TabStyle.react, );

  2. call setState() with new _bottomTabBar instance e.g.

    setState(() { _bottomTabBar = ConvexAppBar( items: [ TabItem(icon: Icons.call_split), TabItem(icon: Icons.delete_forever),
    ], style: TabStyle.react, );

convexBottombar

avenwu commented 3 years ago

try to add different global key for the appbar

moth71 commented 3 years ago

thx, it works.