Skip to content

Instantly share code, notes, and snippets.

@tomgilder
Created September 5, 2022 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomgilder/f688a24a4b20a02107559328e3545c52 to your computer and use it in GitHub Desktop.
Save tomgilder/f688a24a4b20a02107559328e3545c52 to your computer and use it in GitHub Desktop.
TabView zero duration bug

TabView zero duration bug

Created with <3 with dartpad.dev.

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