fix(runtime): 37 late fields with == null checks were wrongly migrated -> nullable. Fixes LateInitializationError crashes on page navigation (shop/checkout/comment/data pages)
This commit is contained in:
@@ -33,7 +33,7 @@ class DesktopViewTicket extends StatefulWidget {
|
||||
class DesktopViewTicketState extends State<DesktopViewTicket> {
|
||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
|
||||
late Ticket ticket;
|
||||
Ticket? ticket;
|
||||
|
||||
final issueMsgController = TextEditingController();
|
||||
|
||||
@@ -220,14 +220,14 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
S.of(context).ticket_number_token(ticket.id!),
|
||||
S.of(context).ticket_number_token(ticket!.id!),
|
||||
style: TextStyle(
|
||||
fontSize: 24.0,
|
||||
color: Colors.black
|
||||
),
|
||||
),
|
||||
Text(
|
||||
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket.createdAt!),
|
||||
Utils.utcDatetimeStringToLocalDatetimeString(context, ticket!.createdAt!),
|
||||
style: TextStyle(
|
||||
fontSize: 14.0,
|
||||
color: Colors.black38,
|
||||
@@ -240,7 +240,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.only(top: 8.0, left: 16.0, right: 16.0, bottom: 24.0),
|
||||
child: Text(
|
||||
'${ticket.issue!.msg}',
|
||||
'${ticket!.issue!.msg}',
|
||||
style: TextStyle(
|
||||
color: Colors.black54,
|
||||
fontSize: 14.0,
|
||||
@@ -260,7 +260,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
||||
padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0),
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: showGalleryImages(mainContext, ticket.issue!.files!),
|
||||
child: showGalleryImages(mainContext, ticket!.issue!.files!),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
@@ -291,7 +291,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
||||
],
|
||||
);
|
||||
|
||||
if (ticket.followUps!.length > 0) {
|
||||
if (ticket!.followUps!.length > 0) {
|
||||
ticketCol.children.add(
|
||||
Container(
|
||||
width: double.maxFinite,
|
||||
@@ -305,8 +305,8 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
||||
),
|
||||
),
|
||||
);
|
||||
for (int i = 0; i < ticket.followUps!.length; i++) {
|
||||
FollowUp followUp = ticket.followUps![i];
|
||||
for (int i = 0; i < ticket!.followUps!.length; i++) {
|
||||
FollowUp followUp = ticket!.followUps![i];
|
||||
ticketCol.children.add(
|
||||
Container(
|
||||
width: double.maxFinite,
|
||||
@@ -406,7 +406,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
||||
width: mainSpace / 2,
|
||||
margin: EdgeInsets.only(top: 16.0, bottom: 16.0),
|
||||
padding: EdgeInsets.all(10.0),
|
||||
child: (ticket.isClosed == true) ?
|
||||
child: (ticket!.isClosed == true) ?
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
@@ -423,7 +423,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
||||
padding: EdgeInsets.only(left: 20.0, right: 20.0, top: 0.0, bottom: 30.0),
|
||||
child: TextLink(
|
||||
S.of(context).new_ticket,
|
||||
'/new-ticket/${ticket.store!.id}',
|
||||
'/new-ticket/${ticket!.store!.id}',
|
||||
),
|
||||
)
|
||||
],
|
||||
@@ -692,7 +692,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
||||
child: Text(S.of(context).ok),
|
||||
onPressed: () {
|
||||
Routes.router.navigateTo(context,
|
||||
'/my-support/${ticket.store!.id}',
|
||||
'/my-support/${ticket!.store!.id}',
|
||||
replace: true,
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user