Set default instead of null coalescing
This commit is contained in:
parent
5a858142b5
commit
d43ddd6c4f
|
@ -15,8 +15,9 @@ class CommunitiesListPage extends StatelessWidget {
|
|||
SortType sortType,
|
||||
) fetcher;
|
||||
|
||||
const CommunitiesListPage({Key key, @required this.fetcher, this.title})
|
||||
const CommunitiesListPage({Key key, @required this.fetcher, this.title = ''})
|
||||
: assert(fetcher != null),
|
||||
assert(title != null),
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
|
@ -25,7 +26,7 @@ class CommunitiesListPage extends StatelessWidget {
|
|||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
brightness: theme.brightness,
|
||||
title: Text(title ?? '', style: theme.textTheme.headline6),
|
||||
title: Text(title, style: theme.textTheme.headline6),
|
||||
centerTitle: true,
|
||||
backgroundColor: theme.cardColor,
|
||||
iconTheme: theme.iconTheme,
|
||||
|
|
Loading…
Reference in New Issue