|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-detail.dart';
|
|
|
|
|
// import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
@ -13,6 +14,7 @@ import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import 'base/base_view.dart';
|
|
|
|
|
|
|
|
|
|
@ -28,6 +30,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
ProjectViewModel projectProvider = Provider.of(context);
|
|
|
|
|
return BaseView<PharmacyCategoriseViewModel>(
|
|
|
|
|
onModelReady: (model) => model.clearSearchList(),
|
|
|
|
|
builder: (BuildContext context, PharmacyCategoriseViewModel model,
|
|
|
|
|
@ -67,7 +70,7 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
|
|
|
|
|
if (value.isEmpty) {
|
|
|
|
|
TranslationBase.of(context)
|
|
|
|
|
.pleaseEnterProductName;
|
|
|
|
|
} else if (regExp.hasMatch(value)) {
|
|
|
|
|
} else if (!regExp.hasMatch(value)) {
|
|
|
|
|
AppToast.showErrorToast(
|
|
|
|
|
message: TranslationBase.of(context)
|
|
|
|
|
.noArabicLetters);
|
|
|
|
|
@ -220,19 +223,29 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
|
|
|
|
|
Radius.circular(
|
|
|
|
|
6)),
|
|
|
|
|
),
|
|
|
|
|
child: Texts(
|
|
|
|
|
model.searchList[index]
|
|
|
|
|
.rxMessage !=
|
|
|
|
|
null
|
|
|
|
|
? model
|
|
|
|
|
.searchList[index]
|
|
|
|
|
.rxMessage
|
|
|
|
|
: "",
|
|
|
|
|
child: model.searchList[index].rxMessage != null
|
|
|
|
|
? Texts(
|
|
|
|
|
projectProvider.isArabic
|
|
|
|
|
? model.searchList[index].rxMessagen
|
|
|
|
|
: model.searchList[index].rxMessage,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
regular: true,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
),
|
|
|
|
|
): Texts(""),
|
|
|
|
|
// Texts(
|
|
|
|
|
// model.searchList[index]
|
|
|
|
|
// .rxMessage !=
|
|
|
|
|
// null
|
|
|
|
|
// ? model
|
|
|
|
|
// .searchList[index]
|
|
|
|
|
// .rxMessage
|
|
|
|
|
// : "",
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// regular: true,
|
|
|
|
|
// fontSize: 10,
|
|
|
|
|
// fontWeight: FontWeight.w400,
|
|
|
|
|
// ),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
@ -245,9 +258,11 @@ class _SearchProductsPageState extends State<SearchProductsPage> {
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Texts(
|
|
|
|
|
model
|
|
|
|
|
.searchList[index].name,
|
|
|
|
|
Texts(projectProvider.isArabic
|
|
|
|
|
? model.searchList[index].namen
|
|
|
|
|
:model.searchList[index].name,
|
|
|
|
|
|
|
|
|
|
// model.searchList[index].name,
|
|
|
|
|
regular: true,
|
|
|
|
|
fontSize: 12,
|
|
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
|