Structure 1.1

master
mirza.shafique 3 years ago
parent 0c8bed0314
commit bb0ac0bed4

@ -1,6 +1,5 @@
import 'package:hmg_flutter_template/widgets/dialogs/confirm_dialog.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
@ -38,9 +37,9 @@ class AppPermissions {
static void checkAll(Function(bool) completion) {
[Permission.location].request().then((value) {
bool allGranted = false;
value.values.forEach((element) {
for (var element in value.values) {
allGranted = allGranted && element == PermissionStatus.granted;
});
}
completion(allGranted);
});

@ -1,22 +1,22 @@
class ApiConsts {
static const MAX_SMALL_SCREEN = 660;
static const maxSmallScreen = 660;
static String baseUrl = "http://10.200.204.20:2801/"; // Local server
// static String baseUrl = 'https://hmgwebservices.com/';
// static String baseUrl = 'https://uat.hmgwebservices.com/';
static String baseUrlServices = baseUrl + "Services/"; // server
static String baseUrlServices = "${baseUrl}Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";
static String erpRest = baseUrlServices + "ERP.svc/REST/";
static String swpRest = baseUrlServices + "SWP.svc/REST/";
static String user = baseUrlServices + "api_repo/User/";
static String cocRest = baseUrlServices + "COCWS.svc/REST/";
static String utilitiesRest = "${baseUrlServices}Utilities.svc/REST/";
static String erpRest = "${baseUrlServices}ERP.svc/REST/";
static String swpRest = "${baseUrlServices}SWP.svc/REST/";
static String user = "${baseUrlServices}api_repo/User/";
static String cocRest = "${baseUrlServices}COCWS.svc/REST/";
//Chat
static String chatServerBaseUrl = "https://apiderichat.hmg.com";
static String chatServerBaseApiUrl = "https://apiderichat.hmg.com/api_repo/";
static String chatHubConnectionUrl = chatServerBaseUrl + "/ConnectionChatHub";
static String chatHubConnectionUrl = "$chatServerBaseUrl/ConnectionChatHub";
static String chatSearchMember = "user/getUserWithStatusAndFavAsync/";
static String chatRecentUrl = "UserChatHistory/getchathistorybyuserid"; //For a Mem
static String chatSingleUserHistoryUrl = "UserChatHistory/GetUserChatHistory";

@ -1,7 +1,6 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:hmg_flutter_template/generated/locale_keys.g.dart';
import 'package:intl/intl.dart';
class AppDateUtils {
static String convertDateToFormat(DateTime dateTime, String dateFormat) {
@ -18,10 +17,11 @@ class AppDateUtils {
static String convertStringToDateFormat(String date, String dateFormat) {
DateTime dateTime;
if (date.contains("/Date"))
if (date.contains("/Date")) {
dateTime = getDateTimeFromServerFormat(date);
else
} else {
dateTime = DateTime.parse(date);
}
return convertDateToFormat(dateTime, dateFormat);
}
@ -50,7 +50,7 @@ class AppDateUtils {
final endIndex = str.indexOf(end, startIndex + start.length);
date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex)));
date = DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex)));
} else {
date = DateTime.now();
}
@ -95,10 +95,7 @@ class AppDateUtils {
double hoursInOneDay = difference.inHours / difference.inDays;
return (isShowDays ? (days > 0 ? "$days ${LocaleKeys.days.tr()}," : '') : "") +
(hours > 0 ? "$hours ${LocaleKeys.hr.tr()}," : "") +
" $minutes ${LocaleKeys.min.tr()}" +
(isShowSecond ? ", $second Sec" : "");
return "${isShowDays ? (days > 0 ? "$days ${LocaleKeys.days.tr()}," : '') : ""}${hours > 0 ? "$hours ${LocaleKeys.hr.tr()}," : ""} $minutes ${LocaleKeys.min.tr()}${isShowSecond ? ", $second Sec" : ""}";
}
static String differenceBetweenServerDateAndCurrent(String str, BuildContext context) {
@ -110,7 +107,7 @@ class AppDateUtils {
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex)));
var date = DateTime.fromMillisecondsSinceEpoch(int.parse(str.substring(startIndex + start.length, endIndex)));
return differenceBetweenDateAndCurrent(date, context);
}

@ -25,7 +25,7 @@ class SizeConfig {
void init(BoxConstraints constraints, Orientation orientation) {
realScreenHeight = constraints.maxHeight;
realScreenWidth = constraints.maxWidth;
if (constraints.maxWidth <= ApiConsts.MAX_SMALL_SCREEN) {
if (constraints.maxWidth <= ApiConsts.maxSmallScreen) {
isMobile = true;
}
if (constraints.maxHeight < 600) {

@ -75,12 +75,8 @@ class Utils {
).then((value) {
_isLoadingVisible = false;
}).catchError((e) {
print("--------------catchError---------------");
print(e);
}).onError(
(error, stackTrace) {
print("--------------onError---------------");
print(error);
},
);
}
@ -93,7 +89,6 @@ class Utils {
}
_isLoadingVisible = false;
} catch (e) {
print("exp_while_hide_dialog: " + e.toString());
}
}

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:hmg_flutter_template/classes/colors.dart';
import 'package:hmg_flutter_template/theme/colors.dart';
@ -26,7 +27,6 @@ class AppTheme {
splashColor: Colors.transparent,
primaryColor: primaryColor,
primaryColorDark: primaryColor,
buttonColor: Colors.black,
toggleableActiveColor: secondaryColor,
indicatorColor: secondaryColor,
bottomSheetTheme: const BottomSheetThemeData(
@ -44,11 +44,10 @@ class AppTheme {
floatingActionButtonTheme: const FloatingActionButtonThemeData(highlightElevation: 2, disabledElevation: 0, elevation: 2),
appBarTheme: AppBarTheme(
color: const Color(0xff515A5D),
brightness: Brightness.light,
elevation: 0.0,
actionsIconTheme: IconThemeData(
color: Colors.grey[800],
),
), systemOverlayStyle: SystemUiOverlayStyle.dark,
),
);
}

@ -75,7 +75,7 @@ class BottomSheetItem extends StatelessWidget {
),
if (icon != null) SizedBox(width: 24.0),
Text(
title ?? "",
title,
style: TextStyle(color: color),
),
],

Loading…
Cancel
Save