fix lint errors

This commit is contained in:
shilangyu 2020-08-31 16:19:44 +02:00
parent f4bd1eb65b
commit 9133ef94cd
2 changed files with 160 additions and 168 deletions

View File

@ -24,10 +24,8 @@ void main() {
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Observer(
builder: (ctx) {
return MaterialApp(
Widget build(BuildContext context) => Observer(
builder: (ctx) => MaterialApp(
title: 'Flutter Demo',
themeMode: ctx.watch<ConfigStore>().theme,
darkTheme: ThemeData.dark(),
@ -37,10 +35,8 @@ class MyApp extends StatelessWidget {
),
home: UserProfileTab(User.fromJson(jsonDecode(
'''{"id":13917,"name":"shilangyu","preferred_username":null,"password_encrypted":"","email":"xmarcinmarcin@gmail.com","avatar":null,"admin":false,"banned":false,"published":"2020-08-23T07:13:23.229279","updated":"2020-08-29T21:11:11.508707","show_nsfw":true,"theme":"minty","default_sort_type":0,"default_listing_type":1,"lang":"browser","show_avatars":true,"send_notifications_to_email":false,"matrix_user_id":null,"actor_id":"https://dev.lemmy.ml/u/shilangyu","bio":null,"local":true,"private_key":null,"public_key":null,"last_refreshed_at":"2020-08-23T07:13:23.229279","banner":null}'''))),
),
);
},
);
}
}
class MyHomePage extends StatefulWidget {

View File

@ -43,8 +43,7 @@ class PostWidget extends StatelessWidget {
);
}
Widget _info() {
return Column(children: [
Widget _info() => Column(children: [
Padding(
padding: const EdgeInsets.all(10),
child: Row(children: [
@ -85,7 +84,8 @@ class PostWidget extends StatelessWidget {
overflow: TextOverflow.ellipsis, // @TODO: fix overflowing
text: TextSpan(
style: TextStyle(
fontSize: 15, color: _theme.textTheme.bodyText1.color),
fontSize: 15,
color: _theme.textTheme.bodyText1.color),
children: [
TextSpan(
text: '!',
@ -149,10 +149,8 @@ class PostWidget extends StatelessWidget {
]),
),
]);
}
Widget _title() {
return Padding(
Widget _title() => Padding(
padding: const EdgeInsets.only(left: 10, right: 10, bottom: 10),
child: Row(
children: [
@ -191,7 +189,6 @@ class PostWidget extends StatelessWidget {
],
),
);
}
Widget _content() {
if (post.url == null) return Container();
@ -252,8 +249,7 @@ class PostWidget extends StatelessWidget {
);
}
Widget _actions() {
return Padding(
Widget _actions() => Padding(
padding: const EdgeInsets.fromLTRB(10, 5, 10, 5),
child: Row(
children: [
@ -272,7 +268,8 @@ class PostWidget extends StatelessWidget {
: Icon(Icons.bookmark_border),
onPressed: () => print('SAVE')),
IconButton(
icon: Icon(Icons.arrow_upward), onPressed: () => print('UPVOTE')),
icon: Icon(Icons.arrow_upward),
onPressed: () => print('UPVOTE')),
Text(post.score.toString()),
IconButton(
icon: Icon(Icons.arrow_downward),
@ -281,4 +278,3 @@ class PostWidget extends StatelessWidget {
),
);
}
}