null safety
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
import 'package:fcs/domain/entities/carton.dart';
|
||||
import 'package:fcs/helpers/theme.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
|
||||
|
||||
import 'carton_search.dart';
|
||||
|
||||
class CartonListRow extends StatefulWidget {
|
||||
final CallbackCartonSelect callbackCartonSelect;
|
||||
final Carton carton;
|
||||
final CallbackCartonSelect? callbackCartonSelect;
|
||||
final Carton? carton;
|
||||
|
||||
// const CartonListRow({this.carton, this.callbackCartonSelect});
|
||||
CartonListRow(
|
||||
{Key key, this.carton, this.callbackCartonSelect})
|
||||
{Key? key, this.carton, this.callbackCartonSelect})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
@@ -20,7 +20,7 @@ class CartonListRow extends StatefulWidget {
|
||||
|
||||
class _CartonListRowState extends State<CartonListRow> {
|
||||
final double dotSize = 15.0;
|
||||
Carton _carton;
|
||||
Carton? _carton;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -32,14 +32,14 @@ class _CartonListRowState extends State<CartonListRow> {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(color: Colors.grey[300]),
|
||||
bottom: BorderSide(color: Colors.grey.shade300),
|
||||
),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
if (widget.callbackCartonSelect != null)
|
||||
widget.callbackCartonSelect(widget.carton);
|
||||
widget.callbackCartonSelect!(widget.carton!);
|
||||
},
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
@@ -64,7 +64,7 @@ class _CartonListRowState extends State<CartonListRow> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: new Text(
|
||||
_carton.cartonNumber ?? "",
|
||||
_carton!.cartonNumber,
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.black),
|
||||
),
|
||||
@@ -72,7 +72,7 @@ class _CartonListRowState extends State<CartonListRow> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10.0, top: 10),
|
||||
child: new Text(
|
||||
_carton.userName ?? "",
|
||||
_carton!.userName,
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.grey),
|
||||
),
|
||||
@@ -86,7 +86,7 @@ class _CartonListRowState extends State<CartonListRow> {
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
new Text(
|
||||
"${_carton.cartonWeight?.toStringAsFixed(2) ?? ''} lb",
|
||||
"${_carton!.cartonWeight.toStringAsFixed(2)} lb",
|
||||
style: new TextStyle(
|
||||
fontSize: 15.0, color: Colors.grey),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user