simple_theme 1.0.0
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'),
),
);
}
}