You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
180 lines
6.0 KiB
180 lines
6.0 KiB
import 'package:flutter/material.dart';
|
|
import 'dart:math';
|
|
|
|
final bisBoxDecorationStyle = BoxDecoration(
|
|
color: Color(0x336CA8F1),
|
|
borderRadius: BorderRadius.circular(10.0),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.black12,
|
|
blurRadius: 6.0,
|
|
offset: Offset(0, 2),
|
|
)
|
|
]);
|
|
final accentMain = Color(0xFFfedb65);
|
|
final darkAccent = Color(0xFFd29b32);
|
|
final tesoGold = Color(0xFFd8b468);
|
|
final tesoAsh = Color(0xFF908b8f);
|
|
final tesoBlue = Color(0xFF2d4dbc);
|
|
|
|
//local
|
|
// final serverLocation = "http://172.20.10.3:55555/";
|
|
|
|
//testOnline
|
|
final serverLocation = "https://mobile.tesoapp.com/";
|
|
final serverwebPrivacy = "https://tesoapp.com/privacy";
|
|
final serverwebHelp = "https://stream.tesoapp.com/frequentlyasked";
|
|
final serverwebTerms = "https://tesoapp.com/eula";
|
|
|
|
final tesoStreaming = "https://stream.tesoapp.com/";
|
|
final paymentServer = "https://securepayments.tesoapp.com/api/mobile/";
|
|
final tesoStreamMux = "https://stream.mux.com/";
|
|
|
|
String tesoPostThumb(post) {
|
|
return "https://image.mux.com/$post/thumbnail.png?time=3";
|
|
}
|
|
|
|
String tesoProductThumbnail({String productLogo, int width, int height}) {
|
|
if (width == null && height != null) {
|
|
return "https://mobile.tesoapp.com/products/$productLogo?height=$height";
|
|
} else if (width != null && height != null) {
|
|
return "https://mobile.tesoapp.com/products/$productLogo?width=$width&height=$height";
|
|
} else if (width != null && height == null) {
|
|
return "https://mobile.tesoapp.com/products/$productLogo?width=$width";
|
|
} else {
|
|
return "https://mobile.tesoapp.com/products/$productLogo";
|
|
}
|
|
}
|
|
|
|
final dynamiclinkprefix = "https://tesoapp.page.link/?link=";
|
|
final dynamiclinktrailing =
|
|
"&apn=com.sparentechBacware.teso&ibi=com.tesoapp&imv=1.0.1&isi=1573175173";
|
|
final arkeyAndroid =
|
|
"7e64228fef25c8ebd5c126411c7fec3506683a430b1668f22073123586c96c1feab0be9721c8cf3e";
|
|
final arkeyios =
|
|
"76a6d2a4be1a00714b76d453ab9b95460828b286d07fa89c18b8a6f49a0ccb0813aa3f23be12e73b";
|
|
final slimAccent = Color(0xFF2e7cce);
|
|
final mapsKey = "AIzaSyB3gbhILEzrSCFpxE509PnEb7slCkBfBQI";
|
|
//test mapsKey
|
|
// final mapsKey = "AIzaSyCHwkEaC_ddxHtTS2GBIX3lUVuiC9wTO-o";
|
|
final twitterKey = "0UMV5CXhhEqrw2QGHqiKzRkn2";
|
|
final twitterSecret = "204Mkhkz5m3swIGgTl74qi8aIiRbC6Nf0zVkB32of0EXpaYHWe";
|
|
// ignore: non_constant_identifier_names
|
|
final your_client_id = "1759156777594606";
|
|
// ignore: non_constant_identifier_names
|
|
final your_redirect_url = "https://www.facebook.com/connect/login_success.html";
|
|
final userdpURL = serverLocation + "tesoimages/GetProfilePicture/";
|
|
final productURL = serverLocation + "tesoimages/GetProducts/";
|
|
final businessLogoURL = serverLocation + "tesoimages/GetLogo/";
|
|
//final getVideo = serverLocation + "tesoimages/GetVideo/";
|
|
|
|
class Constants {
|
|
//App related strings
|
|
static String appName = "TESO";
|
|
//Colors for theme
|
|
static Color lightPrimary = Colors.white;
|
|
static Color darkPrimary = Color(0xFF303030);
|
|
static Color lightAccent = Color(0xFFfea404);
|
|
static Color darkAccent = Color(0xFFb90222);
|
|
static Color lightBG = Color(0xFFF5F5F5);
|
|
static Color darkBG = Color(0xFF212121);
|
|
static Color darkAccentBright = Colors.white;
|
|
static Color lightAccentBright = Colors.black;
|
|
|
|
static ThemeData lightTheme = ThemeData(
|
|
fontFamily: "TimesNewRoman",
|
|
backgroundColor: lightBG,
|
|
primaryColor: lightPrimary,
|
|
colorScheme: ColorScheme(
|
|
primary: Colors.black,
|
|
primaryVariant: const Color(0xff3700B3),
|
|
secondary: lightAccent,
|
|
secondaryVariant: const Color(0xff03dac6),
|
|
surface: const Color(0xff121212),
|
|
background: darkAccent,
|
|
error: const Color(0xffcf6679),
|
|
onPrimary: Colors.black,
|
|
onSecondary: Colors.black,
|
|
onSurface: Colors.white,
|
|
onBackground: Colors.white,
|
|
onError: Colors.black,
|
|
brightness: Brightness.light,
|
|
),
|
|
textSelectionTheme: TextSelectionThemeData(
|
|
cursorColor: lightAccent,
|
|
selectionColor: const Color(0xff90caf9),
|
|
selectionHandleColor: const Color(0xFF303030),
|
|
),
|
|
primaryColorDark: darkAccentBright,
|
|
primaryColorLight: lightAccentBright,
|
|
scaffoldBackgroundColor: lightBG,
|
|
appBarTheme: AppBarTheme(
|
|
backgroundColor: Colors.white,
|
|
elevation: 0,
|
|
foregroundColor: Colors.black,
|
|
titleTextStyle: TextStyle(
|
|
color: Colors.black,
|
|
fontFamily: "TimesNewRoman",
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w800,
|
|
),
|
|
),
|
|
);
|
|
|
|
static ThemeData darkTheme = ThemeData(
|
|
fontFamily: "TimesNewRoman",
|
|
brightness: Brightness.dark,
|
|
backgroundColor: darkBG,
|
|
primaryColor: darkPrimary,
|
|
colorScheme: ColorScheme(
|
|
primary: Colors.white,
|
|
primaryVariant: const Color(0xff3700B3),
|
|
secondary: darkAccent,
|
|
secondaryVariant: const Color(0xff03dac6),
|
|
surface: const Color(0xff121212),
|
|
background: darkAccent,
|
|
error: const Color(0xffcf6679),
|
|
onPrimary: Colors.black,
|
|
onSecondary: Colors.black,
|
|
onSurface: Colors.white,
|
|
onBackground: Colors.white,
|
|
onError: Colors.black,
|
|
brightness: Brightness.dark,
|
|
),
|
|
textSelectionTheme: TextSelectionThemeData(
|
|
cursorColor: darkAccent,
|
|
selectionColor: const Color(0xff64ffda),
|
|
selectionHandleColor: const Color(0xff1de9b6),
|
|
),
|
|
scaffoldBackgroundColor: darkBG,
|
|
primaryColorDark: lightAccentBright,
|
|
primaryColorLight: darkAccentBright,
|
|
appBarTheme: AppBarTheme(
|
|
elevation: 0,
|
|
titleTextStyle: TextStyle(
|
|
fontFamily: "TimesNewRoman",
|
|
color: lightBG,
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.w800,
|
|
),
|
|
),
|
|
);
|
|
|
|
static List<T> map<T>(List list, Function handler) {
|
|
List<T> result = [];
|
|
for (var i = 0; i < list.length; i++) {
|
|
result.add(handler(i, list[i]));
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
static formatBytes(bytes, decimals) {
|
|
if (bytes == 0) return 0.0;
|
|
var k = 1024,
|
|
dm = decimals <= 0 ? 0 : decimals,
|
|
sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
|
|
i = (log(bytes) / log(k)).floor();
|
|
return (((bytes / pow(k, i)).toStringAsFixed(dm)) + ' ' + sizes[i]);
|
|
}
|
|
}
|
|
|