Set default instead of null coalescing

This commit is contained in:
krawieck 2020-09-29 21:00:50 +02:00
parent 5a858142b5
commit d43ddd6c4f
1 changed files with 3 additions and 2 deletions

View File

@ -15,8 +15,9 @@ class CommunitiesListPage extends StatelessWidget {
SortType sortType, SortType sortType,
) fetcher; ) fetcher;
const CommunitiesListPage({Key key, @required this.fetcher, this.title}) const CommunitiesListPage({Key key, @required this.fetcher, this.title = ''})
: assert(fetcher != null), : assert(fetcher != null),
assert(title != null),
super(key: key); super(key: key);
@override @override
@ -25,7 +26,7 @@ class CommunitiesListPage extends StatelessWidget {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
brightness: theme.brightness, brightness: theme.brightness,
title: Text(title ?? '', style: theme.textTheme.headline6), title: Text(title, style: theme.textTheme.headline6),
centerTitle: true, centerTitle: true,
backgroundColor: theme.cardColor, backgroundColor: theme.cardColor,
iconTheme: theme.iconTheme, iconTheme: theme.iconTheme,