initial commit: push everything
This commit is contained in:
36
lib/views/helpers/constants/Colorconstants.dart
Normal file
36
lib/views/helpers/constants/Colorconstants.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ColorConstants {
|
||||
static const primaryColor = Color(0xFF662582);
|
||||
static Color? primaryColor1 = const Color(0xFFE7D3EF);
|
||||
static Color? secondaryColor = Colors.white;
|
||||
static Color? ternaryColor = "#E7D3EF".toColor();
|
||||
static Color? darkGreyColor = "575756".toColor();
|
||||
static Color? lightGrey = "b2b2b2".toColor();
|
||||
static Color? lightGreyBg = Colors.grey.shade100;
|
||||
static Color? greenColor = "00b894".toColor();
|
||||
static Color? mintColor = "69c0ac".toColor();
|
||||
static Color restaurantColor = Colors.amber[100]!;
|
||||
static Color groceriesColor = Colors.purple[100]!;
|
||||
static Color shoppingColor = Colors.orange[100]!;
|
||||
static Color healthColor = Colors.cyan[100]!;
|
||||
static Color handymanColor = Colors.red[100]!;
|
||||
static const blueColor = 0xff007AC2;
|
||||
static const redColor = 0xffEF3F42;
|
||||
static const orangeColor = 0xffFAAB53;
|
||||
static Color? lightColor = const Color.fromRGBO(244, 244, 244, 1);
|
||||
}
|
||||
|
||||
extension ColorExtenstion on String {
|
||||
// ignore: body_might_complete_normally_nullable
|
||||
Color? toColor() {
|
||||
var hexColor = replaceAll("#", "");
|
||||
if (hexColor.length == 6) {
|
||||
hexColor = "FF$hexColor";
|
||||
}
|
||||
if (hexColor.length == 8) {
|
||||
return Color(int.parse("0x$hexColor"));
|
||||
}
|
||||
}
|
||||
}
|
||||
111
lib/views/helpers/constants/Font_constant.dart
Normal file
111
lib/views/helpers/constants/Font_constant.dart
Normal file
@@ -0,0 +1,111 @@
|
||||
// ignore: file_names
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class FontConstants {
|
||||
static String fontFamily = 'Proxima Nova';
|
||||
|
||||
// Base screen width for scaling (iPhone standard: 375)
|
||||
static const double _baseWidth = 375.0;
|
||||
|
||||
// Base font sizes (for baseWidth = 375)
|
||||
static const double _baseExtraSmall = 10.0;
|
||||
static const double _baseSmall = 12.0;
|
||||
static const double _baseMedium = 14.0;
|
||||
static const double _baseRegular = 16.0;
|
||||
static const double _baseLarge = 20.0;
|
||||
static const double _baseXLarge = 21.0;
|
||||
static const double _baseXXLarge = 22.0;
|
||||
static const double _baseXXXLarge = 24.0;
|
||||
static const double _baseHuge = 30.0;
|
||||
|
||||
/// Get fixed font size (no width scaling) so small & large phones look same.
|
||||
static double getResponsiveFontSize(BuildContext context, double baseSize) {
|
||||
return baseSize;
|
||||
}
|
||||
|
||||
/// Extra Small Text (10px base) - For labels, captions
|
||||
static double extraSmall(BuildContext context) =>
|
||||
getResponsiveFontSize(context, _baseExtraSmall);
|
||||
|
||||
/// Small Text (12px base) - For small labels, timestamps
|
||||
static double small(BuildContext context) =>
|
||||
getResponsiveFontSize(context, _baseSmall);
|
||||
|
||||
/// Medium Text (14px base) - For body text, descriptions
|
||||
static double medium(BuildContext context) =>
|
||||
getResponsiveFontSize(context, _baseMedium);
|
||||
|
||||
/// Regular Text (16px base) - Standard body text, most common
|
||||
static double regular(BuildContext context) =>
|
||||
getResponsiveFontSize(context, _baseRegular);
|
||||
|
||||
/// Large Text (18px base) - For subheadings, important text
|
||||
static double large(BuildContext context) =>
|
||||
getResponsiveFontSize(context, _baseLarge);
|
||||
|
||||
/// Extra Large Text (20px base) - For headings, titles
|
||||
static double xLarge(BuildContext context) =>
|
||||
getResponsiveFontSize(context, _baseXLarge);
|
||||
|
||||
/// 2X Large Text (22px base) - For main headings
|
||||
static double xxLarge(BuildContext context) =>
|
||||
getResponsiveFontSize(context, _baseXXLarge);
|
||||
|
||||
/// 3X Large Text (24px base) - For prominent headings
|
||||
static double xxxLarge(BuildContext context) =>
|
||||
getResponsiveFontSize(context, _baseXXXLarge);
|
||||
|
||||
/// Huge Text (26px base) - For hero text, very prominent headings
|
||||
static double huge(BuildContext context) =>
|
||||
getResponsiveFontSize(context, _baseHuge);
|
||||
}
|
||||
|
||||
class ReusableTextWidget extends StatelessWidget {
|
||||
final String text;
|
||||
final double? fontSize;
|
||||
final double? textHeight;
|
||||
final String? fontFamily;
|
||||
final FontWeight? fontWeight;
|
||||
final FontStyle? fontStyle;
|
||||
final Color? color;
|
||||
final TextAlign? textAlign;
|
||||
final int? maxLines;
|
||||
final TextDecoration? isUnderText;
|
||||
|
||||
const ReusableTextWidget({
|
||||
super.key,
|
||||
required this.text,
|
||||
this.fontSize,
|
||||
this.textHeight,
|
||||
this.fontFamily,
|
||||
this.fontWeight,
|
||||
this.fontStyle,
|
||||
this.color,
|
||||
this.textAlign,
|
||||
this.maxLines,
|
||||
this.isUnderText,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Text(
|
||||
text,
|
||||
softWrap: true,
|
||||
style: TextStyle(
|
||||
fontSize: fontSize ?? FontConstants.medium(context),
|
||||
decoration: isUnderText,
|
||||
fontFamily: fontFamily ?? FontConstants.fontFamily,
|
||||
decorationColor: color,
|
||||
fontWeight: fontWeight ?? FontWeight.normal,
|
||||
fontStyle: fontStyle ?? FontStyle.normal,
|
||||
color: color ?? Colors.grey.shade900,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
decorationStyle: TextDecorationStyle.solid,
|
||||
decorationThickness: 1,
|
||||
height: textHeight,
|
||||
),
|
||||
maxLines: maxLines,
|
||||
textAlign: textAlign ?? TextAlign.start,
|
||||
);
|
||||
}
|
||||
}
|
||||
78
lib/views/helpers/constants/apiconstants.dart
Normal file
78
lib/views/helpers/constants/apiconstants.dart
Normal file
@@ -0,0 +1,78 @@
|
||||
class ApiConstants {
|
||||
static String mainDev = "dev";
|
||||
static String mainRoute = "live";
|
||||
|
||||
//Delivery Queue - v2
|
||||
static String deliveryQueueDev =
|
||||
"https://jupiter.nearle.app/$mainDev/api/v2/deliveries/getdeliveryqueues";
|
||||
static String deliveryQueueLive =
|
||||
"https://jupiter.nearle.app/$mainRoute/api/v2/deliveries/getdeliveryqueues";
|
||||
|
||||
//Current Delivery - v1
|
||||
static String currentDeliveryDev =
|
||||
"https://jupiter.nearle.app/$mainDev/api/v1/deliveries/getdeliveries";
|
||||
static String currentDeliveryLive =
|
||||
"https://jupiter.nearle.app/$mainRoute/api/v1/deliveries/getdeliveries";
|
||||
|
||||
//Current Delivery V3 - v3 (date-bounded)
|
||||
static String currentDeliveryV3Dev =
|
||||
"https://jupiter.nearle.app/$mainDev/api/v3/deliveries/getdeliveries";
|
||||
static String currentDeliveryV3Live =
|
||||
"https://jupiter.nearle.app/$mainRoute/api/v3/deliveries/getdeliveries";
|
||||
|
||||
//Update Delivery - v1
|
||||
static String updateDeliveryDev =
|
||||
"https://queue.workolik.com/live/api/v1/deliveries/updatedelivery";
|
||||
static String updateDeliveryLive =
|
||||
"https://queue.workolik.com/live/api/v1/deliveries/updatedelivery";
|
||||
|
||||
//Get Rider Log - v1
|
||||
static String getRiderLogDev =
|
||||
"https://jupiter.nearle.app/$mainDev/api/v1/partners/getriderlog";
|
||||
static String getRiderLogLive =
|
||||
"https://jupiter.nearle.app/$mainRoute/api/v1/partners/getriderlog";
|
||||
|
||||
//Create Rider Log - v2
|
||||
static String createRiderLogDev =
|
||||
"https://queue.workolik.com/live/api/v2/partners/createriderlog";
|
||||
static String createRiderLogLive =
|
||||
"https://queue.workolik.com/live/api/v2/partners/createriderlog";
|
||||
|
||||
//Update Rider Log - v1
|
||||
static String updateRiderLogDev =
|
||||
"https://jupiter.nearle.app/$mainDev/api/v1/partners/updateriderlog";
|
||||
static String updateRiderLogLive =
|
||||
"https://jupiter.nearle.app/$mainRoute/api/v1/partners/updateriderlog";
|
||||
|
||||
//Get Rider Count - v1
|
||||
static String getRiderCountDev =
|
||||
"https://jupiter.nearle.app/$mainDev/api/v1/partners/getridercount";
|
||||
static String getRiderCountLive =
|
||||
"https://jupiter.nearle.app/$mainRoute/api/v1/partners/getridercount";
|
||||
|
||||
//Create Break Rider Log - v2
|
||||
static String createBreakRiderLogDev =
|
||||
"https://queue.workolik.com/live/api/v2/partners/createbreaklog";
|
||||
static String createBreakRiderLogLive =
|
||||
"https://queue.workolik.com/live/api/v2/partners/createbreaklog";
|
||||
|
||||
//Update Break Rider Log - v2
|
||||
static String updateBreakRiderLogDev =
|
||||
"https://queue.workolik.com/live/api/v2/partners/updatebreaklog";
|
||||
static String updateBreakRiderLogLive =
|
||||
"https://queue.workolik.com/live/api/v2/partners/updatebreaklog";
|
||||
|
||||
//Create Delivery Log - v2
|
||||
static String createDeliveryLogDev =
|
||||
"https://queue.workolik.com/live/api/v2/deliveries/createdeliverylog";
|
||||
static String createDeliveryLogLive =
|
||||
"https://queue.workolik.com/live/api/v2/deliveries/createdeliverylog";
|
||||
|
||||
//Summary API - v2
|
||||
static String summaryApiLive =
|
||||
'https://jupiter.nearle.app/$mainRoute/api/v2/partners';
|
||||
|
||||
//Summary Rider Weekly KMs - v1
|
||||
static String summaryriderkmLive =
|
||||
'https://jupiter.nearle.app/$mainRoute/api/v1/partners/getriderweeklykms';
|
||||
}
|
||||
18
lib/views/helpers/constants/mqtt_constants.dart
Normal file
18
lib/views/helpers/constants/mqtt_constants.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
class MqttConstants {
|
||||
static const String brokerHost = '66.116.225.226'; // Updated with VPS IP
|
||||
static const int brokerPort = 1883;
|
||||
static const String username = 'admin';
|
||||
static const String passwordString = 'Package@321#'; // Provided by user
|
||||
|
||||
// Topic Structure
|
||||
static const String topicRiderStatus = 'nearle/riders/{riderId}/status';
|
||||
static const String topicRiderProfile = 'nearle/riders/{riderId}/profile';
|
||||
static const String topicRiderLocation = 'nearle/riders/{riderId}/location';
|
||||
static const String topicRiderTelemetry = 'nearle/riders/{riderId}/telemetry';
|
||||
static const String topicRiderLogs = 'nearle/riders/{riderId}/logs';
|
||||
|
||||
// Status Values
|
||||
static const String statusOnline = 'Online';
|
||||
static const String statusOffline = 'Offline';
|
||||
static const String statusIdle = 'Idle';
|
||||
}
|
||||
Reference in New Issue
Block a user