Jira fixes

merge-requests/94/head
haroon amjad 3 years ago
parent cbd74c7a44
commit 6efc07fcab

@ -2,8 +2,8 @@ import 'package:mohem_flutter_app/ui/marathon/widgets/question_card.dart';
class ApiConsts { class ApiConsts {
//static String baseUrl = "http://10.200.204.20:2801/"; // Local server //static String baseUrl = "http://10.200.204.20:2801/"; // Local server
static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server // static String baseUrl = "https://uat.hmgwebservices.com"; // UAT server
// static String baseUrl = "https://hmgwebservices.com"; // Live server static String baseUrl = "https://hmgwebservices.com"; // Live server
static String baseUrlServices = baseUrl + "/Services/"; // server static String baseUrlServices = baseUrl + "/Services/"; // server
// static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server // static String baseUrlServices = "https://api.cssynapses.com/tangheem/"; // Live server
static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/"; static String utilitiesRest = baseUrlServices + "Utilities.svc/REST/";

@ -86,6 +86,11 @@ class Utils {
return prefs.getString(key) ?? ""; return prefs.getString(key) ?? "";
} }
static Future<bool> removeStringFromPrefs(String key) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
return prefs.remove(key);
}
static Future<bool> saveStringFromPrefs(String key, String value) async { static Future<bool> saveStringFromPrefs(String key, String value) async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
return await prefs.setString(key, value); return await prefs.setString(key, value);

@ -127,6 +127,7 @@ class _AddItemDetailsFragmentState extends State<AddItemDetailsFragment> {
isPopup: false, isPopup: false,
lines: 1, lines: 1,
isInputTypeNum: true, isInputTypeNum: true,
isInputTypeNumSigned: false,
isReadOnly: false, isReadOnly: false,
onChange: (String value) { onChange: (String value) {
itemPrice = num.parse(value); itemPrice = num.parse(value);

@ -1,6 +1,8 @@
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart'; import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/classes/consts.dart';
import 'package:mohem_flutter_app/classes/utils.dart';
import 'package:mohem_flutter_app/config/routes.dart'; import 'package:mohem_flutter_app/config/routes.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart'; import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart'; import 'package:mohem_flutter_app/extensions/string_extensions.dart';
@ -74,6 +76,7 @@ class _ItemsForSaleState extends State<ItemsForSale> {
child: const Icon(Icons.add, color: Colors.white, size: 30), child: const Icon(Icons.add, color: Colors.white, size: 30),
).onPress( ).onPress(
() { () {
Utils.removeStringFromPrefs(SharedPrefsConsts.editItemForSale);
Navigator.pushNamed(context, AppRoutes.addNewItemForSale); Navigator.pushNamed(context, AppRoutes.addNewItemForSale);
}, },
), ),

@ -4,6 +4,7 @@ import 'package:mohem_flutter_app/classes/colors.dart';
class DynamicTextFieldWidget extends StatelessWidget { class DynamicTextFieldWidget extends StatelessWidget {
final String labelText; final String labelText;
final String hintText; final String hintText;
// final TextEditingController controller; // final TextEditingController controller;
final VoidCallback? onTap; final VoidCallback? onTap;
final IconData? suffixIconData; final IconData? suffixIconData;
@ -13,6 +14,7 @@ class DynamicTextFieldWidget extends StatelessWidget {
final bool isPopup; final bool isPopup;
final int? lines; final int? lines;
final bool isInputTypeNum; final bool isInputTypeNum;
final bool isInputTypeNumSigned;
final bool isObscureText; final bool isObscureText;
final bool isBackgroundEnable; final bool isBackgroundEnable;
final void Function(String)? onChange; final void Function(String)? onChange;
@ -28,6 +30,7 @@ class DynamicTextFieldWidget extends StatelessWidget {
this.inputAction, this.inputAction,
this.onChange, this.onChange,
this.isInputTypeNum = false, this.isInputTypeNum = false,
this.isInputTypeNumSigned = true,
this.isBackgroundEnable = false}); this.isBackgroundEnable = false});
@override @override
@ -63,8 +66,13 @@ class DynamicTextFieldWidget extends StatelessWidget {
), ),
TextField( TextField(
enabled: isEnable, enabled: isEnable,
scrollPadding: EdgeInsets.zero, readOnly: isReadOnly, scrollPadding: EdgeInsets.zero,
keyboardType: isInputTypeNum ? const TextInputType.numberWithOptions(signed: true) : TextInputType.text, readOnly: isReadOnly,
keyboardType: (isInputTypeNum)
? isInputTypeNumSigned
? const TextInputType.numberWithOptions(signed: true)
: TextInputType.number
: TextInputType.text,
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
//controller: controller, //controller: controller,
maxLines: lines, maxLines: lines,

@ -37,9 +37,9 @@ class ItemDetailViewCol extends StatelessWidget {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
"$title:".toText12(isBold: true, color: const Color(0xff2BB8A6)), "$title:".toText12(isBold: true, color: const Color(0xff2BB8A6), maxLine: 2),
4.width, 4.width,
(value.isEmpty ? "--" : value).toText12(color: MyColors.normalTextColor), (value.isEmpty ? "--" : value).toText12(color: MyColors.normalTextColor, maxLine: 2),
], ],
); );
} }

Loading…
Cancel
Save