Last active
July 16, 2020 09:04
-
-
Save Nailik/8a62284fa740eb6509b012123e939761 to your computer and use it in GitHub Desktop.
vertical tabbar flutter
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'; | |
import 'dart:math'; | |
void main() { | |
runApp(TabBarDemo()); | |
} | |
class TabBarDemo extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: DefaultTabController( | |
length: 3, | |
child: Scaffold( | |
appBar: AppBar( | |
title: Text('Tabs Demo Test'), | |
), | |
body: Row( | |
mainAxisSize: MainAxisSize.max, | |
children: [ | |
Container( | |
color: Colors.blue, | |
child: RotatedBox( | |
quarterTurns: 1, | |
child: TabBar( | |
tabs: [ | |
Tab( | |
icon: Transform.rotate( | |
angle: -90 * pi / 180, | |
child: Icon(Icons.directions_car))), | |
Tab( | |
icon: Transform.rotate( | |
angle: -90 * pi / 180, | |
child: Icon(Icons.directions_transit))), | |
Tab( | |
icon: Transform.rotate( | |
angle: -90 * pi / 180, | |
child: Icon(Icons.directions_bike))) | |
], | |
))), | |
Expanded( | |
child: TabBarView( | |
children: [ | |
Icon(Icons.directions_car), | |
Icon(Icons.directions_transit), | |
Icon(Icons.directions_bike), | |
], | |
)) | |
], | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment