make theming prettier and darker

This commit is contained in:
lukas-heiligenbrunner 2022-11-02 00:36:21 +01:00
parent 02e73eed1b
commit a7756da713
4 changed files with 66 additions and 71 deletions

View File

@ -29,6 +29,8 @@ class App extends StatelessWidget {
return const MaterialApp(home: LoginScreen()); return const MaterialApp(home: LoginScreen());
} else { } else {
return MaterialApp( return MaterialApp(
theme: ThemeData(
appBarTheme: AppBarTheme(backgroundColor: Color(0xff0d0d0d))),
scrollBehavior: AppScrollBehavior(), scrollBehavior: AppScrollBehavior(),
home: DrawerPage( home: DrawerPage(
title: 'OpenMediaCenter', title: 'OpenMediaCenter',

View File

@ -7,52 +7,32 @@ class MyDrawer extends StatelessWidget {
const MyDrawer({Key? key}) : super(key: key); const MyDrawer({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) => Drawer(
backgroundColor: Color(0xff3f3f3f),
child: ListView(children: [
SizedBox(
height: 75,
),
_listelement('Home', Icons.home, Section.HOME, context),
_listelement('Shuffle', Icons.update, Section.SHUFFLE, context),
_listelement(
'Categories', Icons.category, Section.CATEGORIE, context),
_listelement('Actors', Icons.people, Section.ACTOR, context),
_listelement('Settings', Icons.settings, Section.SETTING, context),
]),
);
Widget _listelement(
String text, IconData icon, Section section, BuildContext context) {
final ctx = DrawerContext.of(context); final ctx = DrawerContext.of(context);
return Drawer( return ListTile(
child: ListView(children: [ title: Text(text, style: TextStyle(color: Color(0xffe9e9e9))),
ListTile( leading: Icon(icon, color: Color(0xffe9e9e9)),
title: const Text('Home'),
leading: const Icon(Icons.home),
onTap: () { onTap: () {
ctx.onChangePage(Section.HOME); ctx.onChangePage(section);
Navigator.pop(context); Navigator.pop(context);
}, },
),
ListTile(
title: const Text('Shuffle'),
leading: const Icon(Icons.update),
onTap: () {
ctx.onChangePage(Section.SHUFFLE);
Navigator.pop(context);
},
),
ListTile(
title: const Text('Categories'),
leading: const Icon(Icons.category),
onTap: () {
ctx.onChangePage(Section.CATEGORIE);
Navigator.pop(context);
},
),
ListTile(
title: const Text('Actors'),
leading: const Icon(Icons.people),
onTap: () {
ctx.onChangePage(Section.ACTOR);
Navigator.pop(context);
},
),
ListTile(
title: const Text('Settings'),
leading: const Icon(Icons.settings),
onTap: () {
ctx.onChangePage(Section.SETTING);
Navigator.pop(context);
},
),
]),
); );
} }
} }

View File

@ -60,7 +60,7 @@ class _PreviewGridState extends State<PreviewGrid> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text("Error"), Text("Error" + snapshot.error.toString()),
TextButton( TextButton(
onPressed: () => loadData(), child: Text("Reload page")) onPressed: () => loadData(), child: Text("Reload page"))
], ],
@ -83,6 +83,8 @@ class _PreviewGridState extends State<PreviewGrid> {
if (widget.headerBuilder != null) widget.headerBuilder!(this), if (widget.headerBuilder != null) widget.headerBuilder!(this),
data.length > 0 data.length > 0
? Expanded( ? Expanded(
child: Container(
color: Color(0xff999999),
child: MasonryGridView.count( child: MasonryGridView.count(
// every tile should be at max 330 pixels long... // every tile should be at max 330 pixels long...
crossAxisCount: isTV() ? width ~/ 200 : width ~/ 275, crossAxisCount: isTV() ? width ~/ 200 : width ~/ 275,
@ -107,6 +109,7 @@ class _PreviewGridState extends State<PreviewGrid> {
); );
}, },
), ),
),
) )
: Center( : Center(
child: Column( child: Column(

View File

@ -105,16 +105,26 @@ class _PreviewTileState extends State<PreviewTile> {
Container( Container(
child: Column( child: Column(
children: [ children: [
ClipRRect(
child: image,
borderRadius: BorderRadius.circular(20.0),
),
SizedBox(
height: 3,
),
Text( Text(
widget.dta.title, widget.dta.title,
style: TextStyle(fontSize: isTV() ? 8 : 10.5), style: TextStyle(
fontSize: isTV() ? 8 : 10.5, color: Color(0xffe9e9e9)),
overflow: TextOverflow.clip, overflow: TextOverflow.clip,
maxLines: 1, maxLines: 1,
), ),
image SizedBox(
height: 3,
),
], ],
), ),
color: Color(0x6a94a6ff), color: Color(0xff3f3f3f),
), ),
Positioned.fill( Positioned.fill(
child: Material( child: Material(