heroicons 0.6.0 heroicons: ^0.6.0 copied to clipboard
HeroIcons set of SVG icons in your Flutter app. Both outlined & solid icon version are available.
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 MyHomePage(title: 'HeroIcons'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({
Key? key,
required this.title,
}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: IconTheme(
data: const IconThemeData(color: Colors.black),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[
HeroIcon(HeroIcons.arrowLeft),
HeroIcon(HeroIcons.arrowRight),
HeroIcon(HeroIcons.calendar),
HeroIcon(HeroIcons.arrowLeft, solid: true),
HeroIcon(HeroIcons.arrowRight, solid: true),
HeroIcon(HeroIcons.calendar, solid: true),
IconTheme(
data: IconThemeData(
size: 40,
color: Colors.blue,
),
child: HeroIcon(HeroIcons.calendar, solid: true),
),
],
),
),
),
);
}
}