flutter_lucide 1.8.1 copy "flutter_lucide: ^1.8.1" to clipboard
flutter_lucide: ^1.8.1 copied to clipboard

Flutter package for Lucide Icons. Lucide is a free, open-source icon set with 1666+ icons. It's a fork of the popular Feather icon set.

example/lib/main.dart

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

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) => MaterialApp(
    title: 'Lucide Icons Example',
    theme: ThemeData(
      colorScheme: ColorScheme.fromSeed(seedColor: Colors.orange),
      useMaterial3: true,
    ),
    home: const MyHomePage(title: 'Lucide Icons Example'),
  );
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() => setState(() => _counter++);

  void _decrementCounter() => setState(() => _counter--);

  void _resetCounter() => setState(() => _counter = 0);

  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(
      backgroundColor: Theme.of(context).colorScheme.inversePrimary,
      title: Text(widget.title),
    ),
    body: Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          const Text('You have pushed the button this many times: '),
          Icon(
            LucideIcons.a_arrow_down,
            size: 48,
            color: Theme.of(context).colorScheme.primary,
          ),
          Icon(
            LucideIcons.bug,
            size: 48,
            color: Theme.of(context).colorScheme.primary,
          ),

          if (_counter > 0) ...[
            const SizedBox(height: 16),
            IconButton.filled(
              onPressed: _incrementCounter,
              icon: Icon(LucideIcons.plus, size: 32),
            ),
          ] else if (_counter < 0) ...[
            const SizedBox(height: 16),
            IconButton.filled(
              onPressed: _decrementCounter,
              icon: const Icon(LucideIcons.minus, size: 32),
            ),
          ],
          Text('$_counter', style: Theme.of(context).textTheme.headlineLarge),
        ],
      ),
    ),
    floatingActionButton: Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        FloatingActionButton(
          onPressed: _incrementCounter,
          child: const Icon(LucideIcons.plus),
        ),
        const SizedBox(width: 8),
        FloatingActionButton(
          onPressed: _resetCounter,
          child: const Icon(LucideIcons.refresh_ccw),
        ),
        const SizedBox(width: 8),
        FloatingActionButton(
          onPressed: _decrementCounter,
          child: const Icon(LucideIcons.minus),
        ),
      ],
    ),
  );
}

extension OfIconData on IconData {
  IconData copyWith({
    bool? matchTextDirection,
    List<String>? fontFamilyFallback,
  }) => IconData(
    codePoint,
    matchTextDirection: matchTextDirection ?? this.matchTextDirection,
    fontFamilyFallback: fontFamilyFallback ?? this.fontFamilyFallback,
  );
}
70
likes
150
points
3.99k
downloads
screenshot

Publisher

verified publishervoltvave.com

Weekly Downloads

Flutter package for Lucide Icons. Lucide is a free, open-source icon set with 1666+ icons. It's a fork of the popular Feather icon set.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#lucide #lucide-icons #feather #feather-icons #icons

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_lucide