flutter_polyicon 0.0.1
flutter_polyicon: ^0.0.1 copied to clipboard
One-shot icon font generator for Flutter. Convert SVG files to production-ready icon fonts with a single command.
import 'package:flutter/material.dart';
import 'package:example/icons/app_icons.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Polyicon Example',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
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('Polyicon Example'),
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text(
'Generated Icons:',
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
),
const SizedBox(height: 40),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
_IconDisplay(icon: AppIcons.home, label: 'Home'),
const SizedBox(width: 40),
_IconDisplay(icon: AppIcons.settings, label: 'Settings'),
],
),
],
),
),
);
}
}
class _IconDisplay extends StatelessWidget {
final IconData icon;
final String label;
const _IconDisplay({required this.icon, required this.label});
@override
Widget build(BuildContext context) {
return Column(
children: [
Icon(icon, size: 48, color: Theme.of(context).primaryColor),
const SizedBox(height: 8),
Text(label, style: const TextStyle(fontSize: 16)),
],
);
}
}