fix null-safety error

hmxc
小赖 4 years ago
parent 305e443909
commit e5888eb860

@ -36,7 +36,7 @@ class SelectPay {
class _LifePayPageState extends State<LifePayPage> { class _LifePayPageState extends State<LifePayPage> {
EasyRefreshController? _controller; EasyRefreshController? _controller;
List<int> _selectYears = []; List<int> _selectYears = [];
List<LifePayModel> _models = []; List<LifePayModel?> _models = [];
List<SelectPay> _selectPay = []; List<SelectPay> _selectPay = [];
double _totalCost = 0; double _totalCost = 0;
int _count = 0; int _count = 0;
@ -237,7 +237,7 @@ class _LifePayPageState extends State<LifePayPage> {
), ),
), ),
], ],
body: BeeListView( body: BeeListView<LifePayModel>(
path: API.manager.dailyPaymentList, path: API.manager.dailyPaymentList,
controller: _controller, controller: _controller,
extraParams: {'estateId': appProvider.selectedHouse!.estateId}, extraParams: {'estateId': appProvider.selectedHouse!.estateId},
@ -253,7 +253,7 @@ class _LifePayPageState extends State<LifePayPage> {
return lifePayModels; return lifePayModels;
}, },
builder: (items) { builder: (items) {
_models = items as List<LifePayModel>; if (items != null) _models = items as List<LifePayModel?>;
return Column( return Column(
children: [ children: [
_buildHouseCard(), _buildHouseCard(),

@ -120,8 +120,8 @@ class _SignInPageState extends State<SignInPage> {
else if (TextUtil.isEmpty(_code.text)) else if (TextUtil.isEmpty(_code.text))
BotToast.showText(text: '验证码不能为空'); BotToast.showText(text: '验证码不能为空');
else { else {
bool result = await (_showLoginVerify() as FutureOr<bool>); bool? result = await _showLoginVerify();
_parseLogin(result); if (result != null) _parseLogin(result);
} }
}, },
height: 89.w, height: 89.w,

@ -50,7 +50,7 @@ class BeeListView<T> extends StatefulWidget {
final List<T> Function(BaseListModel model) convert; final List<T> Function(BaseListModel model) convert;
/// ///
final Widget Function(List<T> items) builder; final Widget Function(dynamic items) builder;
/// ///
final int size; final int size;

@ -147,7 +147,7 @@ class _AdviceDetailPageState extends State<AdviceDetailPage> {
), ),
..._model.appAdviceDetailVo!.appAdviceContentVos! ..._model.appAdviceDetailVo!.appAdviceContentVos!
.map((e) => _buildAdviceContent(e)) .map((e) => _buildAdviceContent(e))
.toList() as Iterable<Widget>, .toList(),
], ],
); );
} }

Loading…
Cancel
Save