1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-19 03:33:42 +01:00
git-touch-android-ios-app/lib/app.dart

31 lines
926 B
Dart
Raw Normal View History

2020-01-14 11:13:07 +01:00
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:git_touch/home.dart';
import 'package:git_touch/models/theme.dart';
import 'package:provider/provider.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Provider.of<ThemeModel>(context);
switch (theme.theme) {
case AppThemeType.cupertino:
return CupertinoApp(
theme: CupertinoThemeData(brightness: theme.brightness),
home: Home(),
);
default:
return MaterialApp(
2020-01-16 14:14:25 +01:00
theme: ThemeData(
brightness: theme.brightness,
primaryColor:
theme.brightness == Brightness.dark ? null : Colors.white,
2020-01-27 08:11:51 +01:00
accentColor: theme.palette.primary,
scaffoldBackgroundColor: theme.palette.background,
2020-01-16 14:14:25 +01:00
),
2020-01-14 11:13:07 +01:00
home: Home(),
);
}
}
}