Skip to main content

lumina_theme 0.1.0 copy "lumina_theme: ^0.1.0" to clipboard
lumina_theme: ^0.1.0 copied to clipboard

Code generation for ThemeExtension, ThemeData helpers, and context accessors from a single annotated source.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'my_app_theme.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'LuminaTheme Demo',
      theme: MyAppThemeThemeData.light(),
      darkTheme: MyAppThemeThemeData.dark(),
      themeMode: ThemeMode.system,
      home: const _HomePage(),
    );
  }
}

class _HomePage extends StatelessWidget {
  const _HomePage();

  @override
  Widget build(BuildContext context) {
    final colors = context.brand;
    return Scaffold(
      backgroundColor: colors.primary,
      body: Center(
        child: Container(
          padding: colors.contentPadding,
          decoration: BoxDecoration(
            color: Theme.of(context).colorScheme.surface,
            borderRadius: BorderRadius.circular(colors.cardRadius),
          ),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text('LuminaTheme', style: colors.heading),
              const SizedBox(height: 16),
              Text(
                'Warning: ${colors.warning.value.toRadixString(16)}',
                style: Theme.of(context)
                    .textTheme
                    .bodyMedium
                    ?.copyWith(color: colors.warning),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
140
points
11
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Code generation for ThemeExtension, ThemeData helpers, and context accessors from a single annotated source.

Repository (GitHub)

License

MIT (license)

Dependencies

analyzer, build, flutter, meta, source_gen

More

Packages that depend on lumina_theme