Convert functions with immidiate returns to expressions

change () { return X; }
    to () => X
This commit is contained in:
krawieck 2020-09-07 23:13:05 +02:00
parent 4deafcb29f
commit 45e42ac322
1 changed files with 41 additions and 47 deletions

View File

@ -95,8 +95,7 @@ class CommunityPage extends HookWidget {
body: DefaultTabController( body: DefaultTabController(
length: 3, length: 3,
child: NestedScrollView( child: NestedScrollView(
headerSliverBuilder: (context, innerBoxIsScrolled) { headerSliverBuilder: (context, innerBoxIsScrolled) => <Widget>[
return <Widget>[
// TODO: change top section to be more flexible // TODO: change top section to be more flexible
SliverAppBar( SliverAppBar(
expandedHeight: 300, expandedHeight: 300,
@ -135,8 +134,7 @@ class CommunityPage extends HookWidget {
), ),
pinned: true, pinned: true,
), ),
]; ],
},
body: TabBarView( body: TabBarView(
children: [ children: [
ListView( ListView(
@ -351,9 +349,7 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
} }
@override @override
bool shouldRebuild(_SliverAppBarDelegate oldDelegate) { bool shouldRebuild(_SliverAppBarDelegate oldDelegate) => false;
return false;
}
} }
class _AboutTab extends StatelessWidget { class _AboutTab extends StatelessWidget {
@ -479,10 +475,8 @@ class _Badge extends StatelessWidget {
class _Divider extends StatelessWidget { class _Divider extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) => Padding(
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
child: Divider(), child: Divider(),
); );
}
} }