mirror of
https://github.com/stonega/tsacdop
synced 2024-12-16 10:22:23 +01:00
7ba0552717
modified: lib/episodes/episodedetail.dart modified: lib/home/appbar/about.dart modified: lib/home/appbar/addpodcast.dart modified: lib/home/appbar/importompl.dart modified: lib/home/appbar/popupmenu.dart modified: lib/home/audio_player.dart modified: lib/home/audiopanel.dart modified: lib/home/homescroll.dart modified: lib/home/hometab.dart modified: lib/local_storage/key_value_storage.dart modified: lib/main.dart modified: lib/podcasts/podcastdetail.dart modified: lib/podcasts/podcastgroup.dart modified: lib/podcasts/podcastlist.dart modified: lib/podcasts/podcastmanage.dart modified: lib/util/episodegrid.dart
64 lines
2.1 KiB
Dart
64 lines
2.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter_downloader/flutter_downloader.dart';
|
|
import 'package:tsacdop/class/podcast_group.dart';
|
|
import 'package:tsacdop/home/appbar/addpodcast.dart';
|
|
import 'package:tsacdop/class/audiostate.dart';
|
|
import 'package:tsacdop/class/importompl.dart';
|
|
import 'package:tsacdop/class/settingstate.dart';
|
|
|
|
void main() async {
|
|
runApp(
|
|
MultiProvider(
|
|
providers: [
|
|
ChangeNotifierProvider(create: (context) => AudioPlay()),
|
|
ChangeNotifierProvider(create: (context) => ImportOmpl()),
|
|
ChangeNotifierProvider(create: (context) => SettingState()),
|
|
ChangeNotifierProvider(create: (context) => GroupList()),
|
|
],
|
|
child: MyApp(),
|
|
),
|
|
);
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
await FlutterDownloader.initialize();
|
|
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var theme = Provider.of<SettingState>(context).theme;
|
|
return MaterialApp(
|
|
themeMode: theme == 0
|
|
? ThemeMode.system
|
|
: theme == 1 ? ThemeMode.dark : ThemeMode.light,
|
|
debugShowCheckedModeBanner: false,
|
|
title: 'TsacDop',
|
|
theme: ThemeData(
|
|
accentColorBrightness: Brightness.dark,
|
|
primaryColor: Colors.grey[100],
|
|
accentColor: Colors.blue[400],
|
|
primaryColorLight: Colors.white,
|
|
primaryColorDark: Colors.grey[300],
|
|
dialogBackgroundColor: Colors.white,
|
|
backgroundColor: Colors.grey[100],
|
|
appBarTheme: AppBarTheme(
|
|
color: Colors.grey[100],
|
|
elevation: 0,
|
|
),
|
|
textTheme: TextTheme(
|
|
headline1: TextStyle(fontSize: 72.0, fontWeight: FontWeight.bold),
|
|
bodyText2: TextStyle(fontSize: 15.0, fontWeight: FontWeight.normal),
|
|
),
|
|
tabBarTheme: TabBarTheme(
|
|
labelColor: Colors.black,
|
|
unselectedLabelColor: Colors.grey[400],
|
|
),
|
|
),
|
|
darkTheme: ThemeData.dark(),
|
|
home: MyHomePage(),
|
|
);
|
|
}
|
|
}
|