phase3: @required->required keyword, nullable for-in iterator fix. 309->251
This commit is contained in:
@@ -22,8 +22,8 @@ class DoubleBackToCloseApp extends StatefulWidget {
|
||||
/// the back-button.
|
||||
const DoubleBackToCloseApp({
|
||||
Key? key,
|
||||
@required this.snackBar,
|
||||
@required this.child,
|
||||
required this.snackBar,
|
||||
required this.child,
|
||||
}) : assert(snackBar != null),
|
||||
assert(child != null),
|
||||
super(key: key);
|
||||
|
||||
@@ -204,7 +204,7 @@ class DesktopNewCommentState extends State<DesktopNewComment> {
|
||||
);
|
||||
|
||||
if (comment != null && comment.images!.length > 0) {
|
||||
for (ProductImage image in comment.images) {
|
||||
for (ProductImage image in comment.images!) {
|
||||
row.children.add(
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 10.0),
|
||||
|
||||
@@ -190,7 +190,7 @@ class DesktopOrderDetailState extends State<DesktopOrderDetail> {
|
||||
}
|
||||
}
|
||||
|
||||
for (CartLineItem lineItem in order.cartInfo!.productList) {
|
||||
for (CartLineItem lineItem in order.cartInfo!.productList!) {
|
||||
|
||||
col.children.add(Container(
|
||||
padding: EdgeInsets.only(top: 16.0, bottom: 0.0),
|
||||
@@ -884,7 +884,7 @@ class DesktopOrderDetailState extends State<DesktopOrderDetail> {
|
||||
),
|
||||
),);
|
||||
|
||||
for (Fulfillment fulfillment in order.fulfillments) {
|
||||
for (Fulfillment fulfillment in order.fulfillments!) {
|
||||
col.children.add(Container(
|
||||
padding: EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
width: double.infinity,
|
||||
|
||||
@@ -30,7 +30,7 @@ class DesktopProductDetailPage extends StatefulWidget {
|
||||
final Product product;
|
||||
|
||||
const DesktopProductDetailPage(
|
||||
{@required this.business, @required this.product, Key? key})
|
||||
{required this.business, required this.product, Key? key})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
|
||||
@@ -11,7 +11,7 @@ class DesktopShoppingCartWidget extends StatefulWidget {
|
||||
final Business business;
|
||||
final Function? onTap;
|
||||
|
||||
DesktopShoppingCartWidget({@required this.business, this.onTap});
|
||||
DesktopShoppingCartWidget({required this.business, this.onTap});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => DesktopShoppingCartWidgetState();
|
||||
|
||||
@@ -12,7 +12,7 @@ class ShoppingCartWidget extends StatefulWidget {
|
||||
final Business business;
|
||||
final Function? onTap;
|
||||
|
||||
ShoppingCartWidget({@required this.business, this.onTap});
|
||||
ShoppingCartWidget({required this.business, this.onTap});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => ShoppingCartWidgetState();
|
||||
|
||||
@@ -9,12 +9,12 @@ class AnimationPointManager {
|
||||
static late AnimationController controller2;
|
||||
|
||||
Future<void> addParabolicAniamtion({
|
||||
@required TickerProvider vsync,
|
||||
@required GlobalKey stackKey,
|
||||
@required GlobalKey startKey,
|
||||
@required GlobalKey endKey,
|
||||
@required Duration duration,
|
||||
@required AnimationStatusListener statusListener,
|
||||
required TickerProvider vsync,
|
||||
required GlobalKey stackKey,
|
||||
required GlobalKey startKey,
|
||||
required GlobalKey endKey,
|
||||
required Duration duration,
|
||||
required AnimationStatusListener statusListener,
|
||||
Color color = Colors.red,
|
||||
double size = 20,
|
||||
Offset startAdjustOffset = Offset.zero,
|
||||
@@ -51,10 +51,10 @@ class AnimationPointManager {
|
||||
}
|
||||
|
||||
Future<void> addPopupAniamtion({
|
||||
@required TickerProvider vsync,
|
||||
@required GlobalKey stackKey,
|
||||
@required GlobalKey startKey,
|
||||
@required Widget child,
|
||||
required TickerProvider vsync,
|
||||
required GlobalKey stackKey,
|
||||
required GlobalKey startKey,
|
||||
required Widget child,
|
||||
Duration? duration,
|
||||
Offset popupOffset = Offset.zero,
|
||||
AnimationStatusListener? statusListener,
|
||||
|
||||
@@ -14,7 +14,7 @@ import 'rules.dart';
|
||||
import 'options_base.dart';
|
||||
|
||||
class CheckOptions extends OptionsBase {
|
||||
CheckOptions({@required Product product, @required int index, @required Map<String, dynamic> selections})
|
||||
CheckOptions({required Product product, required int index, required Map<String, dynamic> selections})
|
||||
: super(product: product, index: index, selections: selections);
|
||||
|
||||
@override
|
||||
|
||||
@@ -9,7 +9,7 @@ abstract class OptionsBase extends StatefulWidget {
|
||||
final Product product;
|
||||
final int index;
|
||||
final Map<String, dynamic> selections;
|
||||
OptionsBase({@required Product product, @required int index, @required Map<String, dynamic> selections})
|
||||
OptionsBase({required Product product, required int index, required Map<String, dynamic> selections})
|
||||
: product = product,
|
||||
index = index,
|
||||
selections = selections;
|
||||
|
||||
@@ -14,7 +14,7 @@ import 'options_base.dart';
|
||||
import 'rules.dart';
|
||||
|
||||
class QtyOptions extends OptionsBase {
|
||||
QtyOptions({@required Product product, @required int index, @required Map<String, dynamic> selections})
|
||||
QtyOptions({required Product product, required int index, required Map<String, dynamic> selections})
|
||||
: super(product: product, index: index, selections: selections);
|
||||
|
||||
@override
|
||||
|
||||
@@ -14,7 +14,7 @@ import 'options_base.dart';
|
||||
import 'rules.dart';
|
||||
|
||||
class RadioOptions extends OptionsBase {
|
||||
RadioOptions({@required Product product, @required int index, @required Map<String, dynamic> selections})
|
||||
RadioOptions({required Product product, required int index, required Map<String, dynamic> selections})
|
||||
: super(product: product, index: index, selections: selections);
|
||||
|
||||
@override
|
||||
|
||||
@@ -12,10 +12,10 @@ class ParabolicAnimationWidget extends AnimatedWidget {
|
||||
final Offset endAdjustOffset;
|
||||
|
||||
late ParabolicAnimationWidget({
|
||||
@required Animation<double> animation,
|
||||
@required this.stackKey,
|
||||
@required this.startKey,
|
||||
@required this.endKey,
|
||||
required Animation<double> animation,
|
||||
required this.stackKey,
|
||||
required this.startKey,
|
||||
required this.endKey,
|
||||
this.size = 20.0,
|
||||
this.color = Colors.red,
|
||||
this.startAdjustOffset = Offset.zero,
|
||||
|
||||
@@ -10,10 +10,10 @@ class PopupAnimationWidget extends AnimatedWidget {
|
||||
final Animation<double> animation;
|
||||
|
||||
late PopupAnimationWidget({
|
||||
@required this.animation,
|
||||
@required this.stackKey,
|
||||
@required this.startKey,
|
||||
@required this.child,
|
||||
required this.animation,
|
||||
required this.stackKey,
|
||||
required this.startKey,
|
||||
required this.child,
|
||||
this.color = Colors.yellow,
|
||||
this.popupOffset = Offset.zero,
|
||||
}) : super(listenable: animation);
|
||||
|
||||
@@ -22,7 +22,7 @@ class MobileAttributeSelection extends StatefulWidget {
|
||||
final Key? key;
|
||||
final GlobalKey? startKey;
|
||||
|
||||
const MobileAttributeSelection({@required this.product, @required this.business, this.key, this.startKey})
|
||||
const MobileAttributeSelection({required this.product, required this.business, this.key, this.startKey})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
|
||||
@@ -816,9 +816,9 @@ class MobileMeState extends State<MobileMe> {
|
||||
|
||||
class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
|
||||
_SliverAppBarDelegate({
|
||||
@required this.minHeight,
|
||||
@required this.maxHeight,
|
||||
@required this.child,
|
||||
required this.minHeight,
|
||||
required this.maxHeight,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
final double minHeight;
|
||||
|
||||
@@ -168,7 +168,7 @@ class MobileNewCommentState extends State<MobileNewComment> {
|
||||
);
|
||||
|
||||
if (comment != null && comment.images!.length > 0) {
|
||||
for (ProductImage image in comment.images) {
|
||||
for (ProductImage image in comment.images!) {
|
||||
row.children.add(
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 10.0),
|
||||
|
||||
@@ -205,7 +205,7 @@ class MobileOrderDetailState extends State<MobileOrderDetail> {
|
||||
}
|
||||
}
|
||||
|
||||
for (CartLineItem lineItem in order.cartInfo!.productList) {
|
||||
for (CartLineItem lineItem in order.cartInfo!.productList!) {
|
||||
|
||||
col.children.add(Container(
|
||||
padding: EdgeInsets.only(top: 16.0, bottom: 0.0),
|
||||
@@ -899,7 +899,7 @@ class MobileOrderDetailState extends State<MobileOrderDetail> {
|
||||
),
|
||||
),);
|
||||
|
||||
for (Fulfillment fulfillment in order.fulfillments) {
|
||||
for (Fulfillment fulfillment in order.fulfillments!) {
|
||||
col.children.add(Container(
|
||||
padding: EdgeInsets.only(top: 10.0, bottom: 10.0),
|
||||
width: double.infinity,
|
||||
|
||||
@@ -33,7 +33,7 @@ class MobileProductDetailPage extends StatefulWidget {
|
||||
final Product product;
|
||||
|
||||
const MobileProductDetailPage(
|
||||
{@required this.business, @required this.product, Key? key})
|
||||
{required this.business, required this.product, Key? key})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
@@ -447,9 +447,9 @@ class MobileProductDetailPageState extends State<MobileProductDetailPage>
|
||||
|
||||
class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate {
|
||||
_SliverAppBarDelegate({
|
||||
@required this.minHeight,
|
||||
@required this.maxHeight,
|
||||
@required this.child,
|
||||
required this.minHeight,
|
||||
required this.maxHeight,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
final double minHeight;
|
||||
|
||||
@@ -582,7 +582,7 @@ class ShopState extends State<Shop>
|
||||
children: <Widget>[],
|
||||
);
|
||||
if (comment.images!.length > 0) {
|
||||
for (ProductImage image in comment.images) {
|
||||
for (ProductImage image in comment.images!) {
|
||||
imageRow.children.add(
|
||||
GestureDetector(
|
||||
child: Container(
|
||||
@@ -1416,7 +1416,7 @@ class ShopState extends State<Shop>
|
||||
))
|
||||
],
|
||||
)));
|
||||
for (var p in cp.products) {
|
||||
for (var p in cp.products!) {
|
||||
var pStack = new Stack(
|
||||
children: <Widget>[],
|
||||
);
|
||||
@@ -1932,9 +1932,9 @@ class ShopState extends State<Shop>
|
||||
|
||||
class _SliverAppBarDelegate2 extends SliverPersistentHeaderDelegate {
|
||||
_SliverAppBarDelegate2({
|
||||
@required this.minHeight,
|
||||
@required this.maxHeight,
|
||||
@required this.child,
|
||||
required this.minHeight,
|
||||
required this.maxHeight,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
final double minHeight;
|
||||
|
||||
@@ -23,7 +23,7 @@ class ShoppingCartBar extends StatefulWidget {
|
||||
final OnPanelOpenCloseRequest? onPanelOpenCloseRequest;
|
||||
final bool barAtBottom;
|
||||
final bool hasPicture;
|
||||
ShoppingCartBar({@required this.business, this.endKey,
|
||||
ShoppingCartBar({required this.business, this.endKey,
|
||||
this.onEmptyCartListener, this.onPanelOpenCloseRequest,
|
||||
this.barAtBottom = false, this.hasPicture = false
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user