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:
@@ -33,7 +33,7 @@ class DesktopViewTicket extends StatefulWidget {
|
||||
class DesktopViewTicketState extends State<DesktopViewTicket> {
|
||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
|
||||
Ticket ticket;
|
||||
late Ticket ticket;
|
||||
|
||||
final issueMsgController = TextEditingController();
|
||||
|
||||
@@ -144,7 +144,7 @@ class DesktopViewTicketState extends State<DesktopViewTicket> {
|
||||
),
|
||||
autofocus: false,
|
||||
validator: (String? value) {
|
||||
if (value.trim().isEmpty) {
|
||||
if (value!.trim().isEmpty) {
|
||||
return S.of(context).this_field_is_required;
|
||||
}
|
||||
return null;
|
||||
@@ -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,
|
||||
@@ -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}',
|
||||
),
|
||||
)
|
||||
],
|
||||
@@ -693,7 +693,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