added goal feature

This commit is contained in:
Mohamed Nouffer
2022-10-12 21:46:17 +05:30
parent 0470e1f27f
commit 8e30ee6ba7
29 changed files with 876 additions and 481 deletions

25
lib/utils/text_util.dart Normal file
View File

@ -0,0 +1,25 @@
import 'package:rogapp/model/destination.dart';
class TextUtils{
static String getDisplaytext(Destination dp){
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
String txt = "";
if(dp.cp! > 0){
txt = "${dp.cp.toString().replaceAll(regex, '')}";
if(dp.checkin_point != null && dp.checkin_point! > 0){
txt = txt + "{${dp.checkin_point.toString().replaceAll(regex, '')}}";
}
if(dp.buy_point != null && dp.buy_point! > 0){
txt = txt + "[${dp.buy_point.toString().replaceAll(regex, '')}]";
}
}
return txt;
}
static String getDisplayText(String num){
RegExp regex = RegExp(r'([.]*0)(?!.*\d)');
return "${num.replaceAll(regex, '')}";
}
}