diff --git a/lib/main.dart b/lib/main.dart index 72d71ca..ca35425 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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'), + )), ); } } diff --git a/lib/theme.dart b/lib/theme.dart new file mode 100644 index 0000000..0d29213 --- /dev/null +++ b/lib/theme.dart @@ -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, +)); diff --git a/pubspec.yaml b/pubspec.yaml index 78406ce..c1d9690 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -21,23 +21,6 @@ dev_dependencies: flutter: uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: fonts: - family: Ubuntu fonts: