themely 1.0.1 copy "themely: ^1.0.1" to clipboard
themely: ^1.0.1 copied to clipboard

A modular Flutter theme manager supporting dark, light, amoled, and custom named themes with semantic color tokens, animated transitions, scheduling, and more.

example/lib/main.dart

import 'package:example/pages/home_screen.dart';
import 'package:flutter/material.dart';
import 'package:themely/themely.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  // Initialize the controller with your ThemeData
  final controller = ThemeController(
    lightTheme: ThemeData.light(useMaterial3: true).copyWith(
      extensions: [AppThemeExtension(tokens: AppThemeTokens.light)],
    ),
    darkTheme: ThemeData.dark(useMaterial3: true).copyWith(
      extensions: [AppThemeExtension(tokens: AppThemeTokens.dark)],
    ),
    amoledTheme: ThemeData(
      brightness: Brightness.dark,
      scaffoldBackgroundColor: Colors.black,
      appBarTheme: const AppBarTheme(backgroundColor: Colors.black),
      cardTheme: const CardThemeData(color: Color(0xFF121212)),
      useMaterial3: true,
      extensions: [AppThemeExtension(tokens: AppThemeTokens.amoled)],
    ),
  );

  // Await initialization to load saved preferences
  await controller.initialize();

  runApp(MyApp(controller: controller));
}

class MyApp extends StatelessWidget {
  final ThemeController controller;

  const MyApp({super.key, required this.controller});

  @override
  Widget build(BuildContext context) {
    // Inject ThemeScope and listen to stream
    return ThemelyApp(
      controller: controller,
      builder: (context, theme, child) =>
          MaterialApp(theme: theme, home: Home()),
    );
  }
}
0
likes
150
points
133
downloads

Documentation

API reference

Publisher

verified publisherdimassfeb.com

Weekly Downloads

A modular Flutter theme manager supporting dark, light, amoled, and custom named themes with semantic color tokens, animated transitions, scheduling, and more.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, lottie, shared_preferences

More

Packages that depend on themely