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,
|
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,
|
||||||
|
|
Loading…
Reference in New Issue