smart_tab_view 0.0.3 copy "smart_tab_view: ^0.0.3" to clipboard
smart_tab_view: ^0.0.3 copied to clipboard

A scroll-aware tab view widget with customizable tab layout and scroll sync.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:smart_tab_view/smart_tab_view.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'SmartTabView Example',
      theme: ThemeData(primarySwatch: Colors.orange),
      home: const ExampleHome(),
    );
  }
}

class ExampleHome extends StatelessWidget {
  const ExampleHome({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("SmartTabView Example")),
      body: SmartTabView(
        tabWidth: 40,
        tabPosition: TabPosition.top,
        tabs:  [
          Icon(Icons.add,size: 20,),
          Icon(Icons.add),
          Icon(Icons.add),
          Icon(Icons.add),
        ],
        sections: const [
          ExampleSection(title: 'Overview', color: Colors.orange),
          ExampleSection(title: 'Benefits', color: Colors.green),
          ExampleSection(title: 'Process', color: Colors.blue),
          ExampleSection(title: 'Requirement', color: Colors.purple),
        ],
      ),
    );
  }
}

class ExampleSection extends StatelessWidget {
  final String title;
  final Color color;
  const ExampleSection({super.key, required this.title, required this.color});
  @override
  Widget build(BuildContext context) {
    return Container(
      color: color.withOpacity(0.1),
      padding: const EdgeInsets.all(24),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: List.generate(
          20,
              (i) => Padding(
            padding: const EdgeInsets.symmetric(vertical: 4),
            child: Text('$title Line ${i + 1}', style: const TextStyle(fontSize: 16)),
          ),
        ),
      ),
    );
  }
}
10
likes
0
points
6
downloads

Publisher

unverified uploader

Weekly Downloads

A scroll-aware tab view widget with customizable tab layout and scroll sync.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on smart_tab_view