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')
|
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||||
if (flutterVersionCode == null) {
|
if (flutterVersionCode == null) {
|
||||||
flutterVersionCode = '41'
|
flutterVersionCode = '42'
|
||||||
}
|
}
|
||||||
|
|
||||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||||
if (flutterVersionName == null) {
|
if (flutterVersionName == null) {
|
||||||
flutterVersionName = '2.0.3'
|
flutterVersionName = '2.0.4'
|
||||||
}
|
}
|
||||||
|
|
||||||
def keystoreProperties = new Properties()
|
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
|
// Add files
|
||||||
for (var uf in uploadedFiles) {
|
for (var uf in uploadedFiles) {
|
||||||
final pf = uf.file;
|
final pf = uf.file;
|
||||||
|
|||||||
@ -794,38 +794,38 @@ class _profileState extends State<profile> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: Responsive.isDesktop(context) ? 40 : 10),
|
SizedBox(height: Responsive.isDesktop(context) ? 40 : 10),
|
||||||
if (Responsive.isDesktop(context))
|
// if (Responsive.isDesktop(context))
|
||||||
Padding(
|
// Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 16.0),
|
// padding: const EdgeInsets.only(bottom: 16.0),
|
||||||
child: FutureBuilder<String>(
|
// child: FutureBuilder<String>(
|
||||||
future: _getAppVersion(), // Function to get the app version
|
// future: _getAppVersion(), // Function to get the app version
|
||||||
builder: (context, snapshot) {
|
// builder: (context, snapshot) {
|
||||||
if (snapshot.connectionState ==
|
// if (snapshot.connectionState ==
|
||||||
ConnectionState.waiting) {
|
// ConnectionState.waiting) {
|
||||||
return Text(
|
// return Text(
|
||||||
'Loading version...',
|
// 'Loading version...',
|
||||||
style: GoogleFonts.poppins(
|
// style: GoogleFonts.poppins(
|
||||||
fontSize: 12, color: Colors.grey),
|
// fontSize: 12, color: Colors.grey),
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
);
|
// );
|
||||||
} else if (snapshot.hasError) {
|
// } else if (snapshot.hasError) {
|
||||||
return Text(
|
// return Text(
|
||||||
'Error fetching version',
|
// 'Error fetching version',
|
||||||
style: GoogleFonts.poppins(
|
// style: GoogleFonts.poppins(
|
||||||
fontSize: 12, color: Colors.red),
|
// fontSize: 12, color: Colors.red),
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
);
|
// );
|
||||||
} else {
|
// } else {
|
||||||
return Text(
|
// return Text(
|
||||||
'Version ${snapshot.data}',
|
// 'Version ${snapshot.data}',
|
||||||
style: GoogleFonts.poppins(
|
// style: GoogleFonts.poppins(
|
||||||
fontSize: 12, color: Colors.grey),
|
// fontSize: 12, color: Colors.grey),
|
||||||
textAlign: TextAlign.center,
|
// textAlign: TextAlign.center,
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
if (Responsive.isMobile(context) ||
|
if (Responsive.isMobile(context) ||
|
||||||
Responsive.isTablet(context))
|
Responsive.isTablet(context))
|
||||||
Padding(
|
Padding(
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:google_fonts/google_fonts.dart';
|
import 'package:google_fonts/google_fonts.dart';
|
||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
Future<String?> showUpdateMobileDialog(
|
Future<String?> showUpdateMobileDialog(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
@ -22,6 +23,7 @@ Future<String?> showUpdateMobileDialog(
|
|||||||
) {
|
) {
|
||||||
final controller = TextEditingController(text: currentMobile ?? '');
|
final controller = TextEditingController(text: currentMobile ?? '');
|
||||||
bool isLoading = false;
|
bool isLoading = false;
|
||||||
|
String? errorText;
|
||||||
|
|
||||||
return showDialog<String>(
|
return showDialog<String>(
|
||||||
context: context,
|
context: context,
|
||||||
@ -37,10 +39,28 @@ Future<String?> showUpdateMobileDialog(
|
|||||||
|
|
||||||
content: TextField(
|
content: TextField(
|
||||||
controller: controller,
|
controller: controller,
|
||||||
keyboardType: TextInputType.phone,
|
keyboardType: TextInputType.number,
|
||||||
decoration: const InputDecoration(
|
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",
|
labelText: "Enter Mobile Number",
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
|
errorText: errorText, // ✅ show validation message
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
@ -56,7 +76,7 @@ Future<String?> showUpdateMobileDialog(
|
|||||||
|
|
||||||
// Save Button
|
// Save Button
|
||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: isLoading
|
onPressed: isLoading || controller.text.length != 10
|
||||||
? null
|
? null
|
||||||
: () async {
|
: () async {
|
||||||
final newMobile = controller.text.trim();
|
final newMobile = controller.text.trim();
|
||||||
@ -66,6 +86,14 @@ Future<String?> showUpdateMobileDialog(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ✅ Double check backend validation
|
||||||
|
if (newMobile.length != 10) {
|
||||||
|
ToastHelper.showErrorToast(context, "Enter 10 digit mobile number");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setState(() => isLoading = true);
|
setState(() => isLoading = true);
|
||||||
|
|
||||||
final updateParam = {
|
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
|
# 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.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
#version: 1.0.32+32
|
#version: 1.0.32+32
|
||||||
version: 1.0.20+23
|
version: 1.0.21+24
|
||||||
#version: 2.0.3+41
|
#version: 2.0.4+42
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.3.3 <4.0.0'
|
sdk: '>=3.3.3 <4.0.0'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user