update mobile added
This commit is contained in:
parent
705731d2ab
commit
9a5ddf2b0a
@ -19,12 +19,12 @@ if (project.hasProperty('google-services.json')) {
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '41'
|
||||
flutterVersionCode = '42'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '2.0.3'
|
||||
flutterVersionName = '2.0.4'
|
||||
}
|
||||
|
||||
def keystoreProperties = new Properties()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -633,6 +633,18 @@ class _planclaimsformState extends State<planclaimsform> {
|
||||
}
|
||||
}
|
||||
|
||||
// ✅ NEW VALIDATION: At least one PDF must be uploaded
|
||||
bool hasPdf = uploadedFiles.any((uf) {
|
||||
final ext = uf.file.extension?.toLowerCase() ?? '';
|
||||
return ext == 'pdf';
|
||||
});
|
||||
|
||||
if (!hasPdf) {
|
||||
ToastHelper.showErrorToast(context, 'Please upload at least one PDF document');
|
||||
setState(() => isLoading = false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Add files
|
||||
for (var uf in uploadedFiles) {
|
||||
final pf = uf.file;
|
||||
|
||||
@ -794,38 +794,38 @@ class _profileState extends State<profile> {
|
||||
),
|
||||
),
|
||||
SizedBox(height: Responsive.isDesktop(context) ? 40 : 10),
|
||||
if (Responsive.isDesktop(context))
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16.0),
|
||||
child: FutureBuilder<String>(
|
||||
future: _getAppVersion(), // Function to get the app version
|
||||
builder: (context, snapshot) {
|
||||
if (snapshot.connectionState ==
|
||||
ConnectionState.waiting) {
|
||||
return Text(
|
||||
'Loading version...',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 12, color: Colors.grey),
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
} else if (snapshot.hasError) {
|
||||
return Text(
|
||||
'Error fetching version',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 12, color: Colors.red),
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
} else {
|
||||
return Text(
|
||||
'Version ${snapshot.data}',
|
||||
style: GoogleFonts.poppins(
|
||||
fontSize: 12, color: Colors.grey),
|
||||
textAlign: TextAlign.center,
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
// if (Responsive.isDesktop(context))
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.only(bottom: 16.0),
|
||||
// child: FutureBuilder<String>(
|
||||
// future: _getAppVersion(), // Function to get the app version
|
||||
// builder: (context, snapshot) {
|
||||
// if (snapshot.connectionState ==
|
||||
// ConnectionState.waiting) {
|
||||
// return Text(
|
||||
// 'Loading version...',
|
||||
// style: GoogleFonts.poppins(
|
||||
// fontSize: 12, color: Colors.grey),
|
||||
// textAlign: TextAlign.center,
|
||||
// );
|
||||
// } else if (snapshot.hasError) {
|
||||
// return Text(
|
||||
// 'Error fetching version',
|
||||
// style: GoogleFonts.poppins(
|
||||
// fontSize: 12, color: Colors.red),
|
||||
// textAlign: TextAlign.center,
|
||||
// );
|
||||
// } else {
|
||||
// return Text(
|
||||
// 'Version ${snapshot.data}',
|
||||
// style: GoogleFonts.poppins(
|
||||
// fontSize: 12, color: Colors.grey),
|
||||
// textAlign: TextAlign.center,
|
||||
// );
|
||||
// }
|
||||
// },
|
||||
// ),
|
||||
// ),
|
||||
if (Responsive.isMobile(context) ||
|
||||
Responsive.isTablet(context))
|
||||
Padding(
|
||||
|
||||
@ -12,6 +12,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
import 'dart:convert';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
Future<String?> showUpdateMobileDialog(
|
||||
BuildContext context,
|
||||
@ -22,6 +23,7 @@ Future<String?> showUpdateMobileDialog(
|
||||
) {
|
||||
final controller = TextEditingController(text: currentMobile ?? '');
|
||||
bool isLoading = false;
|
||||
String? errorText;
|
||||
|
||||
return showDialog<String>(
|
||||
context: context,
|
||||
@ -37,10 +39,28 @@ Future<String?> showUpdateMobileDialog(
|
||||
|
||||
content: TextField(
|
||||
controller: controller,
|
||||
keyboardType: TextInputType.phone,
|
||||
decoration: const InputDecoration(
|
||||
keyboardType: TextInputType.number,
|
||||
maxLength: 10,
|
||||
|
||||
// ✅ Only allow digits
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
],
|
||||
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
if (value.length < 10) {
|
||||
errorText = "Mobile number must be 10 digits";
|
||||
} else {
|
||||
errorText = null;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
decoration: InputDecoration(
|
||||
labelText: "Enter Mobile Number",
|
||||
border: OutlineInputBorder(),
|
||||
errorText: errorText, // ✅ show validation message
|
||||
),
|
||||
),
|
||||
|
||||
@ -56,7 +76,7 @@ Future<String?> showUpdateMobileDialog(
|
||||
|
||||
// Save Button
|
||||
ElevatedButton(
|
||||
onPressed: isLoading
|
||||
onPressed: isLoading || controller.text.length != 10
|
||||
? null
|
||||
: () async {
|
||||
final newMobile = controller.text.trim();
|
||||
@ -66,6 +86,14 @@ Future<String?> showUpdateMobileDialog(
|
||||
return;
|
||||
}
|
||||
|
||||
// ✅ Double check backend validation
|
||||
if (newMobile.length != 10) {
|
||||
ToastHelper.showErrorToast(context, "Enter 10 digit mobile number");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
setState(() => isLoading = true);
|
||||
|
||||
final updateParam = {
|
||||
|
||||
@ -17,8 +17,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
#version: 1.0.32+32
|
||||
version: 1.0.20+23
|
||||
#version: 2.0.3+41
|
||||
version: 1.0.21+24
|
||||
#version: 2.0.4+42
|
||||
|
||||
environment:
|
||||
sdk: '>=3.3.3 <4.0.0'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user