Skip to main content

color_theme_fonts 0.1.4 copy "color_theme_fonts: ^0.1.4" to clipboard
color_theme_fonts: ^0.1.4 copied to clipboard

color_theme_font

๐ŸŽจ ColorThemeFonts - Ultimate Flutter Theme Manager #

Flutter Pub Version License Platform

A powerful Flutter package for seamless theme management, color palettes, typography, and dark/light mode support.


๐ŸŽฌ Preview #

Theme Preview


โœจ Features #

๐ŸŽจ Smart Color Management #

  • Automatic Dark/Light Mode with smooth transitions
  • Custom Color Palettes with easy configuration
  • Accessibility Ready with proper contrast ratios
  • Dynamic Theme Switching at runtime

๐Ÿ“ฑ Advanced Typography #

  • Google Fonts Integration (1000+ fonts)
  • Responsive Text Scaling for all screen sizes
  • Custom Text Theme management
  • Consistent Typography across your app

๐Ÿ”ง Easy to Use #

  • Zero Boilerplate setup
  • Hot Reload Friendly - See changes instantly
  • Production Ready - Tested and stable
  • Well Documented - Clear examples and API

๐Ÿ“ฆ Installation #

Add to your pubspec.yaml:

dependencies:
  color_theme_fonts: ^0.1.4
  google_fonts: ^6.0.0 # Recommended for typography


## ๐Ÿงช Example

### Quick Example

```dart
import 'package:flutter/material.dart';
import 'package:color_theme_fonts/color_theme_fonts.dart';
import 'package:google_fonts/google_fonts.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool _isDarkMode = false;

  @override
  Widget build(BuildContext context) {
    // Configure theme
    TextThemeDefaults.updateLightTextStyles(
      displayLarge: GoogleFonts.bebasNeue(fontSize: 72, color: Colors.black),
      headlineLarge: GoogleFonts.bebasNeue(fontSize: 40, color: Colors.black),
    );

    AppColorsManager.updateLightColors(
      primary: Colors.blue,
      secondary: Colors.green,
      background: Colors.white,
    );

    return MaterialApp(
      theme: AllTheme.lightTheme(),
      darkTheme: AllTheme.darkTheme(),
      themeMode: _isDarkMode ? ThemeMode.dark : ThemeMode.light,
      home: HomeScreen(
        isDarkMode: _isDarkMode,
        onThemeChanged: (value) {
          setState(() {
            _isDarkMode = value;
          });
        },
      ),
    );
  }
}

class HomeScreen extends StatelessWidget {
  final bool isDarkMode;
  final ValueChanged<bool> onThemeChanged;

  const HomeScreen({
    super.key,
    required this.isDarkMode,
    required this.onThemeChanged,
  });

  @override
  Widget build(BuildContext context) {
    final textTheme = Theme.of(context).textTheme;

    return Scaffold(
      appBar: AppBar(
        title: const Text('Theme Switcher'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const Text('Toggle Theme'),
            Switch(
              value: isDarkMode,
              onChanged: onThemeChanged,
            ),
            const SizedBox(height: 20),
            Text('Display Large', style: textTheme.displayLarge),
            Text('Headline Large', style: textTheme.headlineLarge),
            Text('Body Large', style: textTheme.bodyLarge),
          ],
        ),
      ),
      backgroundColor: AppColors.getLightColor2(isDarkMode),
    );
  }
}