Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'util.dart';
import 'theme.dart';

void main() {
runApp(const MyApp());
Expand All @@ -10,27 +12,22 @@ class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
final brightness = View.of(context).platformDispatcher.platformBrightness;

// Retrieves the default theme for the platform
//TextTheme textTheme = Theme.of(context).textTheme;

// Use with Google Fonts package to use downloadable fonts
TextTheme textTheme = createTextTheme(
context,
"Roboto Flex",
"Abyssinica SIL",
);

MaterialTheme theme = MaterialTheme(textTheme);
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// TRY THIS: Try running your application with "flutter run". You'll see
// the application has a purple toolbar. Then, without quitting the app,
// try changing the seedColor in the colorScheme below to Colors.green
// and then invoke "hot reload" (save your changes or press the "hot
// reload" button in a Flutter-supported IDE, or press "r" if you used
// the command line to start the app).
//
// Notice that the counter didn't reset back to zero; the application
// state is not lost during the reload. To reset the state, use hot
// restart instead.
//
// This works for code too, not just values: Most code changes can be
// tested with just a hot reload.
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
theme: brightness == Brightness.light ? theme.light() : theme.dark(),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
Expand Down
Loading
Loading