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:
@@ -34,7 +34,7 @@ class MobileViewTicket extends StatefulWidget {
|
||||
class MobileViewTicketState extends State<MobileViewTicket> {
|
||||
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
||||
|
||||
Ticket ticket;
|
||||
late Ticket ticket;
|
||||
|
||||
final issueMsgController = TextEditingController();
|
||||
|
||||
@@ -123,7 +123,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
||||
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,
|
||||
@@ -141,7 +141,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
||||
Container(
|
||||
width: double.maxFinite,
|
||||
padding: EdgeInsets.only(top: 16.0, bottom: 16.0, left: 16.0, right: 16.0),
|
||||
child: showGalleryImages(mainContext, ticket.issue.files),
|
||||
child: showGalleryImages(mainContext, ticket.issue!.files),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(
|
||||
@@ -171,7 +171,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
||||
],
|
||||
);
|
||||
|
||||
if (ticket.followUps.length > 0) {
|
||||
if (ticket.followUps!.length > 0) {
|
||||
view.children.add(
|
||||
Container(
|
||||
width: double.maxFinite,
|
||||
@@ -185,8 +185,8 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
||||
),
|
||||
),
|
||||
);
|
||||
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];
|
||||
view.children.add(
|
||||
Container(
|
||||
width: double.maxFinite,
|
||||
@@ -294,7 +294,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
||||
),
|
||||
autofocus: false,
|
||||
validator: (String? value) {
|
||||
if (value.trim().isEmpty) {
|
||||
if (value!.trim().isEmpty) {
|
||||
return S.of(context).this_field_is_required;
|
||||
}
|
||||
return null;
|
||||
@@ -353,7 +353,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
||||
),
|
||||
);
|
||||
|
||||
if (ticket.followUps.length > 0) {
|
||||
if (ticket.followUps!.length > 0) {
|
||||
view.children.add(
|
||||
Container(
|
||||
width: double.maxFinite,
|
||||
@@ -393,7 +393,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
||||
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}',
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -690,7 +690,7 @@ class MobileViewTicketState extends State<MobileViewTicket> {
|
||||
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