Commit 35f68ef6 authored by Administrator's avatar Administrator

introducing my own theme MyTheme

parent 50e16f81
import 'package:flutter/material.dart';
import 'screens/dashboard.dart';
import 'package:encrateia/setup.dart';
import 'package:encrateia/utils/my_theme.dart';
void main() async {
await Setup.init();
......@@ -12,9 +13,7 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
title: 'Encrateia',
theme: ThemeData(
primarySwatch: Colors.orange, // #ff9800
),
theme: MyTheme.call(),
home: Dashboard(),
);
}
......
import 'package:flutter/material.dart';
// import 'package:encrateia/utils/my_color.dart';
class MyColor {
static final blueJeans = Color(0xFF4A89DC);
static final blueJeansAccent = Color(0xFF5D9CEC);
static final aqua = Color(0xFF3BAFDA);
static final aquaAccent = Color(0xFF4FC1E9);
static final mint = Color(0xFF37BC9B);
static final mintAccent = Color(0xFF48CFAD);
static final grass = Color(0xFF8CC152);
static final grassAccent = Color(0xFFA0D468);
static final sunFlower = Color(0xFFF6BB42);
static final sunFlowerAccent = Color(0xFFFFCE54);
static final bitterSweet = Color(0xFFE9573F);
static final bitterSweetAccent = Color(0xFFFC6E51);
static final grapeFruit = Color(0xFFDA4453);
static final grapeFruitAccent = Color(0xFFED5565);
static final lavender = Color(0xFF967ADC);
static final lavenderAccent = Color(0xFFAC92EC);
static final pinkRose = Color(0xFFD770AD);
static final pinkRoseAccent = Color(0xFFEC87C0);
static final lightGray = Color(0xFFE6E9ED);
static final lightGrayAccent = Color(0xFFF5F7FA);
static final mediumGray = Color(0xFFAAB2BD);
static final mediumGrayAccent = Color(0xFFCCD1D9);
static final darkGray = Color(0xFF434A54);
static final darkGrayAccent = Color(0xFF656D78);
static final white = Colors.white;
static final black = Colors.black;
static final normal = mediumGray;
static final normalAccent = mediumGrayAccent;
static final defaultColor = white;
static final defaultAccent = mediumGrayAccent;
static final primary = sunFlower;
static final primaryAccent = sunFlowerAccent;
static final success = grass;
static final successAccent = grassAccent;
static final info = mint;
static final infoAccent = mintAccent;
static final warning = sunFlower;
static final warningAccent = sunFlowerAccent;
static final danger = grapeFruit;
static final dangerAccent = grapeFruitAccent;
static final link = Color(0x11ffffff);
static final linkAccent = Color(0xAAffffff);
}
import 'package:encrateia/utils/my_color.dart';
import 'package:flutter/material.dart';
class MyTheme {
static call() {
var redness = MyColor.primary.red;
var greenness = MyColor.primary.green;
var blueness = MyColor.primary.blue;
return ThemeData(
brightness: Brightness.light,
primaryColor: MyColor.primary,
primarySwatch: MaterialColor(
MyColor.sunFlowerAccent.value,
{
50: Color.fromRGBO(redness, greenness, blueness, .1),
100: Color.fromRGBO(redness, greenness, blueness, .2),
200: Color.fromRGBO(redness, greenness, blueness, .3),
300: Color.fromRGBO(redness, greenness, blueness, .4),
400: Color.fromRGBO(redness, greenness, blueness, .5),
500: Color.fromRGBO(redness, greenness, blueness, .6),
600: Color.fromRGBO(redness, greenness, blueness, .7),
700: Color.fromRGBO(redness, greenness, blueness, .8),
800: Color.fromRGBO(redness, greenness, blueness, .9),
900: Color.fromRGBO(redness, greenness, blueness, 1),
},
),
// #ff9800
accentColor: MyColor.primaryAccent,
fontFamily: 'Ubuntu',
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment