flutter_bullet_dots 1.0.0 copy "flutter_bullet_dots: ^1.0.0" to clipboard
flutter_bullet_dots: ^1.0.0 copied to clipboard

A simple Flutter package for customizable bullet dots and lists with various shapes and styles.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Bullet Dots Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Flutter Bullet Dots Example'),
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
      ),
      body: SingleChildScrollView(
        padding: const EdgeInsets.all(16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            const Text(
              'Bullet Dot Shapes',
              style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
            ),
            const SizedBox(height: 16),
            Wrap(
              spacing: 16,
              runSpacing: 8,
              children: [
                _buildShapeExample('Circle', BulletShape.circle, Colors.blue),
                _buildShapeExample('Square', BulletShape.square, Colors.green),
                _buildShapeExample('Diamond', BulletShape.diamond, Colors.orange),
                _buildShapeExample('Triangle', BulletShape.triangle, Colors.red),
                _buildShapeExample('Star', BulletShape.star, Colors.purple),
                _buildShapeExample('Hexagon', BulletShape.hexagon, Colors.teal),
              ],
            ),
            const SizedBox(height: 32),
            const Text(
              'Simple Bullet List',
              style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
            ),
            const SizedBox(height: 16),
            BulletList(
              items: [
                'This is a simple bullet list',
                'Each item has the same bullet style',
                'Easy to customize and use',
              ],
              bulletDot: const BulletDot(
                color: Colors.blue,
                shape: BulletShape.circle,
                size: 10,
              ),
              spacing: 12,
              itemSpacing: 8,
              textStyle: const TextStyle(fontSize: 16),
            ),
            const SizedBox(height: 32),
            const Text(
              'Custom Bullet List',
              style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
            ),
            const SizedBox(height: 16),
            CustomBulletList(
              items: [
                BulletListItem(
                  bulletDot: const BulletDot(
                    color: Colors.green,
                    shape: BulletShape.star,
                    size: 12,
                  ),
                  child: const Text(
                    'Important feature with star bullet',
                    style: TextStyle(fontWeight: FontWeight.bold),
                  ),
                ),
                BulletListItem(
                  bulletDot: const BulletDot(
                    color: Colors.orange,
                    shape: BulletShape.triangle,
                    size: 10,
                  ),
                  child: const Text('Warning message with triangle bullet'),
                ),
                BulletListItem(
                  bulletDot: const BulletDot(
                    color: Colors.purple,
                    shape: BulletShape.hexagon,
                    size: 11,
                  ),
                  child: Row(
                    children: [
                      const Icon(Icons.check_circle, color: Colors.green, size: 16),
                      const SizedBox(width: 8),
                      const Text('Complex item with icon'),
                    ],
                  ),
                ),
              ],
              spacing: 12,
              itemSpacing: 8,
            ),
            const SizedBox(height: 32),
            const Text(
              'Customized Bullet Dots',
              style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
            ),
            const SizedBox(height: 16),
            Wrap(
              spacing: 16,
              runSpacing: 8,
              children: [
                _buildCustomExample('Bordered', const BulletDot(
                  color: Colors.blue,
                  borderColor: Colors.black,
                  borderWidth: 2,
                )),
                _buildCustomExample('Large', const BulletDot(
                  color: Colors.red,
                  size: 16,
                )),
                _buildCustomExample('Rounded', const BulletDot(
                  color: Colors.green,
                  shape: BulletShape.square,
                  borderRadius: 8,
                )),
              ],
            ),
          ],
        ),
      ),
    );
  }

  Widget _buildShapeExample(String label, BulletShape shape, Color color) {
    return Column(
      children: [
        BulletDot(
          shape: shape,
          color: color,
          size: 12,
        ),
        const SizedBox(height: 4),
        Text(label, style: const TextStyle(fontSize: 12)),
      ],
    );
  }

  Widget _buildCustomExample(String label, BulletDot bulletDot) {
    return Column(
      children: [
        bulletDot,
        const SizedBox(height: 4),
        Text(label, style: const TextStyle(fontSize: 12)),
      ],
    );
  }
}
2
likes
150
points
26
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A simple Flutter package for customizable bullet dots and lists with various shapes and styles.

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_bullet_dots