fix: set cell style nullable (#3984)

This commit is contained in:
Yijing Huang
2023-11-21 19:49:01 -07:00
committed by GitHub
parent 16467e9c13
commit a7364e1f4a

View File

@ -130,16 +130,16 @@ GridCellWidget _getMobileCardCellWidget(
) { ) {
switch (cellContext.fieldType) { switch (cellContext.fieldType) {
case FieldType.RichText: case FieldType.RichText:
style as GridTextCellStyle; style as GridTextCellStyle?;
return MobileTextCell( return MobileTextCell(
cellControllerBuilder: cellControllerBuilder, cellControllerBuilder: cellControllerBuilder,
hintText: style.placeholder, hintText: style?.placeholder,
); );
case FieldType.Number: case FieldType.Number:
style as GridNumberCellStyle; style as GridNumberCellStyle?;
return MobileNumberCell( return MobileNumberCell(
cellControllerBuilder: cellControllerBuilder, cellControllerBuilder: cellControllerBuilder,
hintText: style.placeholder, hintText: style?.placeholder,
); );
case FieldType.LastEditedTime: case FieldType.LastEditedTime:
case FieldType.CreatedTime: case FieldType.CreatedTime:
@ -153,17 +153,17 @@ GridCellWidget _getMobileCardCellWidget(
key: key, key: key,
); );
case FieldType.DateTime: case FieldType.DateTime:
style as DateCellStyle; style as DateCellStyle?;
return MobileDateCell( return MobileDateCell(
cellControllerBuilder: cellControllerBuilder, cellControllerBuilder: cellControllerBuilder,
hintText: style.placeholder, hintText: style?.placeholder,
key: key, key: key,
); );
case FieldType.URL: case FieldType.URL:
style as GridURLCellStyle; style as GridURLCellStyle?;
return MobileURLCell( return MobileURLCell(
cellControllerBuilder: cellControllerBuilder, cellControllerBuilder: cellControllerBuilder,
hintText: style.placeholder, hintText: style?.placeholder,
key: key, key: key,
); );
// TODO(yijing): implement the following mobile select option cell // TODO(yijing): implement the following mobile select option cell