import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
final tabCount = 3;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("TabView with disabled swipe"),
),
body: DefaultTabController(
length: tabCount,
child: Column(
children: <Widget>[
TabBar(
tabs: List<Widget>.generate(tabCount, (int index) {
return Tab(text: 'Tab $index');
}),
),
Expanded(
child: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: <Widget>[
Center(child: Text('Tab 0')),
Center(child: Text('Tab 1')),
Center(child: Text('Tab 2')),
],
),
),
],
),
),
),
);
}
}