2026-04-15

This commit is contained in:
mageshwaran committed 2026-04-15 12:32:30 +05:30
1 parent d01e5ba860
commit 96de59e9be
46 files changed
+1299 -1191

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
class AppTextStyles {
static const TextStyle thin = TextStyle(
fontFamily: 'Gilroy-Thin',
);
static const TextStyle ultraLight = TextStyle(
fontFamily: 'Gilroy-UltraLight',
);
static const TextStyle ultralight = ultraLight;
static const TextStyle light = TextStyle(
fontFamily: 'Gilroy-Light',
);
static const TextStyle regular = TextStyle(
fontFamily: 'Gilroy-Regular',
);
static const TextStyle medium = TextStyle(
fontFamily: 'Gilroy-Medium',
);
static const TextStyle semiBold = TextStyle(
fontFamily: 'Gilroy-SemiBold',
);
static const TextStyle semibold = semiBold;
static const TextStyle semi_bold = semiBold;
static const TextStyle bold = TextStyle(
fontFamily: 'Gilroy-Bold',
);
static const TextStyle extraBold = TextStyle(
fontFamily: 'Gilroy-ExtraBold',
);
static const TextStyle extrabold = extraBold;
static const TextStyle black = TextStyle(
fontFamily: 'Gilroy-Black',
);
static const TextStyle heavy = TextStyle(
fontFamily: 'Gilroy-Heavy',
);
}
+2 -3
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:taxglide/consts/app_colors.dart';
import 'package:taxglide/consts/app_style.dart';
class CommanButton extends StatelessWidget {
final String text;
@@ -51,9 +52,7 @@ class CommanButton extends StatelessWidget {
],
Text(
text,
style: const TextStyle(
fontFamily: 'Gilroy-Medium',
fontWeight: FontWeight.w500,
style: AppTextStyles.semiBold.copyWith(
fontSize: 16,
height: 1.4,
letterSpacing: 0.03 * 16,
+9 -12
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:taxglide/consts/app_style.dart';
class CommonInfoPopup {
/// 🔹 Show a reusable popup dialog
@@ -22,10 +23,8 @@ class CommonInfoPopup {
contentPadding: const EdgeInsets.fromLTRB(20, 0, 20, 10),
title: Text(
title,
style: const TextStyle(
fontFamily: 'Gilroy-Bold',
style: AppTextStyles.bold.copyWith(
fontSize: 18,
fontWeight: FontWeight.w700,
color: Colors.black87,
),
),
@@ -48,8 +47,7 @@ class CommonInfoPopup {
child: Text(
content,
textAlign: TextAlign.justify,
style: const TextStyle(
fontFamily: 'Gilroy-Medium',
style: AppTextStyles.regular.copyWith(
fontSize: 14,
height: 1.6,
color: Colors.black54,
@@ -63,15 +61,14 @@ class CommonInfoPopup {
actions: [
TextButton(
onPressed: () => Navigator.of(ctx).pop(),
child: const Text(
"Close",
style: TextStyle(
fontFamily: 'Gilroy-SemiBold',
fontSize: 14,
color: Color(0xFF6A4BFC),
),
child: Text(
"Close",
style: AppTextStyles.regular.copyWith(
fontSize: 14,
color: const Color(0xFF6A4BFC),
),
),
),
],
);
},
+2 -3
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:taxglide/consts/app_style.dart';
import 'package:get/get.dart';
import 'package:taxglide/consts/app_colors.dart';
import 'package:taxglide/model/serivce_list_model.dart';
@@ -67,9 +68,7 @@ class CommonServiceItem extends StatelessWidget {
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontFamily: 'Gilroy-SemiBold',
fontWeight: FontWeight.w600,
style: AppTextStyles.semiBold.copyWith(
fontSize: 13,
height: 1.3,
letterSpacing: 0.02,
+6 -9
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:taxglide/consts/app_colors.dart';
import 'package:taxglide/consts/app_style.dart';
import 'package:flutter/services.dart';
class CommanTextFormField extends StatelessWidget {
@@ -69,15 +70,13 @@ class CommanTextFormField extends StatelessWidget {
prefixIcon: prefixIcon != null
? Icon(prefixIcon, color: AppColors.authleading)
: null,
hintStyle: TextStyle(
fontFamily: 'Gilroy-Medium',
fontWeight: FontWeight.w400,
hintStyle: AppTextStyles.medium.copyWith(
fontSize: 11.31,
height: 1.4,
letterSpacing: 0.03,
color: hasError
? Colors.red.withOpacity(0.6)
: Colors.grey.shade500,
: AppColors.authleading
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(6),
@@ -85,7 +84,7 @@ class CommanTextFormField extends StatelessWidget {
color: hasError
? Colors.red
: readOnly
? Colors.grey.shade300
? AppColors.authleading
: const Color(0xFFDFDFDF),
width: 1,
),
@@ -113,13 +112,11 @@ class CommanTextFormField extends StatelessWidget {
),
),
),
style: TextStyle(
fontFamily: 'Gilroy-Medium',
fontWeight: FontWeight.w500,
style: AppTextStyles.medium.copyWith(
fontSize: 11.31,
height: 1.4,
letterSpacing: 0.03,
color: readOnly ? Colors.grey.shade600 : AppColors.authleading,
color: readOnly ? AppColors.authleading : AppColors.authleading,
),
),
);
+32
View File
@@ -1,10 +1,13 @@
import 'dart:io';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:path_provider/path_provider.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:open_filex/open_filex.dart';
import 'package:gal/gal.dart';
import 'package:taxglide/services/notification_service.dart';
class DownloadHelper {
static const String API_BASE_URL = "https://www.taxglide.amrithaa.net/api/";
@@ -254,6 +257,13 @@ class DownloadHelper {
}
print("✅ File downloaded to: $savePath");
// ⭐ Show Download Notification
try {
Get.find<NotificationService>().showDownloadNotification(fileName, savePath);
} catch (e) {
debugPrint('⚠️ Could not show download notification: $e');
}
// Open the downloaded file
await openDownloadedFile(savePath);
@@ -349,6 +359,28 @@ class DownloadHelper {
}
}
/// ⭐ NEW: Open folder in system file manager
static Future<void> openFolder(String path) async {
print("📂 Opening folder: $path");
try {
final dir = Directory(path);
if (!await dir.exists()) {
print("❌ Folder not found at $path");
return;
}
// On Android, most file managers respond well to OpenFilex on a directory
final result = await OpenFilex.open(path);
if (result.type != ResultType.done) {
print("⚠️ Could not open folder: ${result.message}");
}
} catch (e) {
print("❌ Error opening folder: $e");
}
}
/// Get all files from Send folder
static Future<List<File>> getSentFiles() async {
try {
+3 -3
View File
@@ -318,7 +318,7 @@ class LabeledTextField extends StatelessWidget {
Text(
label,
style: const TextStyle(
fontFamily: 'Gilroy-SemiBold',
fontFamily: "Gilroy",
fontWeight: FontWeight.w600,
fontSize: 16,
height: 1.3,
@@ -391,7 +391,7 @@ class SingleImageSectionField extends StatelessWidget {
Text(
title,
style: const TextStyle(
fontFamily: 'Gilroy-SemiBold',
fontFamily: "Gilroy",
fontWeight: FontWeight.w600,
fontSize: 16,
height: 1.3,
@@ -527,7 +527,7 @@ class FileUploadSectionField extends StatelessWidget {
Text(
title,
style: const TextStyle(
fontFamily: 'Gilroy-SemiBold',
fontFamily: "Gilroy",
fontWeight: FontWeight.w600,
fontSize: 16,
height: 1.3,
+3 -1
View File
@@ -1,3 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
class LocalStore {
@@ -10,7 +11,8 @@ class LocalStore {
Future<void> saveLoginData(Map<String, dynamic> data) async {
final token = data['access_token'] ?? '';
final role = data['role'] ?? '';
debugPrint('token: $token');
debugPrint('role: $role');
// Keep existing FCM token (do not overwrite)
String? existingFcmToken = await _storage.read(key: 'fcm_token');
+10
View File
@@ -55,6 +55,16 @@ class NotificationWebSocket {
_subscribeToChatChannel(chatId);
}
/// Manually trigger a refresh for all providers watching `notificationTriggerProvider`.
void triggerRefresh() {
try {
_container?.read(notificationTriggerProvider.notifier).update((state) => state + 1);
debugPrint('🔔 NotificationWS: manual refresh triggered');
} catch (e) {
debugPrint('⚠️ NotificationWS: triggerRefresh failed: $e');
}
}
/// Connect (or skip if already connected for the same user).
Future<void> connect({
required String userId,