stacked_themes 0.3.15 copy "stacked_themes: ^0.3.15" to clipboard
stacked_themes: ^0.3.15 copied to clipboard

A set of classes to help you better manage Themes in flutter

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:stacked_themes/stacked_themes.dart';
import 'package:themes_example/app/locator.dart';
import 'package:themes_example/ui/dark_light/dark_light_view.dart';

Future main() async {
  setupLocator();
  await ThemeManager.initialise();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ThemeBuilder(
      defaultThemeMode: ThemeMode.system,
      darkTheme: ThemeData(
        brightness: Brightness.dark,
        colorScheme: ColorScheme.fromSwatch().copyWith(
          surface: Colors.blue[700],
          brightness: Brightness.dark,
          secondary: Colors.yellow[700],
        ),
      ),
      lightTheme: ThemeData(
        brightness: Brightness.light,
        colorScheme: ColorScheme.fromSwatch().copyWith(
          surface: Colors.blue[300],
          brightness: Brightness.light,
          secondary: Colors.yellow[300],
        ),
      ),
      statusBarColorBuilder: (theme) => theme?.colorScheme.secondary,
      navigationBarColorBuilder: (theme) => theme?.colorScheme.secondary,
      builder: (context, regularTheme, darkTheme, themeMode) => MaterialApp(
        title: 'Flutter Demo',
        theme: regularTheme,
        darkTheme: darkTheme,
        themeMode: themeMode,
        home: DarkLightView(),
      ),
    );
  }
}
copied to clipboard
109
likes
140
points
1.67k
downloads

Publisher

verified publisherfilledstacks.com

Weekly Downloads

2024.09.19 - 2025.04.03

A set of classes to help you better manage Themes in flutter

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, flutter_statusbarcolor_ns, get_it, provider, rxdart, shared_preferences, stacked_shared, universal_io

More

Packages that depend on stacked_themes