fix : some ui bug
This commit is contained in:
@@ -128,12 +128,15 @@ class AppColor {
|
||||
static const Color yellowLightHover = Color(0xFFfff6da); // #fff6da rgb(255, 246, 218)
|
||||
static const Color yellowLightActive = Color(0xFFffecb2); // #ffecb2 rgb(255, 236, 178)
|
||||
static const Color yellowNormal = Color(0xFFffc107); // #ffc107 rgb(255, 193, 7)
|
||||
static const Color yellowNormal2 = Color(0xFFFF9800); // #FF9800 rgb(255, 152, 0)
|
||||
static const Color yellowNormalHover = Color(0xFFe6ae06); // #e6ae06 rgb(230, 174, 6)
|
||||
static const Color yellowNormalActive = Color(0xFFcc9a06); // #cc9a06 rgb(204, 154, 6)
|
||||
static const Color yellowDark = Color(0xFFbf9105); // #bf9105 rgb(191, 145, 5)
|
||||
static const Color yellowDarkHover = Color(0xFF997404); // #997404 rgb(153, 116, 4)
|
||||
static const Color yellowDarkActive = Color(0xFF735703); // #735703 rgb(115, 87, 3)
|
||||
static const Color yellowDarker = Color(0xFF594402); // #594402 rgb(89, 68, 2)
|
||||
|
||||
// #594402 rgb(89, 68, 2)
|
||||
//endregion
|
||||
|
||||
//region --- red Colors ---
|
||||
|
||||
@@ -85,6 +85,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
if (hasNotification) SizedBox(width: 8.w),
|
||||
|
||||
if (!isBase) ...{
|
||||
SizedBox(width: 8.w),
|
||||
if (hasFilter)
|
||||
GestureDetector(
|
||||
onTap: onFilterTap,
|
||||
@@ -95,7 +96,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
),
|
||||
),
|
||||
if (hasBack) SizedBox(width: 8.w),
|
||||
|
||||
if (hasSearch) SizedBox(width: 8.w),
|
||||
if (hasSearch) GestureDetector(
|
||||
onTap: onSearchTap,
|
||||
child: Assets.vec.searchSvg.svg(
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:persian_datetime_picker/persian_datetime_picker.dart';
|
||||
|
||||
extension XString on String {
|
||||
extension XString on String? {
|
||||
String get separatedByComma {
|
||||
final formatter = NumberFormat('#,###');
|
||||
final number = num.tryParse(this);
|
||||
return number != null ? formatter.format(number) : this;
|
||||
final number = num.tryParse(this ?? '');
|
||||
return number != null ? formatter.format(number) : (this ?? '');
|
||||
}
|
||||
|
||||
String get clearComma {
|
||||
return replaceAll(RegExp(r'\D'), '');
|
||||
return (this ?? '').replaceAll(RegExp(r'\D'), '');
|
||||
}
|
||||
|
||||
String get addCountEXT {
|
||||
@@ -20,21 +20,29 @@ extension XString on String {
|
||||
return '$thisروزه';
|
||||
}
|
||||
|
||||
String get addKgEXT {
|
||||
return '$this کیلوگرم';
|
||||
String get addKgFa {
|
||||
return '${this ?? 0}کیلوگرم ';
|
||||
}
|
||||
|
||||
DateTime get toDateTime => DateTime.parse(this);
|
||||
String get addKgFaWithParentheses {
|
||||
return '${this ?? 0} (کیلوگرم)';
|
||||
}
|
||||
|
||||
String get addKg {
|
||||
return '$this KG';
|
||||
}
|
||||
|
||||
DateTime get toDateTime => DateTime.parse(this ?? '');
|
||||
|
||||
String get formattedJalaliDate {
|
||||
String tmp = contains("/") ? replaceAll("/", "-") : this;
|
||||
String tmp = (this != null && this!.contains("/")) ? this!.replaceAll("/", "-") : (this ?? "");
|
||||
final dateTime = DateTime.parse(tmp);
|
||||
final jalaliDate = Jalali.fromDateTime(dateTime);
|
||||
return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}";
|
||||
}
|
||||
|
||||
String get formattedJalaliDateYHMS {
|
||||
final dateTime = DateTime.parse(this);
|
||||
final dateTime = DateTime.parse(this ?? '');
|
||||
final jalaliDate = Jalali.fromDateTime(dateTime);
|
||||
return "${jalaliDate.hour.toString().padLeft(2, '0')}:${jalaliDate.minute.toString().padLeft(2, '0')} - ${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}";
|
||||
}
|
||||
@@ -44,9 +52,9 @@ extension XString on String {
|
||||
}
|
||||
|
||||
Jalali get toJalali {
|
||||
final dateTime = DateTime.parse(this);
|
||||
final dateTime = DateTime.parse(this ?? '');
|
||||
return Jalali.fromDateTime(dateTime);
|
||||
}
|
||||
|
||||
int get versionNumber => int.parse(replaceAll(".", ''));
|
||||
int get versionNumber => int.parse(this?.replaceAll(".", '') ?? '0');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user