first commit

This commit is contained in:
Anbarasu
2026-05-26 18:01:57 +05:30
commit 6d59c8daf6
297 changed files with 35238 additions and 0 deletions

25
lib/helper/distance.dart Normal file
View File

@@ -0,0 +1,25 @@
import 'dart:math';
/// Calculate distance between two coordinates in km
double calculateDistance(double lat1, double lon1, double lat2, double lon2) {
const double earthRadius = 6371; // km
final dLat = _degreesToRadians(lat2 - lat1);
final dLon = _degreesToRadians(lon2 - lon1);
final a = sin(dLat / 2) * sin(dLat / 2) +
cos(_degreesToRadians(lat1)) *
cos(_degreesToRadians(lat2)) *
sin(dLon / 2) *
sin(dLon / 2);
final c = 2 * atan2(sqrt(a), sqrt(1 - a));
final distance = earthRadius * c;
return distance;
}
double _degreesToRadians(double degrees) {
return degrees * pi / 180;
}

View File

@@ -0,0 +1,22 @@
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/foundation.dart';
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (defaultTargetPlatform == TargetPlatform.iOS ||
defaultTargetPlatform == TargetPlatform.macOS) {
return const FirebaseOptions(
apiKey: 'AIzaSyBkzz2Yua74Q9YpzGmUPFP94fmJQqNMIiU',
appId: '1:140444764229:ios:d66c3707aaf5c1ed283b2c',
messagingSenderId: '140444764229',
projectId: 'nearle-gear',
storageBucket: 'nearle-gear.appspot.com',
iosBundleId: 'com.nearle.gear',
);
}
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}

11
lib/helper/logger.dart Normal file
View File

@@ -0,0 +1,11 @@
import 'package:logger/logger.dart';
var logger = Logger(
printer: PrettyPrinter(
methodCount: 2, // Number of method calls to be displayed
errorMethodCount: 8, // Number of method calls if stacktrace is provided
lineLength: 300, // Width of the output
colors: true, // Colorful log messages
printEmojis: true, // Print an emoji for each log message
),
);

View File

16
lib/helper/toaster.dart Normal file
View File

@@ -0,0 +1,16 @@
import 'package:fluttertoast/fluttertoast.dart';
import '../constants/color_constants.dart';
class Toast{
static void showToast(String message){
Fluttertoast.showToast(
msg: message,
textColor: ColorConstants.secondaryColor,
timeInSecForIosWeb: 1,
webShowClose: true,
backgroundColor: ColorConstants.grey,
gravity: ToastGravity.TOP_RIGHT,
fontSize: 15.0,
);
}
}