|
|
|
|
@ -48,7 +48,7 @@ class Helpers {
|
|
|
|
|
actions: [
|
|
|
|
|
AppButton(
|
|
|
|
|
onPressed: okFunction(),
|
|
|
|
|
title: TranslationBase.of(context).noteConfirm,
|
|
|
|
|
title: TranslationBase.of(context).noteConfirm??"",
|
|
|
|
|
fontColor: Colors.white,
|
|
|
|
|
color: AppGlobal.appGreenColor,
|
|
|
|
|
),
|
|
|
|
|
@ -56,9 +56,9 @@ class Helpers {
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
},
|
|
|
|
|
title: TranslationBase.of(context).cancel,
|
|
|
|
|
title: TranslationBase.of(context).cancel??"",
|
|
|
|
|
fontColor: Colors.white,
|
|
|
|
|
color: Colors.red[600],
|
|
|
|
|
color: Colors.red[600]!,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -87,15 +87,14 @@ class Helpers {
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.end,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
CupertinoButton(
|
|
|
|
|
child: Text(TranslationBase.of(context).cancel,
|
|
|
|
|
style: textStyle(context)),
|
|
|
|
|
child: Text(TranslationBase.of(context).cancel ?? "", style: textStyle(context)),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
CupertinoButton(
|
|
|
|
|
child: Text(
|
|
|
|
|
TranslationBase.of(context).done,
|
|
|
|
|
TranslationBase.of(context).done ?? "",
|
|
|
|
|
style: textStyle(context),
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
@ -328,140 +327,4 @@ class Helpers {
|
|
|
|
|
? 8
|
|
|
|
|
: 6);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getLabelFromKPI(String kpi) {
|
|
|
|
|
if (kpi.indexOf("(") > -1 && kpi.indexOf(")") > -1)
|
|
|
|
|
return kpi.substring(kpi.indexOf("(") + 1, kpi.indexOf(")"));
|
|
|
|
|
else
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getNameFromKPI(String kpi) {
|
|
|
|
|
if (kpi.indexOf("(") > -1)
|
|
|
|
|
return kpi.substring(0, kpi.indexOf("("));
|
|
|
|
|
else
|
|
|
|
|
return kpi;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getBoxTabsBoxDecoration(
|
|
|
|
|
{bool isFirst = false,
|
|
|
|
|
bool isMiddle = false,
|
|
|
|
|
bool isLast = false,
|
|
|
|
|
bool isActive = false,
|
|
|
|
|
double radius = 6.0, ProjectViewModel projectViewModel}) {
|
|
|
|
|
return BoxDecoration(
|
|
|
|
|
color: isActive ? AppGlobal.appRedColor : Color(0xFFEAEAEA),
|
|
|
|
|
shape: BoxShape.rectangle,
|
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
topRight: projectViewModel.isArabic?Radius.circular(isActive
|
|
|
|
|
? isLast || isMiddle
|
|
|
|
|
? radius
|
|
|
|
|
: 0
|
|
|
|
|
: 0):Radius.circular(isActive
|
|
|
|
|
? isFirst || isMiddle
|
|
|
|
|
? radius
|
|
|
|
|
: 0
|
|
|
|
|
: 0),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
topLeft: projectViewModel.isArabic? Radius.circular(isActive
|
|
|
|
|
? isFirst || isMiddle
|
|
|
|
|
? radius
|
|
|
|
|
: 0
|
|
|
|
|
: 0):Radius.circular(isActive
|
|
|
|
|
? isLast || isMiddle
|
|
|
|
|
? radius
|
|
|
|
|
: 0
|
|
|
|
|
: 0),
|
|
|
|
|
bottomRight: projectViewModel.isArabic? Radius.circular(isActive
|
|
|
|
|
? isLast || isMiddle
|
|
|
|
|
? radius
|
|
|
|
|
: 0
|
|
|
|
|
: 0): Radius.circular(isActive
|
|
|
|
|
? isFirst || isMiddle
|
|
|
|
|
? radius
|
|
|
|
|
: 0
|
|
|
|
|
: 0),
|
|
|
|
|
bottomLeft:projectViewModel.isArabic? Radius.circular(isActive
|
|
|
|
|
? isFirst || isMiddle
|
|
|
|
|
? radius
|
|
|
|
|
: 0
|
|
|
|
|
: 0): Radius.circular(isActive
|
|
|
|
|
? isLast || isMiddle
|
|
|
|
|
? radius
|
|
|
|
|
: 0
|
|
|
|
|
: 0)),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getBgTabColor() {
|
|
|
|
|
return Color(0xFFEAEAEA);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getTabText({
|
|
|
|
|
String title,
|
|
|
|
|
bool isActive = false,
|
|
|
|
|
}) {
|
|
|
|
|
return AppText(
|
|
|
|
|
title,
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.8,
|
|
|
|
|
color: isActive ? Colors.white : AppGlobal.appTextColor,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getTabHeight(BuildContext context) {
|
|
|
|
|
final screenSize = MediaQuery.of(context).size;
|
|
|
|
|
return screenSize.height * 0.07;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static getTabCounter({bool isActive: false, int counter}) {
|
|
|
|
|
return Container(
|
|
|
|
|
margin: EdgeInsets.all(4),
|
|
|
|
|
width: 15,
|
|
|
|
|
height: 15,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: isActive ? Colors.white : AppGlobal.appRedColor,
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
),
|
|
|
|
|
child: Center(
|
|
|
|
|
child: FittedBox(
|
|
|
|
|
child: AppText(
|
|
|
|
|
"$counter",
|
|
|
|
|
fontSize: SizeConfig.textMultiplier * 1.5,
|
|
|
|
|
color: !isActive ? Colors.white : AppGlobal.appRedColor,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static String convertToTitleCase(String text) {
|
|
|
|
|
if (text == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (text.length <= 1) {
|
|
|
|
|
return text.toUpperCase();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Split string into multiple words
|
|
|
|
|
final List<String> words = text.split(' ');
|
|
|
|
|
|
|
|
|
|
// Capitalize first letter of each words
|
|
|
|
|
final capitalizedWords = words.map((word) {
|
|
|
|
|
if (word.trim().isNotEmpty) {
|
|
|
|
|
final String firstLetter = word.trim().substring(0, 1).toUpperCase();
|
|
|
|
|
final String remainingLetters = word.trim().substring(1).toLowerCase();
|
|
|
|
|
|
|
|
|
|
return '$firstLetter$remainingLetters';
|
|
|
|
|
}
|
|
|
|
|
return '';
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Join/Merge all words back to one String
|
|
|
|
|
return capitalizedWords.join(' ');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|