Skip to main content

fancy_page_indicator 0.0.1 copy "fancy_page_indicator: ^0.0.1" to clipboard
fancy_page_indicator: ^0.0.1 copied to clipboard

A capsule-style page indicator with optional loupe overlay.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Fancy Page Indicator Example',
      home: const ExamplePage(),
    );
  }
}

class ExamplePage extends StatefulWidget {
  const ExamplePage({super.key});

  @override
  State<ExamplePage> createState() => _ExamplePageState();
}

class _ExamplePageState extends State<ExamplePage> {
  late final PageController controller;

  @override
  void initState() {
    super.initState();
    controller = PageController();
  }

  @override
  void dispose() {
    controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Fancy Page Indicator Example')),
      body: Column(
        children: [
          Expanded(
            child: PageView(
              controller: controller,
              children: List.generate(
                5,
                (index) => Container(
                  color: Colors.primaries[index % Colors.primaries.length],
                  child: Center(
                    child: Text(
                      'Page ${index + 1}',
                      style: const TextStyle(fontSize: 32, color: Colors.white),
                    ),
                  ),
                ),
              ),
            ),
          ),
          Padding(
            padding: const EdgeInsets.all(16),
            child: FancyPageIndicator(
              controller: controller,
              count: 8,
              enableLoupe: true,
            ),
          ),

          SizedBox(height: 20),
        ],
      ),
    );
  }
}
0
likes
150
points
33
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A capsule-style page indicator with optional loupe overlay.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on fancy_page_indicator