Skip to content

Commit

Permalink
优化顶部 topbar
Browse files Browse the repository at this point in the history
  • Loading branch information
toly1994328 committed Jul 10, 2021
1 parent 7c42bba commit d45d1e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/views/pages/widget_home/toly_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const _kTabTextStyle = TextStyle(color: Colors.white, shadows: [

class _TolyAppBarState extends State<TolyAppBar>
with SingleTickerProviderStateMixin {
double _width = 0;
double _width;
int _selectIndex = 0;
int _prevSelectIndex = 0;

Expand Down Expand Up @@ -65,6 +65,7 @@ class _TolyAppBarState extends State<TolyAppBar>
circleAnim = circleTween.animate(_controller);
heightAnim = CurveTween(curve: Curves.ease).animate(_controller);
backCircleAnim = ReverseAnimation(circleAnim);

_selectIndex = widget.defaultIndex;
}

Expand All @@ -74,6 +75,7 @@ class _TolyAppBarState extends State<TolyAppBar>

@override
Widget build(BuildContext context) {
_width = _width ?? MediaQuery.of(context).size.width / colors.length;
return Center(
child:Flow(
delegate: TolyAppBarDelegate(
Expand Down

0 comments on commit d45d1e4

Please sign in to comment.