This commit is contained in:
2026-07-12 04:33:48 +08:00
parent f8a90ad305
commit e7ce0f7bae
151 changed files with 2765 additions and 2947 deletions

View File

@@ -1,5 +1,5 @@
import 'package:badges/badges.dart';
import 'package:badges/badges.dart' as badges;
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
@@ -17,10 +17,9 @@ import '../../store/store.dart';
import '../../utils/util_web.dart' if (dart.library.io) '../../utils/util_io.dart';
class MobileNewTicket extends StatefulWidget {
final Key key;
final int businessId;
const MobileNewTicket({this.key, int businessId}) :
const MobileNewTicket({Key? key, required int businessId}) :
businessId = businessId ?? Constants.BUSINESS_ID;
@override
@@ -110,8 +109,8 @@ class MobileNewTicketState extends State<MobileNewTicket> {
fontSize: 18.0
),
autofocus: true,
validator: (String value) {
if (value.trim().isEmpty) {
validator: (String? value) {
if (value == null || value.trim().isEmpty) {
return S.of(context).this_field_is_required;
}
return null;
@@ -162,7 +161,7 @@ class MobileNewTicketState extends State<MobileNewTicket> {
padding: EdgeInsets.only(top: 20.0, left: 16.0, right: 16.0, bottom: 20.0),
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Theme.of(context).primaryColor,
backgroundColor: Theme.of(context).primaryColor,
),
child: Text(
S.of(context).submit,
@@ -221,8 +220,8 @@ class MobileNewTicketState extends State<MobileNewTicket> {
}
void _submit() {
final FormState form = _formKey.currentState;
if (form.validate()) {
final FormState? form = _formKey.currentState;
if (form != null && form.validate()) {
setState(() {
onSubmitting = true;
});
@@ -331,14 +330,13 @@ class MobileNewTicketState extends State<MobileNewTicket> {
galleryImagesFlag[imageId]['path'] = path;
});
});
return null;
}
);
},
);
row.children.add(Badge(
position: BadgePosition.topEnd(top: -10.0, end: 10.0),
row.children.add(badges.Badge(
position: badges.BadgePosition.topEnd(top: -10.0, end: 10.0),
badgeContent: Container(
child: GestureDetector(
child: Icon(
@@ -374,7 +372,7 @@ class MobileNewTicketState extends State<MobileNewTicket> {
ElevatedButton(
child: Text(S.of(context).yes_i_am_sure),
style: ElevatedButton.styleFrom(
primary: Theme.of(context).primaryColor,
backgroundColor: Theme.of(context).primaryColor,
),
onPressed: () {
Navigator.of(context).pop();