Last active
September 2, 2021 19:13
-
-
Save drkdelaney/a455230297428367c63aeaf8cbea0ad8 to your computer and use it in GitHub Desktop.
Flutter tabs overflow accessibility issue
This file contains hidden or 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(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
tabBarTheme: TabBarTheme( | |
labelColor: Colors.black, | |
labelStyle: TextStyle(fontSize: 75), | |
), | |
), | |
home: const MyHomePage(title: 'Flutter Demo Home Page'), | |
); | |
} | |
} | |
class MyHomePage extends StatelessWidget { | |
final String title; | |
const MyHomePage({ | |
Key? key, | |
required this.title, | |
}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text(title), | |
), | |
body: Column( | |
children: [ | |
DefaultTabController( | |
length: 3, | |
child: TabBar( | |
tabs: [ | |
Tab( | |
icon: Icon(Icons.directions_car), | |
text: 'Tab 1', | |
), | |
Tab( | |
icon: Icon(Icons.directions_transit), | |
text: 'Tab 2', | |
), | |
Tab( | |
icon: Icon(Icons.directions_bike), | |
text: 'Tab 2', | |
), | |
], | |
), | |
), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment