flutter_brands 0.0.1
flutter_brands: ^0.0.1 copied to clipboard
Access and render 6,500+ official brand SVG logos instantly in Flutter. Features strongly-typed auto-complete, original brand colors, and multi-variant support.
flutter_brands #
A Flutter package providing strongly-typed access to 6,500+ brand logo SVG icons from the open-source library theSVG (glincker/thesvg).
Features Hybrid Caching: SVG icons are fetched dynamically from the official jsDelivr CDN on first load, stored in local device cache, and served completely offline on subsequent loads. This prevents your app's bundle size from bloating with thousands of unused assets.
Features #
- 6,500+ Brand Logos & Diagrams: AWS, GCP, Google, GitHub, Figma, Azure, 1Password, and thousands more.
- Auto-Complete (Strongly-typed): Easily browse icons using
BrandIcons.googledirectly from your IDE. - Multiple Variants: Supports variants provided by theSVG:
default(original colors),mono,light,dark, andwordmark. - Hybrid Offline Cache: Automatically downloads and caches SVGs on-device using
flutter_cache_manager. - Code Generator Tool: Update the icon mapping list locally at any time by fetching the latest repository index.
Installation #
Add this package to your pubspec.yaml dependencies:
dependencies:
flutter_brands:
path: path/to/flutter_brands # For local development
Or when published:
dependencies:
flutter_brands: ^0.0.1
Then run:
flutter pub get
Usage #
Import the package in your Dart code:
import 'package:flutter_brands/flutter_brands.dart';
Basic Example (Original Brand Colors) #
Display a brand logo with its original official brand colors:
BrandIcon(
BrandIcons.google,
width: 48,
height: 48,
)
Custom Styling & Monochrome Varian #
Display the monochrome version of a logo and apply a custom theme color:
BrandIcon(
BrandIcons.github,
variant: BrandIconVariant.mono,
color: Colors.blueAccent,
width: 32,
)
Other Variants (Wordmarks, Dark, Light) #
// Wordmark logo
BrandIcon(
BrandIcons.aws,
variant: BrandIconVariant.wordmark,
width: 120,
)
// Dark theme variation
BrandIcon(
BrandIcons.figma,
variant: BrandIconVariant.dark,
width: 40,
)
Code Generator #
You can update the icons list manually at any time to include newly added icons in the theSVG registry:
dart tool/generate_icons.dart
This will fetch the latest registry manifest and rewrite lib/src/brand_icons.dart with updated class fields.
License #
This package is licensed under the MIT License. See LICENSE for details.
Disclaimer: All brand logos, trademarks, and registered trademarks are property of their respective owners. Their use in this package is for nominative identification purposes only.