Skip to content

Instantly share code, notes, and snippets.

@Nailik
Last active July 16, 2020 09:04
Show Gist options
  • Save Nailik/8a62284fa740eb6509b012123e939761 to your computer and use it in GitHub Desktop.
Save Nailik/8a62284fa740eb6509b012123e939761 to your computer and use it in GitHub Desktop.
vertical tabbar flutter
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