Created with <3 with dartpad.dev.
Created
September 5, 2022 08:29
-
-
Save tomgilder/f688a24a4b20a02107559328e3545c52 to your computer and use it in GitHub Desktop.
TabView zero duration bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: DefaultTabController( | |
length: 3, | |
animationDuration: Duration.zero, | |
child: Scaffold( | |
appBar: AppBar( | |
bottom: const TabBar( | |
tabs: [ | |
Tab(icon: Icon(Icons.directions_car)), | |
Tab(icon: Icon(Icons.directions_transit)), | |
Tab(icon: Icon(Icons.directions_bike)), | |
], | |
), | |
), | |
body: const TabBarView( | |
children: [ | |
Text('Page one'), | |
Text('Page two'), | |
Text('Page three'), | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment