phase3: nullfix.py batch script — bang/late/param-nullable
Automated null-safety fixes driven by dart analyze (no corruption): - unchecked_use_of_nullable_value: insert '!' on receiver (property/method/[]/op) - not_initialized field/var: mark 'late' - missing_default_value_for_parameter: nullable param Errors: 2374(peak) -> 907
This commit is contained in:
@@ -22,7 +22,7 @@ class ShopPromoteState extends State<ShopPromote> {
|
||||
double sideSpace = 0;
|
||||
double mainSpace = 1200;
|
||||
|
||||
Business _business;
|
||||
late Business _business;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -90,7 +90,7 @@ class ShopPromoteState extends State<ShopPromote> {
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: <Widget>[],
|
||||
);
|
||||
for (var i = 0; i < _business.promoProducts.length; i++) {
|
||||
for (var i = 0; i < _business.promoProducts!.length; i++) {
|
||||
promotRow.children.add(Container(
|
||||
padding: EdgeInsets.only(
|
||||
left: 10.0,
|
||||
@@ -129,17 +129,17 @@ class ShopPromoteState extends State<ShopPromote> {
|
||||
GestureDetector(
|
||||
child: Container(
|
||||
child: Util.showImage(
|
||||
_business.promoProducts[i].imagePath,
|
||||
_business.promoProducts![i].imagePath,
|
||||
width: 120.0,
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
_showProductDetail(_business.promoProducts[i]);
|
||||
_showProductDetail(_business.promoProducts![i]);
|
||||
},
|
||||
),
|
||||
Container(
|
||||
child: Text(
|
||||
_business.promoProducts[i].name,
|
||||
_business.promoProducts![i].name,
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 14.0),
|
||||
@@ -149,16 +149,16 @@ class ShopPromoteState extends State<ShopPromote> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
ShowPrice(
|
||||
_business.promoProducts[i].price,
|
||||
_business.promoProducts![i].price,
|
||||
currencySign: '\$',
|
||||
fontWeight: FontWeight.bold,
|
||||
smallFontSize: 15,
|
||||
largeFontSize: 24,
|
||||
regularPrice: _business.promoProducts[i].regularPrice,
|
||||
regularPrice: _business.promoProducts![i].regularPrice,
|
||||
),
|
||||
Container(
|
||||
child: AddRemoveButton(
|
||||
product: _business.promoProducts[i],
|
||||
product: _business.promoProducts![i],
|
||||
business: _business,
|
||||
addOnly: true,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user