Skip to main content

simple_theme 1.0.0 copy "simple_theme: ^1.0.0" to clipboard
simple_theme: ^1.0.0 copied to clipboard

A simple & complete theme builder from 1, 2 or 3 colors

module #

A simple & complete theme builder from 1, 2 or 3 colors.

Just call buildTheme() method and provide some colors through Palette #

void main() {
  runApp(
    MaterialApp(
      theme: buildTheme(
        Palette(
          primary: Colors.teal,
          secondary: Colors.purpleAccent,
          tertiary: Colors.amber,
        ),
      ),
      home: const HomeView(),
    ),
  );
}

Unify colors & sizing across your features #

Stop using magic numbers to size your items, margins, etc

NOTE

  • Here we're accessing our theme's secondary color through context: context.colors.secondary
  • And we're applying a const Padding: Margin.m
import 'package:flutter/material.dart';
import 'package:simple_theme/simple_theme.dart';

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

  @override
  Widget build(BuildContext context) {
    return Material(
      color: context.colors.secondary,
      child: const Padding(
        padding: EdgeInsets.all(Margin.m),
        child: Text('Welcome'),
      ),
    );
  }
}
1
likes
140
points
9
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A simple & complete theme builder from 1, 2 or 3 colors

Repository (GitLab)
View/report issues

License

BSD-3-Clause (license)

Dependencies

flutter, gap

More

Packages that depend on simple_theme