heroicons 0.10.0 copy "heroicons: ^0.10.0" to clipboard
heroicons: ^0.10.0 copied to clipboard

Easily use the heroicons set in your Flutter app.

example/lib/main.dart

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

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

class ExampleApp extends StatelessWidget {
  const ExampleApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
        iconTheme: const IconThemeData(
          color: Colors.red,
        ),
      ),
      home: const HeroIconTheme(
        // .outline is the default style anyhow, but this is how you can change
        // the default style of all HeroIcons in your app.
        style: HeroIconStyle.outline,
        child: MyHomePage(title: 'HeroIcons'),
      ),
    );
  }
}

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

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: const Center(
        child: IconTheme(
          data: IconThemeData(color: Colors.black),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              HeroIcon(HeroIcons.arrowLeft),
              HeroIcon(HeroIcons.arrowRight),
              HeroIcon(HeroIcons.calendar),
              HeroIcon(HeroIcons.arrowLeft, style: HeroIconStyle.solid),
              HeroIcon(HeroIcons.arrowRight, style: HeroIconStyle.solid),
              HeroIcon(HeroIcons.calendar, style: HeroIconStyle.solid),
              IconTheme(
                data: IconThemeData(
                  size: 40,
                  color: Colors.blue,
                ),
                child: HeroIcon(
                  HeroIcons.calendar,
                  style: HeroIconStyle.outline,
                ),
              ),
              IconTheme(
                data: IconThemeData(
                  size: 40,
                  color: Colors.blue,
                ),
                child: HeroIcon(HeroIcons.calendar, style: HeroIconStyle.solid),
              ),
              IconTheme(
                data: IconThemeData(
                  size: 40,
                  color: Colors.blue,
                ),
                child: HeroIcon(HeroIcons.calendar, style: HeroIconStyle.mini),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
60
likes
140
pub points
95%
popularity

Publisher

verified publishervojtech.net

Easily use the heroicons set in your Flutter app.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_svg, path

More

Packages that depend on heroicons