linting, minor ui changes

This commit is contained in:
Moritz Weber 2020-03-26 10:19:36 +01:00
parent 15dcb41dfe
commit 02877c9d92
6 changed files with 73 additions and 63 deletions

View file

@ -21,7 +21,7 @@
analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
implicit-dynamic: true
errors:
# treat missing required parameters as a warning (not a hint)
missing_required_param: warning

View file

@ -21,8 +21,8 @@ class MyApp extends StatelessWidget {
// https://api.flutter.dev/flutter/material/TextTheme-class.html
textTheme: TextTheme(
headline: TextStyle(fontSize: 72.0, fontWeight: FontWeight.bold),
title: TextStyle(fontSize: 20.0), //, fontWeight: FontWeight.w300),
body1: TextStyle(fontSize: 14.0, fontFamily: 'Hind'),
title: const TextStyle(fontSize: 20.0), //, fontWeight: FontWeight.w300),
body1: const TextStyle(fontSize: 14.0, fontFamily: 'Hind'),
),
),
home: RootPage(title: 'Flutter Demo Home Page'),

View file

@ -19,7 +19,11 @@ class _CurrentlyPlayingPageState extends State<CurrentlyPlayingPage> {
child: LayoutBuilder(
builder: (context, constraints) => Stack(children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 12.0),
padding: const EdgeInsets.only(
left: 12.0,
right: 12.0,
top: 8.0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -53,14 +57,14 @@ class _CurrentlyPlayingPageState extends State<CurrentlyPlayingPage> {
size: 20.0,
),
Container(
width: 32,
width: 40,
),
Icon(
Icons.favorite,
size: 20.0,
),
Container(
width: 32,
width: 40,
),
Icon(
Icons.remove_circle_outline,

View file

@ -40,38 +40,35 @@ class AlbumArt extends StatelessWidget {
),
),
Positioned(
bottom: 8.0,
left: 8.0,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
"Guardians of Asgaard",
style: Theme.of(context).textTheme.title,
),
RichText(
text: TextSpan(
style: TextStyle(
fontSize: 14,
),
children: [
TextSpan(
text: "Amon Amarth: ",
style: TextStyle(
color: Colors.white70,
),
),
TextSpan(
text: "Twilight of the Thunder God",
style: TextStyle(
fontWeight: FontWeight.w300,
color: Colors.white70,
),
),
],
bottom: 0,
left: 0,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Guardians of Asgaard',
style: Theme.of(context).textTheme.title,
),
),
],
Container(
height: 4.0,
),
const Text(
'Amon Amarth',
style: TextStyle(
color: Colors.white70,
),
),
const Text(
'Twilight of the Thunder God',
style: TextStyle(
fontWeight: FontWeight.w300,
color: Colors.white70,
),
),
],
),
),
),
],

View file

@ -2,18 +2,18 @@ import 'package:flutter/material.dart';
import 'package:mosh/presentation/pages/currently_playing.dart';
class NavBar extends StatefulWidget {
final int currentIndex;
final Function(int) onTap;
const NavBar({Key key, @required this.onTap, @required this.currentIndex})
: super(key: key);
final int currentIndex;
final Function(int) onTap;
@override
_NavBarState createState() => _NavBarState();
}
class _NavBarState extends State<NavBar> {
final _optionTextStyle = TextStyle(
final TextStyle _optionTextStyle = TextStyle(
fontWeight: FontWeight.w300,
);
@ -25,7 +25,7 @@ class _NavBarState extends State<NavBar> {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Container(
child: LinearProgressIndicator(
child: const LinearProgressIndicator(
value: 0.42,
),
height: 2,
@ -33,13 +33,14 @@ class _NavBarState extends State<NavBar> {
GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CurrentlyPlayingPage()));
context,
MaterialPageRoute<Widget>(
builder: (BuildContext context) => CurrentlyPlayingPage()),
);
},
child: Row(
children: <Widget>[
Image(
const Image(
image: AssetImage('assets/twilight.jpg'),
height: 64.0,
),
@ -49,7 +50,7 @@ class _NavBarState extends State<NavBar> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text("Guardians of Asgaard"),
Text('Guardians of Asgaard'),
Text(
"Amon Amarth",
style: TextStyle(

View file

@ -4,24 +4,32 @@ import '../../domain/entities/album.dart';
import '../datasources/moor_music_data_source.dart';
class AlbumModel extends Album {
final int id;
AlbumModel({this.id, @required title, @required artist, albumArtPath, year})
: super(
title: title,
artist: artist,
albumArtPath: albumArtPath,
year: year);
AlbumModel({
this.id,
@required String title,
@required String artist,
String albumArtPath,
int year,
}) : super(
title: title,
artist: artist,
albumArtPath: albumArtPath,
year: year,
);
factory AlbumModel.fromMoor(MoorAlbum moorAlbum) => AlbumModel(
title: moorAlbum.title,
artist: moorAlbum.artist,
albumArtPath: moorAlbum.albumArtPath,
year: moorAlbum.year);
title: moorAlbum.title,
artist: moorAlbum.artist,
albumArtPath: moorAlbum.albumArtPath,
year: moorAlbum.year,
);
final int id;
MoorAlbum toMoor() => MoorAlbum(
title: title,
artist: artist,
albumArtPath: albumArtPath,
year: year);
title: title,
artist: artist,
albumArtPath: albumArtPath,
year: year,
);
}