-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.dart
50 lines (45 loc) · 1.47 KB
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:weather_app/app_dependencies/app_dependencies.dart';
import 'package:weather_app/app_pages/app_pages.dart';
import 'package:weather_app/networking/async_compute.dart';
import 'package:weather_app/networking/http_client_provider.dart';
import 'package:weather_app/prelude/time_source.dart';
void main() {
runApp(Provider(
create: (_) => AppDependencies(
httpClientProvider: ConcreteHttpClientProvider(),
asyncCompute: FoundationAsyncCompute(),
timeSource: SystemTimeSource(),
),
child: const App(),
));
}
final class App extends StatelessWidget {
const App({super.key});
@override
Widget build(BuildContext context) {
final colorScheme = ColorScheme.fromSeed(
seedColor: Colors.indigo.shade900,
brightness: MediaQuery.of(context).platformBrightness,
);
const textTheme = TextTheme(
titleLarge: TextStyle(fontWeight: FontWeight.w600, letterSpacing: 0.5),
);
return MaterialApp(
title: 'Weather',
theme: ThemeData(
colorScheme: colorScheme,
textTheme: textTheme,
snackBarTheme: SnackBarThemeData(
actionBackgroundColor: colorScheme.tertiary.withOpacity(0.8),
actionTextColor: colorScheme.onTertiary,
closeIconColor: colorScheme.onTertiary,
showCloseIcon: true,
),
useMaterial3: true,
),
home: const AppPages(),
);
}
}