Skip to content

Commit bf8ed20

Browse files
committed
Make it non-nullable
1 parent 7fbddb6 commit bf8ed20

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ You should then run `flutter packages get` in your terminal so as to get the pac
137137
| Dart attribute | Datatype | Description | Default Value |
138138
| :-------------------- | :------------- | :-------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------: |
139139
| pageColor | Color? | Set color of the page. | Null |
140-
| pageBackground | Widget? | Set a widget as a background of the whole page (pageColor has priority) | Null |
140+
| pageBackground | Widget | Set a widget as a background of the whole page (pageColor has priority) | Null |
141141
| mainImage | Image? / Widget? | Set the main image of the page. | Null |
142142
| title | Text? / Widget? | Set the title text of the page. If null, then the widget is omitted. | Null |
143143
| body | Text? / Widget? | Set the body text of the page. If null, then the widget is omitted. | Null |

lib/src/models/page_view_model.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
44
class PageViewModel {
55
const PageViewModel({
66
this.pageColor,
7-
this.pageBackground,
7+
this.pageBackground = const SizedBox(),
88
this.iconImageAssetPath,
99
this.bubbleBackgroundColor = const Color(0x88FFFFFF),
1010
this.iconColor,
@@ -27,7 +27,7 @@ class PageViewModel {
2727
/// or adding a background image.
2828
///
2929
/// [pageColor] has priority over [pageBackground].
30-
final Widget? pageBackground;
30+
final Widget pageBackground;
3131

3232
/// Icon image path.
3333
final String? iconImageAssetPath;

lib/src/ui/page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Page extends StatelessWidget {
2222
Widget build(BuildContext context) {
2323
return Stack(
2424
children: <Widget>[
25-
pageViewModel.pageBackground ?? const SizedBox(),
25+
pageViewModel.pageBackground,
2626
Container(
2727
padding: const EdgeInsets.all(8.0),
2828
width: double.infinity,

0 commit comments

Comments
 (0)