added theme

This commit is contained in:
SomnusVeritas
2023-10-02 18:58:19 +02:00
parent a7b80831b9
commit f6cfc31036
3 changed files with 27 additions and 22 deletions

View File

@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';
import 'theme.dart';
void main() {
runApp(const MyApp());
}
@@ -11,11 +13,12 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
fontFamily: "Ubuntu",
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
theme: lightTheme,
darkTheme: darkTheme,
home: Scaffold(
appBar: AppBar(
title: Text('ietn'),
)),
);
}
}

19
lib/theme.dart Normal file
View File

@@ -0,0 +1,19 @@
import 'package:flutter/material.dart';
final _baseTheme = ThemeData(
fontFamily: "Ubuntu",
useMaterial3: true,
);
final lightTheme = _baseTheme.copyWith(
colorScheme: ColorScheme.fromSeed(
seedColor: Colors.deepPurple,
brightness: Brightness.light,
),
);
final darkTheme = _baseTheme.copyWith(
colorScheme: ColorScheme.fromSeed(
seedColor: Colors.purple.shade100,
brightness: Brightness.dark,
));