flutter_custom_tab_bar 1.2.1 copy "flutter_custom_tab_bar: ^1.2.1" to clipboard
flutter_custom_tab_bar: ^1.2.1 copied to clipboard

custom tab bar.

example/lib/main.dart

import 'package:example/pinned_linear_tab_bar_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

import 'linear_tab_bar_page.dart';
import 'round_tab_bar_page.dart';
import 'standard_tab_bar_page.dart';
import 'vertical_round_tab_bar_page.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, this.title}) : super(key: key);
  final String? title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  Widget _buildItem(BuildContext context, String title, Widget widget) {
    return InkWell(
      onTap: () {
        Navigator.of(context)
            .push(MaterialPageRoute(builder: (context) => widget));
      },
      child: Container(
        padding: EdgeInsets.all(10),
        child: Text(title),
      ),
    );
  }

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(widget.title!),
        ),
        body: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
          _buildItem(context, "Standard Tab Bar", StandardTabBarPage()),
          _buildItem(context, "Linear Tab Bar", LinearTabBarPage()),
          _buildItem(
              context, "Pinned Linear Tab Bar", PinnedLinearTabBarPage()),
          _buildItem(context, "Round Tab Bar", RoundTabBarPage()),
          _buildItem(
              context, "Vertical Round Tab Bar", VerticalRoundTabBarPage()),
        ]));
  }
}
55
likes
120
points
585
downloads

Publisher

unverified uploader

Weekly Downloads

custom tab bar.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_custom_tab_bar