diff --git a/assets/images/new/add_to_cart.svg b/assets/images/new/add_to_cart.svg new file mode 100644 index 00000000..f01f6033 --- /dev/null +++ b/assets/images/new/add_to_cart.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/images/new/body_parts/female/abdomin.png b/assets/images/new/body_parts/female/abdomin.png new file mode 100644 index 00000000..f4918d71 Binary files /dev/null and b/assets/images/new/body_parts/female/abdomin.png differ diff --git a/assets/images/new/body_parts/female/abdomin.svg b/assets/images/new/body_parts/female/abdomin.svg deleted file mode 100644 index cc1dd1d0..00000000 --- a/assets/images/new/body_parts/female/abdomin.svg +++ /dev/null @@ -1,345 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/anal.png b/assets/images/new/body_parts/female/anal.png new file mode 100644 index 00000000..d96ef288 Binary files /dev/null and b/assets/images/new/body_parts/female/anal.png differ diff --git a/assets/images/new/body_parts/female/anal.svg b/assets/images/new/body_parts/female/anal.svg deleted file mode 100644 index 96c9734d..00000000 --- a/assets/images/new/body_parts/female/anal.svg +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/axilla.png b/assets/images/new/body_parts/female/axilla.png new file mode 100644 index 00000000..f38be6b3 Binary files /dev/null and b/assets/images/new/body_parts/female/axilla.png differ diff --git a/assets/images/new/body_parts/female/axilla.svg b/assets/images/new/body_parts/female/axilla.svg deleted file mode 100644 index 257b1c08..00000000 --- a/assets/images/new/body_parts/female/axilla.svg +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/back.png b/assets/images/new/body_parts/female/back.png new file mode 100644 index 00000000..65d9ef19 Binary files /dev/null and b/assets/images/new/body_parts/female/back.png differ diff --git a/assets/images/new/body_parts/female/back.svg b/assets/images/new/body_parts/female/back.svg deleted file mode 100644 index 96eba049..00000000 --- a/assets/images/new/body_parts/female/back.svg +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/bikini.png b/assets/images/new/body_parts/female/bikini.png new file mode 100644 index 00000000..a1a68423 Binary files /dev/null and b/assets/images/new/body_parts/female/bikini.png differ diff --git a/assets/images/new/body_parts/female/bikini.svg b/assets/images/new/body_parts/female/bikini.svg deleted file mode 100644 index 24892c80..00000000 --- a/assets/images/new/body_parts/female/bikini.svg +++ /dev/null @@ -1,345 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/bikini_line.png b/assets/images/new/body_parts/female/bikini_line.png new file mode 100644 index 00000000..12fc0e6e Binary files /dev/null and b/assets/images/new/body_parts/female/bikini_line.png differ diff --git a/assets/images/new/body_parts/female/bikini_line.svg b/assets/images/new/body_parts/female/bikini_line.svg deleted file mode 100644 index f1f94b7f..00000000 --- a/assets/images/new/body_parts/female/bikini_line.svg +++ /dev/null @@ -1,345 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/buttocks.png b/assets/images/new/body_parts/female/buttocks.png new file mode 100644 index 00000000..b83576f3 Binary files /dev/null and b/assets/images/new/body_parts/female/buttocks.png differ diff --git a/assets/images/new/body_parts/female/buttocks.svg b/assets/images/new/body_parts/female/buttocks.svg deleted file mode 100644 index 59cd0071..00000000 --- a/assets/images/new/body_parts/female/buttocks.svg +++ /dev/null @@ -1,236 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/chest.png b/assets/images/new/body_parts/female/chest.png new file mode 100644 index 00000000..727ebe7a Binary files /dev/null and b/assets/images/new/body_parts/female/chest.png differ diff --git a/assets/images/new/body_parts/female/chest.svg b/assets/images/new/body_parts/female/chest.svg deleted file mode 100644 index 3b681f90..00000000 --- a/assets/images/new/body_parts/female/chest.svg +++ /dev/null @@ -1,345 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/chest_line.png b/assets/images/new/body_parts/female/chest_line.png new file mode 100644 index 00000000..0b4fecb8 Binary files /dev/null and b/assets/images/new/body_parts/female/chest_line.png differ diff --git a/assets/images/new/body_parts/female/chest_line.svg b/assets/images/new/body_parts/female/chest_line.svg deleted file mode 100644 index dc4f8b25..00000000 --- a/assets/images/new/body_parts/female/chest_line.svg +++ /dev/null @@ -1,345 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/full_leg.svg b/assets/images/new/body_parts/female/full_leg.svg deleted file mode 100644 index e1a5e46d..00000000 --- a/assets/images/new/body_parts/female/full_leg.svg +++ /dev/null @@ -1,348 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/full_legs.png b/assets/images/new/body_parts/female/full_legs.png new file mode 100644 index 00000000..5a365a7e Binary files /dev/null and b/assets/images/new/body_parts/female/full_legs.png differ diff --git a/assets/images/new/body_parts/female/lower_arm.png b/assets/images/new/body_parts/female/lower_arm.png new file mode 100644 index 00000000..717b2cde Binary files /dev/null and b/assets/images/new/body_parts/female/lower_arm.png differ diff --git a/assets/images/new/body_parts/female/lower_arm.svg b/assets/images/new/body_parts/female/lower_arm.svg deleted file mode 100644 index 6d5d2f39..00000000 --- a/assets/images/new/body_parts/female/lower_arm.svg +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/lower_leg.png b/assets/images/new/body_parts/female/lower_leg.png new file mode 100644 index 00000000..88ccacef Binary files /dev/null and b/assets/images/new/body_parts/female/lower_leg.png differ diff --git a/assets/images/new/body_parts/female/lower_leg.svg b/assets/images/new/body_parts/female/lower_leg.svg deleted file mode 100644 index 4961af4b..00000000 --- a/assets/images/new/body_parts/female/lower_leg.svg +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/shoulder.svg b/assets/images/new/body_parts/female/shoulder.svg deleted file mode 100644 index ce611e29..00000000 --- a/assets/images/new/body_parts/female/shoulder.svg +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/shoulders.png b/assets/images/new/body_parts/female/shoulders.png new file mode 100644 index 00000000..e1f253a8 Binary files /dev/null and b/assets/images/new/body_parts/female/shoulders.png differ diff --git a/assets/images/new/body_parts/female/upper_arm.png b/assets/images/new/body_parts/female/upper_arm.png new file mode 100644 index 00000000..1edb873c Binary files /dev/null and b/assets/images/new/body_parts/female/upper_arm.png differ diff --git a/assets/images/new/body_parts/female/upper_arm.svg b/assets/images/new/body_parts/female/upper_arm.svg deleted file mode 100644 index ec126ffd..00000000 --- a/assets/images/new/body_parts/female/upper_arm.svg +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/upper_leg.svg b/assets/images/new/body_parts/female/upper_leg.svg deleted file mode 100644 index b1fd3a95..00000000 --- a/assets/images/new/body_parts/female/upper_leg.svg +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/female/upper_legs.png b/assets/images/new/body_parts/female/upper_legs.png new file mode 100644 index 00000000..a8aa2ec7 Binary files /dev/null and b/assets/images/new/body_parts/female/upper_legs.png differ diff --git a/assets/images/new/body_parts/male/abdomin.png b/assets/images/new/body_parts/male/abdomin.png new file mode 100644 index 00000000..1b180b42 Binary files /dev/null and b/assets/images/new/body_parts/male/abdomin.png differ diff --git a/assets/images/new/body_parts/male/abdomin.svg b/assets/images/new/body_parts/male/abdomin.svg deleted file mode 100644 index 82e2d556..00000000 --- a/assets/images/new/body_parts/male/abdomin.svg +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/axilla.png b/assets/images/new/body_parts/male/axilla.png new file mode 100644 index 00000000..61af9492 Binary files /dev/null and b/assets/images/new/body_parts/male/axilla.png differ diff --git a/assets/images/new/body_parts/male/axilla.svg b/assets/images/new/body_parts/male/axilla.svg deleted file mode 100644 index 85abbfda..00000000 --- a/assets/images/new/body_parts/male/axilla.svg +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/bikini.png b/assets/images/new/body_parts/male/bikini.png new file mode 100644 index 00000000..aa98ea74 Binary files /dev/null and b/assets/images/new/body_parts/male/bikini.png differ diff --git a/assets/images/new/body_parts/male/bikini.svg b/assets/images/new/body_parts/male/bikini.svg deleted file mode 100644 index 1c545916..00000000 --- a/assets/images/new/body_parts/male/bikini.svg +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/bikini_line.png b/assets/images/new/body_parts/male/bikini_line.png new file mode 100644 index 00000000..60ed64e2 Binary files /dev/null and b/assets/images/new/body_parts/male/bikini_line.png differ diff --git a/assets/images/new/body_parts/male/bikini_line.svg b/assets/images/new/body_parts/male/bikini_line.svg deleted file mode 100644 index 7fdc51d1..00000000 --- a/assets/images/new/body_parts/male/bikini_line.svg +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/chest.png b/assets/images/new/body_parts/male/chest.png new file mode 100644 index 00000000..b7cec070 Binary files /dev/null and b/assets/images/new/body_parts/male/chest.png differ diff --git a/assets/images/new/body_parts/male/chest.svg b/assets/images/new/body_parts/male/chest.svg deleted file mode 100644 index 85a761fe..00000000 --- a/assets/images/new/body_parts/male/chest.svg +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/chest_line.png b/assets/images/new/body_parts/male/chest_line.png new file mode 100644 index 00000000..41e779f3 Binary files /dev/null and b/assets/images/new/body_parts/male/chest_line.png differ diff --git a/assets/images/new/body_parts/male/chest_line.svg b/assets/images/new/body_parts/male/chest_line.svg deleted file mode 100644 index 806ddb0c..00000000 --- a/assets/images/new/body_parts/male/chest_line.svg +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/full_leg.svg b/assets/images/new/body_parts/male/full_leg.svg deleted file mode 100644 index b5755167..00000000 --- a/assets/images/new/body_parts/male/full_leg.svg +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/full_legs.png b/assets/images/new/body_parts/male/full_legs.png new file mode 100644 index 00000000..eee2fa07 Binary files /dev/null and b/assets/images/new/body_parts/male/full_legs.png differ diff --git a/assets/images/new/body_parts/male/full_neck.png b/assets/images/new/body_parts/male/full_neck.png new file mode 100644 index 00000000..a75159f6 Binary files /dev/null and b/assets/images/new/body_parts/male/full_neck.png differ diff --git a/assets/images/new/body_parts/male/full_neck.svg b/assets/images/new/body_parts/male/full_neck.svg deleted file mode 100644 index 43183598..00000000 --- a/assets/images/new/body_parts/male/full_neck.svg +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/half_neck.png b/assets/images/new/body_parts/male/half_neck.png new file mode 100644 index 00000000..5ee0249c Binary files /dev/null and b/assets/images/new/body_parts/male/half_neck.png differ diff --git a/assets/images/new/body_parts/male/half_neck.svg b/assets/images/new/body_parts/male/half_neck.svg deleted file mode 100644 index 4e57b51c..00000000 --- a/assets/images/new/body_parts/male/half_neck.svg +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/lower_arm.png b/assets/images/new/body_parts/male/lower_arm.png new file mode 100644 index 00000000..120242ed Binary files /dev/null and b/assets/images/new/body_parts/male/lower_arm.png differ diff --git a/assets/images/new/body_parts/male/lower_arm.svg b/assets/images/new/body_parts/male/lower_arm.svg deleted file mode 100644 index c8dbf48d..00000000 --- a/assets/images/new/body_parts/male/lower_arm.svg +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/lower_leg.svg b/assets/images/new/body_parts/male/lower_leg.svg deleted file mode 100644 index 091c29a4..00000000 --- a/assets/images/new/body_parts/male/lower_leg.svg +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/lower_legs.png b/assets/images/new/body_parts/male/lower_legs.png new file mode 100644 index 00000000..8367aa8c Binary files /dev/null and b/assets/images/new/body_parts/male/lower_legs.png differ diff --git a/assets/images/new/body_parts/male/shoulders.png b/assets/images/new/body_parts/male/shoulders.png new file mode 100644 index 00000000..907f2dd7 Binary files /dev/null and b/assets/images/new/body_parts/male/shoulders.png differ diff --git a/assets/images/new/body_parts/male/shoulders.svg b/assets/images/new/body_parts/male/shoulders.svg deleted file mode 100644 index bd6cac52..00000000 --- a/assets/images/new/body_parts/male/shoulders.svg +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/upper_arm.png b/assets/images/new/body_parts/male/upper_arm.png new file mode 100644 index 00000000..f80a75da Binary files /dev/null and b/assets/images/new/body_parts/male/upper_arm.png differ diff --git a/assets/images/new/body_parts/male/upper_arm.svg b/assets/images/new/body_parts/male/upper_arm.svg deleted file mode 100644 index 7d959a0d..00000000 --- a/assets/images/new/body_parts/male/upper_arm.svg +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/upper_leg.svg b/assets/images/new/body_parts/male/upper_leg.svg deleted file mode 100644 index 342cfd84..00000000 --- a/assets/images/new/body_parts/male/upper_leg.svg +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/new/body_parts/male/upper_legs.png b/assets/images/new/body_parts/male/upper_legs.png new file mode 100644 index 00000000..e0c973b7 Binary files /dev/null and b/assets/images/new/body_parts/male/upper_legs.png differ diff --git a/assets/images/new/cart.svg b/assets/images/new/cart.svg new file mode 100644 index 00000000..334b86ba --- /dev/null +++ b/assets/images/new/cart.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index 6b4c0f78..cb6be309 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -2,25 +2,25 @@ - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 8.0 + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 11.0 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index e83c3bf5..1eb27a20 100644 --- a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,128 +1,128 @@ { - "images":[ - { - "idiom":"iphone", - "size":"20x20", - "scale":"2x", - "filename":"Icon-App-20x20@2x.png" - }, - { - "idiom":"iphone", - "size":"20x20", - "scale":"3x", - "filename":"Icon-App-20x20@3x.png" - }, - { - "idiom":"iphone", - "size":"29x29", - "scale":"1x", - "filename":"Icon-App-29x29@1x.png" - }, - { - "idiom":"iphone", - "size":"29x29", - "scale":"2x", - "filename":"Icon-App-29x29@2x.png" - }, - { - "idiom":"iphone", - "size":"29x29", - "scale":"3x", - "filename":"Icon-App-29x29@3x.png" - }, - { - "idiom":"iphone", - "size":"40x40", - "scale":"2x", - "filename":"Icon-App-40x40@2x.png" - }, - { - "idiom":"iphone", - "size":"40x40", - "scale":"3x", - "filename":"Icon-App-40x40@3x.png" - }, - { - "idiom":"iphone", - "size":"60x60", - "scale":"2x", - "filename":"Icon-App-60x60@2x.png" - }, - { - "idiom":"iphone", - "size":"60x60", - "scale":"3x", - "filename":"Icon-App-60x60@3x.png" - }, - { - "idiom":"iphone", - "size":"76x76", - "scale":"2x", - "filename":"Icon-App-76x76@2x.png" - }, - { - "idiom":"ipad", - "size":"20x20", - "scale":"1x", - "filename":"Icon-App-20x20@1x.png" - }, - { - "idiom":"ipad", - "size":"20x20", - "scale":"2x", - "filename":"Icon-App-20x20@2x.png" - }, - { - "idiom":"ipad", - "size":"29x29", - "scale":"1x", - "filename":"Icon-App-29x29@1x.png" - }, - { - "idiom":"ipad", - "size":"29x29", - "scale":"2x", - "filename":"Icon-App-29x29@2x.png" - }, - { - "idiom":"ipad", - "size":"40x40", - "scale":"1x", - "filename":"Icon-App-40x40@1x.png" - }, - { - "idiom":"ipad", - "size":"40x40", - "scale":"2x", - "filename":"Icon-App-40x40@2x.png" - }, - { - "idiom":"ipad", - "size":"76x76", - "scale":"1x", - "filename":"Icon-App-76x76@1x.png" - }, - { - "idiom":"ipad", - "size":"76x76", - "scale":"2x", - "filename":"Icon-App-76x76@2x.png" - }, - { - "idiom":"ipad", - "size":"83.5x83.5", - "scale":"2x", - "filename":"Icon-App-83.5x83.5@2x.png" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "scale" : "1x", - "filename" : "ItunesArtwork@2x.png" - } - ], - "info":{ - "version":1, - "author":"easyappicon" + "images" : [ + { + "filename" : "Icon-App-20x20@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "Icon-App-20x20@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "filename" : "Icon-App-29x29@1x.png", + "idiom" : "iphone", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "Icon-App-29x29@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "Icon-App-29x29@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "filename" : "Icon-App-40x40@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "Icon-App-40x40@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "filename" : "Icon-App-60x60@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "filename" : "Icon-App-60x60@3x.png", + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "filename" : "Icon-App-20x20@1x.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "filename" : "Icon-App-20x20@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "filename" : "Icon-App-29x29@1x.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "filename" : "Icon-App-29x29@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "filename" : "Icon-App-40x40@1x.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "filename" : "Icon-App-40x40@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "filename" : "Icon-App-76x76@1x.png", + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "filename" : "Icon-App-76x76@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "filename" : "Icon-App-83.5x83.5@2x.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "filename" : "icon.jpg", + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + }, + { + "filename" : "Icon-App-76x76@2x.png", + "idiom" : "iphone", + "scale" : "2x", + "size" : "76x76" } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } } diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada47..00000000 Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 72bd4ac9..ec89ac71 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -15,50 +15,73 @@ CFBundlePackageType APPL CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleVersion $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + MinimumOSVersion + 11.0 + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSAllowsArbitraryLoadsForMedia + + NSAllowsArbitraryLoadsInWebContent + + + NSAppleMusicUsageDescription + Required by another plugin, Please let us know if you find this functionality anywhere in the app. + NSBluetoothAlwaysUsageDescription + This App requires access to Bluetooth to connect blood pressure & blood sugar devices with the app to analyze the data. + NSBluetoothPeripheralUsageDescription + This App requires access to Bluetooth to connect blood pressure & blood sugar devices with the app to analyze the data. NSCalendarsUsageDescription - We need access to record you event in to calender. + This app requires calendar access to set reminders for Virtual & Normal Appointments. NSCameraUsageDescription - Need camera access for uploading images + This app requires camera access to enable virtual consultation between patient & doctor + NSContactsUsageDescription + This app requires contacts access to show incoming virtual consultation request. + NSFaceIDUsageDescription + This app requires Face ID to allow biometric authentication for app login. + NSHealthShareUsageDescription + This App need access to HealthKit to read heart rate & other data from your smart watch. + NSHealthUpdateUsageDescription + This App need access to HealthKit to read heart rate & other data from your smart watch. NSLocationAlwaysAndWhenInUseUsageDescription - This app will use your location to show cool stuffs near you. + This App requires access to your location to show the nearest hospitals & ER Locations from your location. NSLocationAlwaysUsageDescription - This app will use your location to show cool stuffs near you. - NSLocationUsageDescription - Need location access for updating nearby friends + This App requires access to your location to show the nearest hospitals from your location. NSLocationWhenInUseUsageDescription - This app will use your location to show cool stuffs near you. + This App requires access to your location to show the nearest hospitals from your location. NSMicrophoneUsageDescription - Need microphone access for uploading videos + This app requires microphone access to enable virtual consultation between patient & doctor + NSMotionUsageDescription + This app requires motion detection access to function properly. NSPhotoLibraryUsageDescription - Need photo library access for uploading images + This app requires photo library access to select image as document & upload it. + NSRemindersUsageDescription + This app requires calendar access to set reminders for Virtual & Normal Appointments. + NSSpeechRecognitionUsageDescription + This app requires speech recognition access to access voice command features. + NSUserActivityTypes + UIBackgroundModes - fetch + audio location - processing + remote-notification UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main - UIRequiredDeviceCapabilities - - location-services - gps - armv7 - UISupportedInterfaceOrientations UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 56113044..ee0d4f2f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -171,6 +171,7 @@ const Map localizedValues = { "minute": {"en": "Minutes", "ar": "دقيقة"}, "hour": {"en": "Hour", "ar": "ساعة"}, "reminderSuccess": {"en": "The reminder has been added successfully", "ar": "تمت إضافة التذكير بنجاح"}, + "reminderCancelSuccess": {"en": "The reminder has been cancelled successfully", "ar": "تم إلغاء التذكير بنجاح"}, "patientShareToDo": {"en": "Amount before tax: ", "ar": "المبلغ قبل الضريبة:"}, "patientTaxToDo": {"en": "Tax amount: ", "ar": "قيمة الضريبة:"}, "patientShareTotalToDo": {"en": "Total amount Due: ", "ar": "المبلغ الإجمالي المستحق:"}, @@ -449,6 +450,7 @@ const Map localizedValues = { "Frequency": {"en": "Frequency", "ar": "المعدل"}, "DailyQuantity": {"en": "Daily Quantity :", "ar": "جرعات يومية"}, "AddReminder": {"en": "Add Reminder", "ar": "إضافة تذكير"}, + "CancelReminder": {"en": "Cancel Reminder", "ar": "إلغاء تذكير"}, "reminderDes": { "en": "Please select treatment start day and time to be notified when it\'s time to take the medicine", "ar": "يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء" @@ -553,6 +555,7 @@ const Map localizedValues = { "shipping": {"en": "Shipping", "ar": " الشحن"}, "shipBy": {"en": "SHIP BY:", "ar": "الشحن عن طريق:"}, "lakumPoints": {"en": "Lakum Points", "ar": "نقاط برنامج لكم"}, + "useLakumPoints": {"en": "Use Lakum points", "ar": "استخدم برنامج لكم"}, "use": {"en": "USE", "ar": "استخدم"}, "proceedPay": {"en": "PROCEED TO PAY", "ar": "المتابعة للدفع"}, "vat": {"en": "VAT (15%)", "ar": "(15%) القيمة المضافة"}, @@ -819,7 +822,7 @@ const Map localizedValues = { "body": {"en": "Body Mass", "ar": "كتلة\nالجسم"}, "body_string": {"en": "Body", "ar": "الجسم"}, "face": {"en": "Face", "ar": "وجه"}, - "retouch": {"en": "Retouch", "ar": "تنميق"}, + "retouch": {"en": "Retouch", "ar": "روتوش"}, "bikini": {"en": "Bikini", "ar": "بيكيني"}, "totalMinutes": {"en": "Total Minutes", "ar": "إجمالي الدقائق"}, "feedback": {"en": "Feedback", "ar": "رأيك يهمنا"}, @@ -1352,7 +1355,7 @@ const Map localizedValues = { "en": " This service allows you to activate your LAKUM account after registering completed.", "ar": " تتيح لك هذه الخدمة تفعيل حساب برنامج الولاء لكم بعد اكتمال التسجيل. " }, - "pointsToTransfer": {"en": "Point's to Transfer:", "ar": "النقاط المراد تحويلها:"}, + "pointsToTransfer": {"en": "Points to Transfer:", "ar": "النقاط المراد تحويلها:"}, "enterBeneficiaryAccountNo": {"en": "Enter Beneficiary Account No.", "ar": "أدخل رقم حساب المستفيد"}, "confirm-prescription": {"en": "Are you sure !! you want to send this request", "ar": "تاكيد ارسال الطلب؟"}, "you-already-have-order": {"en": "You already have this order! do you want to view it?", "ar": "لديك هذا الطلب بالفعل! هل تريد مشاهدته؟"}, @@ -1691,8 +1694,7 @@ const Map localizedValues = { "lowLimits": {"en": "Please check the value you have entered, since the body fat percentage cannot be this low.", "ar": "يرجى التحقق من القيمة التي أدخلتها ، حيث لا يمكن أن تكون نسبة الدهون في الجسم منخفضة."}, "estimates": {"en": "Estimates the total body fat based on\nthe size", "ar": "تقدير إجمالي الدهون في الجسم بناءً على \ n الحجم"}, - - "myCart": {"en": "Cart", "ar": "عربة التسوق"}, + "myCart": {"en": "My Cart", "ar": "عربة التسوق"}, "browseOffers": {"en": "Browse offers by clinic", "ar": "تصفح العروض حسب العيادة"}, "inactiveAct":{"en":"Almost inactive (little or no exercise)","ar":"غير نشط تقريبا (ممارسة الرياضة قليلة أو منعدمة)"}, "light":{"en":"Lightly active (1-3) days per week","ar":"خفيف النشاط (1-3 أيام في الأسبوع)"}, @@ -1727,4 +1729,8 @@ const Map localizedValues = { "gramsPerDay": {"en": "Grams Per Day", "ar": "غرام في اليوم"}, "gr": {"en": "gr", "ar": "غرام"}, "gramsPerMeal": {"en": "Grams Per Meal", "ar": "عدد الجرامات لكل وجبة"}, + "syncSuccess": {"en": "Data Synced Successfully", "ar": "تمت مزامنة البيانات بنجاح"}, + "points": {"en": "Points", "ar": "نقاط"}, + "availableBalance": {"en": "Available Balance", "ar": "الرصيد المتوفر"}, + "ordersDashboard": {"en": "My Orders", "ar": "طلباتي"}, }; diff --git a/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart b/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart index c609fa0b..e7948d7d 100644 --- a/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart +++ b/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart @@ -2,35 +2,35 @@ import 'PointsAmountPerYear.dart'; import 'PointsDetails.dart'; class LakumInquiryInformationObjVersion { - int accountNumber; + num accountNumber; String accountStatus; String barCode; - int consumedPoints; + num consumedPoints; String consumedPointsAmount; List consumedPointsAmountPerYear; List consumedPointsDetails; String createdDate; - int expiredPoints; + num expiredPoints; String expiryDate; - int gainedPoints; + num gainedPoints; List gainedPointsAmountPerYear; List gainedPointsDetails; String lakumMessageStatus; String memberName; String memberUniversalId; String mobileNumber; - int pointsBalance; - int pointsBalanceAmount; - int pointsWillBeExpired; + num pointsBalance; + num pointsBalanceAmount; + num pointsWillBeExpired; String prefLang; - int statusCode; - int transferPoints; + num statusCode; + num transferPoints; List transferPointsAmountPerYear; List transferPointsDetails; dynamic waitingPoints; dynamic loyalityAmount; dynamic loyalityPoints; - int purchaseRate; + num purchaseRate; LakumInquiryInformationObjVersion( {this.accountNumber, diff --git a/lib/core/model/pharmacies/PointsAmountPerYear.dart b/lib/core/model/pharmacies/PointsAmountPerYear.dart index eef74064..2d25855f 100644 --- a/lib/core/model/pharmacies/PointsAmountPerYear.dart +++ b/lib/core/model/pharmacies/PointsAmountPerYear.dart @@ -1,10 +1,10 @@ import 'PointsAmountPerMonth.dart'; class PointsAmountPerYear { - int amountPerYear; + num amountPerYear; List pointsAmountPerMonth; - int pointsPerYear; - int year; + num pointsPerYear; + num year; PointsAmountPerYear( {this.amountPerYear, diff --git a/lib/core/model/pharmacies/payment-checkout-data.dart b/lib/core/model/pharmacies/payment-checkout-data.dart index 5d91c829..f6f93fa2 100644 --- a/lib/core/model/pharmacies/payment-checkout-data.dart +++ b/lib/core/model/pharmacies/payment-checkout-data.dart @@ -11,7 +11,7 @@ class PaymentCheckoutData { LacumAccountInformation lacumInformation; bool cartDataVisible; ShippingOption shippingOption; - int usedLakumPoints; + num usedLakumPoints; PaymentCheckoutData({this.address, this.paymentOption, this.lacumInformation, this.cartDataVisible = false, this.shippingOption, this.usedLakumPoints = 0}); diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 1f6ca580..f9361e90 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -467,7 +467,9 @@ class BaseAppClient { onFailure(TranslationBase.of(AppGlobal.context).pharmacyRelogin, statusCode); Navigator.of(AppGlobal.context).pushNamed(HOME); } else { - onFailure('Error While Fetching data', statusCode); + var bodyUtf = json.decode(utf8.decode(response.bodyBytes)); + print(bodyUtf); + onFailure(bodyUtf['error']['ErrorEndUserMsg'], statusCode); } } else { // var parsed = json.decode(response.body.toString()); diff --git a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart index e9f2a3d4..6d212d2b 100644 --- a/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart +++ b/lib/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart @@ -166,8 +166,7 @@ class OrderPreviewViewModel extends BaseViewModel { } getInformationsByAddress(String identificationNo) async { - await getShippingOption(); - await getLacumAccountInformation(identificationNo); + await getShippingOption(identificationNo); } getLacumAccountInformation(String identificationNo) async { @@ -194,18 +193,18 @@ class OrderPreviewViewModel extends BaseViewModel { } } - getShippingOption() async { + Future getShippingOption(String identificationNo) async { setState(ViewState.Busy); - await _orderService.getShippingOption(paymentCheckoutData.address).then((res) { - paymentCheckoutData.shippingOption = ShippingOption.fromJson(res); - setState(ViewState.Idle); + await _orderService.getShippingOption(paymentCheckoutData.address).then((res) async { + if (_orderService.hasError) { + error = _orderService.error; + setState(ViewState.Error); + } else { + paymentCheckoutData.shippingOption = ShippingOption.fromJson(res); + setState(ViewState.Idle); + await getLacumAccountInformation(identificationNo); + } }); - if (_orderService.hasError) { - error = _orderService.error; - setState(ViewState.Error); - } else { - setState(ViewState.Idle); - } } Future makeOrder() async { diff --git a/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart b/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart index c03e8e87..1bd0d542 100644 --- a/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart +++ b/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart @@ -1,5 +1,5 @@ import 'dart:async'; -import 'dart:convert' as convert; +import 'dart:convert'; import 'dart:typed_data'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; @@ -92,8 +92,8 @@ class LacumViewModel extends BaseViewModel { Uint8List convertBase64ToBarCodeImage() { try { - final _byteImage = convert.base64Decode( - lacumGroupInformation.lakumInquiryInformationObjVersion.barCode); + final _byteImage = base64Decode( + lacumGroupInformation.lakumInquiryInformationObjVersion.barCode.split(',').last); return _byteImage; } catch (e) { print(e); diff --git a/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart b/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart index df895e28..23952514 100644 --- a/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/product_detail_view_model.dart @@ -57,10 +57,10 @@ class ProductDetailViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future notifyMe(customerId, itemID, context) async { + Future notifyMe(customerId, itemID) async { hasError = false; setState(ViewState.BusyLocal); - await _productDetailService.notifyMe(customerId, itemID, context); + await _productDetailService.notifyMe(customerId, itemID); if (_productDetailService.hasError) { error = _productDetailService.error; setState(ViewState.ErrorLocal); diff --git a/lib/models/SmartWatch/HealthData.dart b/lib/models/SmartWatch/HealthData.dart index d681f764..ac514dc2 100644 --- a/lib/models/SmartWatch/HealthData.dart +++ b/lib/models/SmartWatch/HealthData.dart @@ -4,15 +4,13 @@ class healthData { String MachineDate; double Value; int TransactionsListID; - String Notes; healthData({ this.MedCategoryID, this.MedSubCategoryID, this.MachineDate, this.Value, - this.TransactionsListID, - this.Notes, + this.TransactionsListID }); healthData.fromJson(Map json) { @@ -21,7 +19,6 @@ class healthData { MachineDate = json['MachineDate']; Value = json['Value']; TransactionsListID = json['TransactionsListID']; - Notes = json['Notes']; } Map toJson() { @@ -31,7 +28,6 @@ class healthData { data['MachineDate'] = this.MachineDate; data['Value'] = this.Value; data['TransactionsListID'] = this.TransactionsListID; - data['Notes'] = this.Notes; return data; } } \ No newline at end of file diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 8e576c99..3a6d9185 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -78,7 +78,7 @@ class _DocAvailableAppointmentsState extends State wit WidgetsBinding.instance.addPostFrameCallback((_) async { getCurrentLanguage(); - if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) + if (await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) != null && await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT)) getDoctorScheduledFreeSlots(context, widget.doctor); else { getDoctorFreeSlots(context, widget.doctor); diff --git a/lib/pages/medical/prescriptions/prescription_details_page.dart b/lib/pages/medical/prescriptions/prescription_details_page.dart index d20fbe87..3a5b124b 100644 --- a/lib/pages/medical/prescriptions/prescription_details_page.dart +++ b/lib/pages/medical/prescriptions/prescription_details_page.dart @@ -1,15 +1,17 @@ +import 'dart:collection'; + +import 'package:device_calendar/device_calendar.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/extensions/string_extensions.dart'; import 'package:diplomaticquarterapp/models/header_model.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/reminder_dialog.dart'; -import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog_prescription.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; -import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; @@ -23,12 +25,25 @@ import 'package:flutter/material.dart'; import 'package:jiffy/jiffy.dart'; import 'package:provider/provider.dart'; -class PrescriptionDetailsPage extends StatelessWidget { +class PrescriptionDetailsPage extends StatefulWidget { final PrescriptionReport prescriptionReport; final Prescriptions prescriptions; PrescriptionDetailsPage({Key key, this.prescriptionReport, this.prescriptions}); + @override + _PrescriptionDetailsPageState createState() => _PrescriptionDetailsPageState(); +} + +class _PrescriptionDetailsPageState extends State { + bool hasReminder = false; + + @override + void initState() { + checkIfHasReminder(); + super.initState(); + } + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -42,18 +57,18 @@ class PrescriptionDetailsPage extends StatelessWidget { children: [ DoctorHeader( headerModel: HeaderModel( - prescriptions.doctorName, - prescriptions.doctorID, - prescriptions.doctorImageURL, - prescriptions.speciality, + widget.prescriptions.doctorName, + widget.prescriptions.doctorID, + widget.prescriptions.doctorImageURL, + widget.prescriptions.speciality, "", - prescriptions.name, - DateUtil.convertStringToDate(prescriptions.appointmentDate), - DateUtil.formatDateToTime(DateUtil.convertStringToDate(prescriptions.appointmentDate)), - prescriptions.nationalityFlagURL, - prescriptions.doctorRate, - prescriptions.actualDoctorRate, - prescriptions.noOfPatientsRate, + widget.prescriptions.name, + DateUtil.convertStringToDate(widget.prescriptions.appointmentDate), + DateUtil.formatDateToTime(DateUtil.convertStringToDate(widget.prescriptions.appointmentDate)), + widget.prescriptions.nationalityFlagURL, + widget.prescriptions.doctorRate, + widget.prescriptions.actualDoctorRate, + widget.prescriptions.noOfPatientsRate, "", ), isNeedToShowButton: false, @@ -104,7 +119,7 @@ class PrescriptionDetailsPage extends StatelessWidget { children: [ Container( child: Image.network( - prescriptionReport.imageSRCUrl, + widget.prescriptionReport.imageSRCUrl, fit: BoxFit.cover, width: 48, height: 49, @@ -125,13 +140,15 @@ class PrescriptionDetailsPage extends StatelessWidget { ], ), onTap: () { - showZoomImageDialog(context, prescriptionReport.imageSRCUrl); + showZoomImageDialog(context, widget.prescriptionReport.imageSRCUrl); }, ), SizedBox(width: 12), Expanded( child: Text( - (prescriptionReport.itemDescription.isNotEmpty ? prescriptionReport.itemDescription : prescriptionReport.itemDescriptionN ?? '').toLowerCase().capitalizeFirstofEach, + (widget.prescriptionReport.itemDescription.isNotEmpty ? widget.prescriptionReport.itemDescription : widget.prescriptionReport.itemDescriptionN ?? '') + .toLowerCase() + .capitalizeFirstofEach, style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64), ), ) @@ -149,10 +166,10 @@ class PrescriptionDetailsPage extends StatelessWidget { ), TableRow( children: [ - Utils.tableColumnValue(prescriptionReport?.routeN ?? '', isLast: true, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(prescriptionReport?.frequencyN ?? '', isLast: true, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(prescriptionReport?.doseDailyQuantity.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel), - Utils.tableColumnValue(prescriptionReport?.days.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(widget.prescriptionReport?.routeN ?? '', isLast: true, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(widget.prescriptionReport?.frequencyN ?? '', isLast: true, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(widget.prescriptionReport?.doseDailyQuantity.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel), + Utils.tableColumnValue(widget.prescriptionReport?.days.toString() ?? '', isLast: true, mProjectViewModel: projectViewModel), ], ), ]), @@ -161,7 +178,7 @@ class PrescriptionDetailsPage extends StatelessWidget { style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.48), ), Text( - prescriptionReport.remarks, + widget.prescriptionReport.remarks, style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -0.4, height: 16 / 10), ), ], @@ -184,8 +201,8 @@ class PrescriptionDetailsPage extends StatelessWidget { context, FadePage( page: PharmacyForPrescriptionsPage( - itemID: prescriptionReport.itemID, - prescriptionReport: prescriptionReport, + itemID: widget.prescriptionReport.itemID, + prescriptionReport: widget.prescriptionReport, ), ), ); @@ -197,31 +214,35 @@ class PrescriptionDetailsPage extends StatelessWidget { SizedBox(width: 10), Expanded( child: DefaultButton( - TranslationBase.of(context).addReminder, + hasReminder ? TranslationBase.of(context).cancelReminder : TranslationBase.of(context).addReminder, () { - DateTime startDate = DateTime.now(); - DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + prescriptionReport.days); - - showReminderDialog( - context, - endDate, - "", - prescriptionReport.itemID.toString(), - "", - "", - title: "${prescriptionReport.itemDescriptionN} Prescription Reminder", - description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ", - onSuccess: () { - AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); - }, - onMultiDateSuccess: (int selectedIndex) { - setCalender(context, prescriptionReport.itemID.toString(), selectedIndex); - }, - ); - return; + if (hasReminder) { + cancelReminders(); + } else { + DateTime startDate = DateTime.now(); + DateTime endDate = DateTime(startDate.year, startDate.month, startDate.day + widget.prescriptionReport.days); + showReminderDialog( + context, + endDate, + "", + widget.prescriptionReport.itemID.toString(), + "", + "", + title: "${widget.prescriptionReport.itemDescriptionN} Prescription Reminder", + description: "${widget.prescriptionReport.itemDescriptionN} ${widget.prescriptionReport.frequencyN} ${widget.prescriptionReport.routeN} ", + onSuccess: () { + AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); + }, + onMultiDateSuccess: (int selectedIndex) { + setCalender(context, widget.prescriptionReport.itemID.toString(), selectedIndex); + }, + ); + return; + } }, iconData: Icons.notifications_active, color: Color(0xffD02127), + fontSize: 13.0, //textColor: Color(0xff2B353E), ), ), @@ -233,22 +254,62 @@ class PrescriptionDetailsPage extends StatelessWidget { ); } + checkIfHasReminder() async { + CalendarUtils calendarUtils = await CalendarUtils.getInstance(); + + DateTime startEventsDate = Jiffy(DateTime.now()).subtract(days: 30); + DateTime endEventsDate = Jiffy(DateTime.now()).add(days: 120); + + RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate); + + await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) { + Result> events = value; + events.data.forEach((element) { + if (element.title.contains(widget.prescriptionReport.itemDescriptionN)) + setState(() { + hasReminder = true; + }); + }); + }); + } + + cancelReminders() async { + CalendarUtils calendarUtils = await CalendarUtils.getInstance(); + + DateTime startEventsDate = Jiffy(DateTime.now()).subtract(days: 30); + DateTime endEventsDate = Jiffy(DateTime.now()).add(days: 120); + + RetrieveEventsParams params = new RetrieveEventsParams(startDate: startEventsDate, endDate: endEventsDate); + + await calendarUtils.retrieveEvents(calendarUtils.calendars[0].id, params).then((value) { + Result> events = value; + events.data.forEach((element) { + if (element.title.contains(widget.prescriptionReport.itemDescriptionN)) calendarUtils.deleteEvent(calendarUtils.calendars[0], element); + }); + }); + AppToast.showSuccessToast(message: TranslationBase.of(context).reminderCancelSuccess); + setState(() { + hasReminder = false; + }); + } + setCalender(BuildContext context, String eventId, int reminderIndex) async { CalendarUtils calendarUtils = await CalendarUtils.getInstance(); - DateTime startDate = DateUtil.convertStringToDate(prescriptionReport.startDate); - DateTime actualDate = DateTime(startDate.year, startDate.month, startDate.day, 8, 0); //Time will start at 8:00 AM from starting date - if (prescriptionReport?.frequencyNumber == null) prescriptionReport.frequencyNumber = 2; //Some time frequency number is null so by default will be 2 + DateTime actualDate = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day, 8, 0); //Time will start at 8:00 AM from starting date + if (widget.prescriptionReport?.frequencyNumber == null) widget.prescriptionReport.frequencyNumber = 1; //Some time frequency number is null so by default will be 2 + + int remainingDays = widget.prescriptionReport.days - (Jiffy(DateTime.now()).diff(DateUtil.convertStringToDate(widget.prescriptionReport.orderDate), Units.DAY)); + + GifLoaderDialogUtils.showMyDialog(context); - for (int i = 0; i < prescriptionReport.days; i++) { + for (int i = 0; i < remainingDays; i++) { //event for number of days. - for (int j = 0; j < prescriptionReport.frequencyNumber ?? 2; j++) { + for (int j = 0; j < widget.prescriptionReport.frequencyNumber ?? 1; j++) { // event for number of times per day. - if (j != 0) { actualDate.add(new Duration(hours: 8)); // 8 hours addition for daily dose. } - //Time subtraction from actual reminder time. like before 30, or 1 hour. if (reminderIndex == 0) { // Before 30 mints @@ -269,38 +330,21 @@ class PrescriptionDetailsPage extends StatelessWidget { } calendarUtils .createOrUpdateEvent( - title: "${prescriptionReport.itemDescriptionN} Prescription Reminder", - description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ", + title: "${widget.prescriptionReport.itemDescriptionN} Prescription Reminder", + description: "${widget.prescriptionReport.itemDescriptionN} ${widget.prescriptionReport.frequencyN} ${widget.prescriptionReport.routeN} ", scheduleDateTime: actualDate, eventId: eventId + (i.toString() + j.toString()), //event id with varitions ) - .then( - (value) {}, - ); + .then((value) {}); + actualDate = DateTime(actualDate.year, actualDate.month, actualDate.day, 8, 0); } - actualDate.add(new Duration(days: i + 1)); + actualDate = Jiffy(actualDate).add(days: 1); + print(actualDate); } AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); + GifLoaderDialogUtils.hideDialog(context); + setState(() { + hasReminder = true; + }); } - - //schedual local notifications - // setTheNotificatoin(BuildContext context) { - // DateTime startDate = DateUtil.convertStringToDate(prescriptionReport.startDate); - // DateTime actualDate = DateTime(startDate.year, startDate.month, startDate.day, 8, 0); - // if (prescriptionReport?.frequencyNumber == null) prescriptionReport.frequencyNumber = 2; - // - // for (int i = 0; i < prescriptionReport.days; i++) { - // for (int j = 0; j < prescriptionReport.frequencyNumber ?? 2; j++) { - // if (j != 0) { - // actualDate.add(new Duration(hours: 8)); - // } - // LocalNotification.getInstance().scheduleNotification( - // scheduledNotificationDateTime: actualDate, - // title: "${prescriptionReport.itemDescriptionN} Prescription Reminder", - // description: "${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} "); - // } - // actualDate.add(new Duration(days: i + 1)); - // } - // AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); - // } } diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index 0e627a95..a9be08d2 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -243,6 +243,8 @@ class PrescriptionItemsPage extends StatelessWidget { doseDailyQuantity: model.prescriptionReportEnhList[index].doseDailyQuantity, days: model.prescriptionReportEnhList[index].days, itemID: model.prescriptionReportEnhList[index].itemID, + orderDate: model.prescriptionReportEnhList[index].orderDate, + startDate: model.prescriptionReportEnhList[index].startDate, remarks: model.prescriptionReportEnhList[index].remarks); Navigator.push( context, diff --git a/lib/pages/medical/smart_watch_health_data/syncHealthData.dart b/lib/pages/medical/smart_watch_health_data/syncHealthData.dart index ac497ba4..7b089935 100644 --- a/lib/pages/medical/smart_watch_health_data/syncHealthData.dart +++ b/lib/pages/medical/smart_watch_health_data/syncHealthData.dart @@ -1,6 +1,7 @@ import 'package:collection/collection.dart'; import 'package:diplomaticquarterapp/models/SmartWatch/HealthData.dart'; import 'package:diplomaticquarterapp/services/smartwatch_integration/SmartWatchIntegrationService.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -149,8 +150,7 @@ class _syncHealthDataButtonState extends State { } } date = DateUtil.convertDateToString(date); - Med_InsertTransactionsInputsList.add( - healthData(MedCategoryID: MedCategoryID, MedSubCategoryID: MedSubCategoryID, MachineDate: date, Value: value, TransactionsListID: TransactionsListID++, Notes: "")); + Med_InsertTransactionsInputsList.add(healthData(MedCategoryID: MedCategoryID, MedSubCategoryID: MedSubCategoryID, MachineDate: date, Value: value, TransactionsListID: TransactionsListID++)); }); } } @@ -197,27 +197,17 @@ class _syncHealthDataButtonState extends State { // to convert from meter to km totalDistance += (element['Value'] * 0.001); } else if (element['MedCategoryID'] == 3) { - print("HeartRate"); + // print("HeartRate"); MedCategoryID = 3; counter++; totalHeartRate += element['Value']; } else if (element['MedCategoryID'] == 4) { print("sleeeeep"); sleepDataList.add(new healthData( - MedCategoryID: 4, - MedSubCategoryID: element['MedSubCategoryID'], - MachineDate: DateUtil.convertDateToString(date), - Value: element['Value'], - TransactionsListID: TransactionsListID++, - Notes: "")); + MedCategoryID: 4, MedSubCategoryID: element['MedSubCategoryID'], MachineDate: DateUtil.convertDateToString(date), Value: element['Value'], TransactionsListID: TransactionsListID++)); Med_InsertTransactionsInputsList2.add(new healthData( - MedCategoryID: 4, - MedSubCategoryID: element['MedSubCategoryID'], - MachineDate: DateUtil.convertDateToString(date), - Value: element['Value'], - TransactionsListID: TransactionsListID++, - Notes: "")); + MedCategoryID: 4, MedSubCategoryID: element['MedSubCategoryID'], MachineDate: DateUtil.convertDateToString(date), Value: element['Value'], TransactionsListID: TransactionsListID++)); } // else if(element['MedCategoryID'] == 8){ // @@ -235,27 +225,16 @@ class _syncHealthDataButtonState extends State { } Med_InsertTransactionsInputsList2.add( - new healthData(MedCategoryID: 6, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToString(date), Value: totalSteps, TransactionsListID: TransactionsListID++, Notes: "")); + new healthData(MedCategoryID: 6, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToStringLocation(date), Value: totalSteps, TransactionsListID: TransactionsListID++)); Med_InsertTransactionsInputsList2.add( - new healthData(MedCategoryID: 7, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToString(date), Value: totalDistance, TransactionsListID: TransactionsListID++, Notes: "")); + new healthData(MedCategoryID: 7, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToStringLocation(date), Value: totalDistance, TransactionsListID: TransactionsListID++)); Med_InsertTransactionsInputsList2.add( - new healthData(MedCategoryID: 3, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToString(date), Value: avgTotalHeartRate, TransactionsListID: TransactionsListID++, Notes: "")); + new healthData(MedCategoryID: 3, MedSubCategoryID: 0, MachineDate: DateUtil.convertDateToStringLocation(date), Value: avgTotalHeartRate, TransactionsListID: TransactionsListID++)); }); addInsertTransactionsInputsList(); GifLoaderDialogUtils.hideDialog(context); - - // AlertDialogBox dialog = new AlertDialogBox( - // context: context, - // confirmMessage: TranslationBase.of(context).alreadySynced, - // okText: TranslationBase.of(context).ok, - // okFunction: () => { - // AlertDialogBox.closeAlertDialog(context), - // }, - // ); - - // dialog.showAlertDialog(context); } addInsertTransactionsInputsList() { @@ -264,7 +243,7 @@ class _syncHealthDataButtonState extends State { SmartWatchIntegrationService service = new SmartWatchIntegrationService(); service.insertPatientHealthData(Med_InsertTransactionsInputsList2, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - print(res); + AppToast.showSuccessToast(message: TranslationBase.of(context).syncSuccess); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); diff --git a/lib/pages/packages_offers/OfferAndPackageDetailPage.dart b/lib/pages/packages_offers/OfferAndPackageDetailPage.dart index 17c88cc8..c4d0ce6e 100644 --- a/lib/pages/packages_offers/OfferAndPackageDetailPage.dart +++ b/lib/pages/packages_offers/OfferAndPackageDetailPage.dart @@ -4,11 +4,11 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:expandable/expandable.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:html/parser.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -45,185 +45,171 @@ class OfferAndPackagesDetailState extends State { isShowDecPage: false, showNewAppBar: true, showNewAppBarTitle: true, - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - color: Colors.white, - padding: const EdgeInsets.all(21.0), - child: ClipRRect( - borderRadius: BorderRadius.circular(15.0), - child: Image.network("https://mdlaboratories.com/offersdiscounts/images/thumbs/0000162_dermatology-testing.jpeg", fit: BoxFit.fill), - ), - ), - Container( - padding: const EdgeInsets.only(left: 21.0, right: 21.0, top: 21.0), - child: Text(widget.itemModel.name, maxLines: 1, style: TextStyle(fontSize: 19.0, fontWeight: FontWeight.bold, letterSpacing: -1.14))), - Container( - padding: const EdgeInsets.only(left: 21.0, right: 21.0), - child: Text(widget.itemModel.shortDescription, - maxLines: 2, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.56, color: CustomColors.textColor), overflow: TextOverflow.clip)), - Row( + body: Column( + children: [ + Expanded( + child: ListView( + physics: BouncingScrollPhysics(), children: [ Container( - padding: const EdgeInsets.only(left: 21.0, right: 21.0, top: 12.0), - child: RatingBar.readOnly( - initialRating: 4.5, - size: 18.0, - filledColor: Color(0XFFD02127), - emptyColor: Color(0XFFD02127), - isHalfAllowed: true, - halfFilledIcon: Icons.star_half, - filledIcon: Icons.star, - emptyIcon: Icons.star_border, + color: Colors.white, + padding: const EdgeInsets.all(21.0), + child: AspectRatio( + aspectRatio: 333 / 333, + child: ClipRRect( + borderRadius: BorderRadius.circular(15.0), + child: Image.network("https://mdlaboratories.com/offersdiscounts/images/thumbs/0000162_dermatology-testing.jpeg", fit: BoxFit.fill), + ), ), ), - ], - ), - Container( - padding: const EdgeInsets.only(left: 21.0, right: 21.0, top: 18.0), - width: double.infinity, - height: 50.0, - child: ListView.separated( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - itemCount: widget.itemModel.storeNames.length, - separatorBuilder: (context, index) { - return mWidth(5.0); - }, - itemBuilder: (BuildContext context, int index) { - return contactButton(widget.itemModel.storeNames[index].toString()); - }, - ), - ), - Container( - padding: const EdgeInsets.only(top: 18.0), - child: ExpandableNotifier( - initialExpanded: true, - child: Container( - color: Colors.white, + Padding( + padding: const EdgeInsets.all(21.0), child: Column( - children: [ - ScrollOnExpand( - scrollOnExpand: true, - scrollOnCollapse: false, - child: ExpandablePanel( - hasIcon: false, - theme: const ExpandableThemeData( - headerAlignment: ExpandablePanelHeaderAlignment.center, - tapBodyToCollapse: true, + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.itemModel.name, + maxLines: 1, + style: TextStyle(fontSize: 19.0, fontWeight: FontWeight.bold, color: Color(0xff2E303A), letterSpacing: -1.14), + ), + Text( + widget.itemModel.shortDescription, + style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, color: Color(0xff575757), letterSpacing: -.56), + ), + SizedBox(height: 9), + Row( + children: [ + RatingBar.readOnly( + initialRating: 4.5, + // todo ask haroon about rating value + size: 18.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, ), - header: Padding( - padding: const EdgeInsets.only(top: 20, bottom: 20, left: 21, right: 21), - child: InkWell( + ], + ), + SizedBox(height: 16), + SizedBox( + height: 34, + child: ListView.separated( + scrollDirection: Axis.horizontal, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + itemCount: widget.itemModel.storeNames.length, + separatorBuilder: (context, index) { + return mWidth(5.0); + }, + itemBuilder: (BuildContext context, int index) { + return contactButton(widget.itemModel.storeNames[index].toString()); + }, + ), + ), + ], + ), + ), + ExpandableNotifier( + initialExpanded: true, + child: Container( + color: Colors.white, + margin: EdgeInsets.only(bottom: 21), + child: Column( + children: [ + ScrollOnExpand( + scrollOnExpand: true, + scrollOnCollapse: false, + child: ExpandablePanel( + hasIcon: false, + theme: const ExpandableThemeData( + headerAlignment: ExpandablePanelHeaderAlignment.center, + tapBodyToCollapse: true, + ), + header: InkWell( onTap: () { setState(() { expandFlag = !expandFlag; controller.expanded = expandFlag; }); }, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - TranslationBase.of(context).description, - maxLines: 1, - style: TextStyle(fontSize: 19.0, fontWeight: FontWeight.bold, letterSpacing: -1.14), - ), - ], + child: Padding( + padding: const EdgeInsets.all(21), + child: Row( + children: [ + Expanded( + child: Text( + TranslationBase.of(context).description, + maxLines: 1, + style: TextStyle(fontSize: 19.0, color: Color(0xff2E303A), fontWeight: FontWeight.bold, letterSpacing: -1.14), + ), + ), + Icon( + expandFlag ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, + color: Color(0xff2E303A), ), - ), - Icon( - expandFlag ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, - color: Color(0xff2E303A), - ), - ], + ], + ), ), ), - ), - builder: (_, collapsed, expanded) { - return Expandable( - controller: controller, - collapsed: collapsed, - expanded: Container( - padding: const EdgeInsets.only(left: 21.0, right: 21.0, bottom: 21.0), + builder: (_, collapsed, expanded) { + return Expandable( + controller: controller, + collapsed: collapsed, + expanded: Padding( + padding: const EdgeInsets.only(bottom: 21, left: 21, right: 21), child: Text(parseHtmlString(widget.itemModel.fullDescription), - style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.56, color: CustomColors.textColor), overflow: TextOverflow.clip)), - theme: const ExpandableThemeData(crossFadePoint: 0), - ); - }, + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.w600, + letterSpacing: -0.56, + color: Color(0xff575757), + ), + overflow: TextOverflow.clip), + ), + theme: const ExpandableThemeData(crossFadePoint: 0), + ); + }, + ), ), - ), - ], + ], + ), ), ), - ), + ], ), - ], - ), - ), - bottomSheet: Container( - padding: const EdgeInsets.only(top: 16, bottom: 16, left: 21, right: 21), - color: Colors.white, - child: Row( - children: [ - Expanded( - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if(widget.itemModel.hasDiscountsApplied) Container( - margin: const EdgeInsets.only(top: 0.0), - child: Text(widget.itemModel.oldPrice.toString() + " " + TranslationBase.of(context).sar, - style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.w600, letterSpacing: -0.6, decoration: TextDecoration.lineThrough, color: CustomColors.grey2))), - Container( - margin: const EdgeInsets.only(top: 0.0), - child: Text(widget.itemModel.price.toString().trim() + " " + TranslationBase.of(context).sar, - style: TextStyle(fontSize: 19.0, fontWeight: FontWeight.bold, letterSpacing: -0.56))), - ], + ), + Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (widget.itemModel.hasDiscountsApplied) + Text(widget.itemModel.oldPrice.toString() + " " + TranslationBase.of(context).sar, + style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.w600, letterSpacing: -0.6, decoration: TextDecoration.lineThrough, color: CustomColors.grey2)), + Text(widget.itemModel.price.toString().trim() + " " + TranslationBase.of(context).sar, + style: TextStyle(fontSize: 19.0, fontWeight: FontWeight.bold, letterSpacing: -0.76, color: Color(0xff2B353E))), + ], + ), ), - ), - SizedBox(width: 8), - Expanded( - child: SizedBox( - height: 43, - width: double.infinity, - child: FlatButton( - onPressed: () { - // onCartClick(); + SizedBox(width: 8), + Expanded( + child: DefaultButton( + TranslationBase.of(context).addToCart, + () { widget.onCartClick(widget.itemModel); }, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: SvgPicture.asset("assets/images/new/add-to-cart.svg", color: Colors.white), - ), - Container( - child: Text( - TranslationBase.of(context).addToCart, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), - ), - ), - ], - ), - color: const Color(0xffD02127), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6), - ), + svgIcon: "assets/images/new/add_to_cart.svg", + isTextExpanded: false, ), ), - ), - ], - ), + ], + ).insideContainer + ], ), ), ); @@ -236,18 +222,26 @@ class OfferAndPackagesDetailState extends State { } Widget contactButton(String title) { - return SizedBox( - height: 32, - width: 80.0, - child: FlatButton( - onPressed: () {}, + return Container( + height: 34, + padding: EdgeInsets.only(left: 12, right: 12, top: 8, bottom: 9), + alignment: Alignment.center, + decoration: BoxDecoration( color: Colors.white, - shape: StadiumBorder(side: BorderSide(color: CustomColors.devider, width: 1)), - child: Text( - title, - style: TextStyle(fontSize: 10, letterSpacing: -0.4, color: CustomColors.textColor), - maxLines: 1, + border: Border.all(color: Color(0xffEAEAEA), width: 1), + borderRadius: BorderRadius.all( + Radius.circular(36.0), + ), + ), + child: Text( + title, + style: TextStyle( + fontSize: 10, + letterSpacing: -0.4, + fontWeight: FontWeight.w600, + color: Color(0xff535353), ), + maxLines: 1, ), ); } diff --git a/lib/pages/packages_offers/OfferAndPackagesCartPage.dart b/lib/pages/packages_offers/OfferAndPackagesCartPage.dart index 4b42774b..f4743d2c 100644 --- a/lib/pages/packages_offers/OfferAndPackagesCartPage.dart +++ b/lib/pages/packages_offers/OfferAndPackagesCartPage.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/ResponseModel.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/packages_offers/requests/AddProductToCartRequestModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/packages_offers/PackagesOffersViewModel.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/packages_offers/PackageOrderCompletedPage.dart'; @@ -22,7 +23,6 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; dynamic languageID; const _columnCount = 1; @@ -115,195 +115,122 @@ class _PackagesCartPageState extends State with AfterLayoutMix ? Column( children: [ Expanded( - child: StaggeredGridView.countBuilder( - crossAxisCount: (_columnCount * _columnCount), - itemCount: viewModel.cartItemList.length, - itemBuilder: (BuildContext context, int index) { - var item = viewModel.cartItemList[index]; - return Dismissible( - key: Key(index.toString()), - direction: DismissDirection.startToEnd, - background: _cartItemDeleteContainer(), - secondaryBackground: _cartItemDeleteContainer(), - confirmDismiss: (direction) async { - bool status = await viewModel.service.deleteProductFromCart(item.id, context: context, showLoading: false); - return status; - }, - onDismissed: (direction) { - viewModel.cartItemList.removeAt(index); + child: ListView.separated( + padding: EdgeInsets.all(21), + physics: BouncingScrollPhysics(), + itemBuilder: (cxt, index) { + var item = viewModel.cartItemList[index]; + return PackagesCartItemCard( + itemModel: item, + viewModel: viewModel, + getCartItems: fetchData, + shouldStepperChangeApply: (apply, total) async { + var request = AddProductToCartRequestModel(product_id: item.productId, quantity: apply); + ResponseModel response = await viewModel.service.addProductToCart(request, context: context, showLoading: false).catchError((error) { + utils.Utils.showErrorToast(error); + }); + if (response.status) { + fetchData(); + } + return response.status ?? false; }, - child: PackagesCartItemCard( - itemModel: item, - viewModel: viewModel, - getCartItems: fetchData, - shouldStepperChangeApply: (apply, total) async { - var request = AddProductToCartRequestModel(product_id: item.productId, quantity: apply); - ResponseModel response = await viewModel.service.addProductToCart(request, context: context, showLoading: false).catchError((error) { - utils.Utils.showErrorToast(error); - }); - if (response.status) { - fetchData(); - } - return response.status ?? false; - }, - )); - }, - staggeredTileBuilder: (int index) => StaggeredTile.fit(_columnCount), - mainAxisSpacing: 0, - crossAxisSpacing: 10, - ), + ); + }, + separatorBuilder: (cxt, index) => SizedBox(height: 12), + itemCount: viewModel.cartItemList.length), ), Container( - height: 0.25, - color: Theme.of(context).primaryColor, + height: 1, + color: Color(0xffEFEFEF), ), - ], - ) - : getNoDataWidget(context), - bottomSheet: viewModel.cartItemList.length > 0 - ? Container( - padding: EdgeInsets.all(21.0), - width: double.infinity, - color: Colors.white, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Container( - margin: EdgeInsets.only(bottom: 12.0), - child: InkWell( - onTap: () => confirmSelectHospitalDialog(model.hospitals), - child: Container( - padding: EdgeInsets.all(12), - width: double.infinity, - height: 50, - decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), border: Border.all(color: CustomColors.devider), color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - getHospitalName(), - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - letterSpacing: -0.46, - ), - ), - Icon(Icons.arrow_drop_down), - ], - ), - ), - ), - ), - Container( - margin: EdgeInsets.fromLTRB(0.0, 0.0, 20.0, 0.0), - child: Text(TranslationBase.of(context).YouCanPayByTheFollowingOptions, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600)), - ), - Container( - width: MediaQuery.of(context).size.width * 0.75, - margin: EdgeInsets.fromLTRB(0.0, 8.0, 20.0, 5.0), - child: getPaymentMethods(), - ), - Container( - margin: EdgeInsets.only(top: 14.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 24.0, - width: 24.0, - child: Checkbox( - value: _agreeTerms, - onChanged: (v) { - setState(() => _agreeTerms = v); - }), - ), - Expanded( - child: Text( - TranslationBase.of(context).iAcceptTermsConditions, - style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.textColor, letterSpacing: -0.48), - ), - ), - ], - ), - ), + if (viewModel.cartItemList.length > 0) Container( + padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15), + width: double.infinity, + color: Colors.white, child: Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, children: [ - Container( - width: double.infinity, - padding: EdgeInsets.only(top: 12, bottom: 3), - child: Row( - children: [ - Expanded( - child: _getNormalText(TranslationBase.of(context).patientShareToDo), - ), - Expanded( - child: _getNormalText(TranslationBase.of(context).sar + " " + (subtotal ?? 0.0).toStringAsFixed(2), isBold: true), - ) - ], + CommonDropDownView( + TranslationBase.of(context).hospital, + getHospitalName(), + () => confirmSelectHospitalDialog(model.hospitals), + ).withBorderedContainer, + SizedBox(height: 12), + Text( + TranslationBase.of(context).YouCanPayByTheFollowingOptions, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.64, ), ), - mDivider(Colors.grey[200]), - Container( - width: double.infinity, - padding: EdgeInsets.only(top: 3, bottom: 3), - child: Row( - children: [ - Expanded( - child: _getNormalText(TranslationBase.of(context).patientTaxToDo), - ), - Expanded( - child: _getNormalText(TranslationBase.of(context).sar + ' ' + (tax ?? 0.0).toStringAsFixed(2), isBold: true), - ) - ], - ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.75, + child: getPaymentMethods(), ), - mDivider(Colors.grey[200]), - Container( - width: double.infinity, - padding: EdgeInsets.only(top: 3, bottom: 3), + Padding( + padding: EdgeInsets.only(top: 12.0, bottom: 12), child: Row( + mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded( - child: _getNormalText(TranslationBase.of(context).patientShareTotalToDo), + SizedBox( + height: 16.0, + width: 16.0, + child: Checkbox( + value: _agreeTerms, + onChanged: (v) { + setState(() => _agreeTerms = v); + }), ), + SizedBox(width: 10), Expanded( - child: _getNormalText(TranslationBase.of(context).sar + ' ' + (total ?? 0.0).toStringAsFixed(2), isBold: true, isTotal: true), - ) + child: Text( + TranslationBase.of(context).iAcceptTermsConditions, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: CustomColors.textColor, letterSpacing: -0.48), + ), + ), ], ), ), - ], - ), - ), - Container( - padding: EdgeInsets.only(top: 21, bottom: 21), - child: DefaultButton( - TranslationBase.of(context).payNow, - (_agreeTerms && _selectedHospital != null) - ? () { - Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) { - setState(() {}); - }))).then((value) { - print(value); - if (value != null) { - _selectedPaymentMethod = value; - _selectedPaymentParams = {"payment_method_system_name": "Payments.PayFort", "payment_option": value}; - onPayNowClick(); + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _amountView(TranslationBase.of(context).patientShareToDo, (subtotal ?? 0.0).toStringAsFixed(2) + " " + TranslationBase.of(context).sar, isBold: true), + mDivider(Color(0xffEFEFEF)), + _amountView(TranslationBase.of(context).patientTaxToDo, (tax ?? 0.0).toStringAsFixed(2) + " " + TranslationBase.of(context).sar, isBold: true), + mDivider(Color(0xffEFEFEF)), + _amountView(TranslationBase.of(context).patientShareTotalToDo, (total ?? 0.0).toStringAsFixed(2) + " " + TranslationBase.of(context).sar, isBold: true, isTotal: true), + ], + ), + SizedBox(height: 12), + DefaultButton( + TranslationBase.of(context).payNow, + (_agreeTerms && _selectedHospital != null) + ? () { + Navigator.push(context, FadePage(page: PaymentMethod(onSelectedMethod: (String metohd) { + setState(() {}); + }))).then((value) { + print(value); + if (value != null) { + _selectedPaymentMethod = value; + _selectedPaymentParams = {"payment_method_system_name": "Payments.PayFort", "payment_option": value}; + onPayNowClick(); + } + }); } - }); - } - : null, - color: CustomColors.green, - disabledColor: CustomColors.grey2, + : null, + color: CustomColors.green, + disabledColor: CustomColors.grey2, + ), + ], ), - ), - ], - ), + ) + ], ) - : SizedBox(), + : getNoDataWidget(context), ); }, ); @@ -407,6 +334,19 @@ class _PackagesCartPageState extends State with AfterLayoutMix // )), // ); // } +_amountView(String title, String value, {bool isBold = false, bool isTotal = false}) { + return Padding( + padding: const EdgeInsets.only(top: 10, bottom: 10), + child: Row(children: [ + Expanded( + child: _getNormalText(title), + ), + Expanded( + child: _getNormalText(value, isBold: isBold, isTotal: isTotal), + ), + ]), + ); +} _getNormalText(text, {bool isBold = false, bool isTotal = false}) { return Text( @@ -416,10 +356,10 @@ _getNormalText(text, {bool isBold = false, bool isTotal = false}) { ? isTotal ? 16 : 12 - : 10, + : 11, letterSpacing: -0.5, - color: isBold ? Colors.black : Colors.grey[700], - fontWeight: FontWeight.w600, + color: isBold ? Color(0xff2E303A) : Color(0xff575757), + fontWeight: isTotal ? FontWeight.bold : FontWeight.w600, ), ); } diff --git a/lib/pages/packages_offers/OfferAndPackagesPage.dart b/lib/pages/packages_offers/OfferAndPackagesPage.dart index d323b36d..2573204e 100644 --- a/lib/pages/packages_offers/OfferAndPackagesPage.dart +++ b/lib/pages/packages_offers/OfferAndPackagesPage.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/core/viewModels/packages_offers/PackagesOff import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h20_setting.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/packages_offers/ClinicOfferAndPackagesPage.dart'; import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackagesCartPage.dart'; @@ -19,13 +20,13 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart' as utils; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/radio_selection_dialog.dart'; import 'package:diplomaticquarterapp/widgets/offers_packages/PackagesOfferCard.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; class PackagesHomePage extends StatefulWidget { @@ -99,148 +100,88 @@ class _PackagesHomePageState extends State { appBarTitle: TranslationBase.of(context).offerAndPackages, isShowAppBar: true, isPharmacy: false, + backgroundColor: Color(0xfff7f7f7), showPharmacyCart: false, isOfferPackages: true, showOfferPackagesCart: false, isShowDecPage: false, showNewAppBar: true, showNewAppBarTitle: true, - body: SingleChildScrollView( - child: Column( - children: [ - Padding( - padding: projectViewModel.isArabic ? const EdgeInsets.only(top: 21, right: 21, bottom: 21) : const EdgeInsets.only(top: 21, left: 21, bottom: 21), - child: Column( - children: [ - inputWidget(TranslationBase.of(context).search, "", _searchTextController, isInputTypeNum: false), - SizedBox( - height: 10, - ), - InkWell( - onTap: () => showClinicSelectionList(), - child: Container( - padding: EdgeInsets.all(12), - margin: projectViewModel.isArabic ? const EdgeInsets.only(left: 21) : const EdgeInsets.only(right: 21), - width: double.infinity, - height: 65, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - border: Border.all( - color: Color(0xffefefef), - width: 1, - ), - color: Colors.white), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - selectedClinic != null ? selectedClinic.name : TranslationBase.of(context).browseOffers, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - letterSpacing: -0.46, - ), - ), - Icon(Icons.arrow_drop_down), - ], - ), - ), - ), - SizedBox( - height: 20, - ), - Container( - width: double.infinity, - height: MediaQuery.of(context).size.width * 0.8, - child: ListView.separated( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - itemCount: viewModel.bestSellerList.length, - separatorBuilder: (context, index) { - return mWidth(9.0); - }, - itemBuilder: (BuildContext context, int index) { - return PackagesItemCard( - itemModel: viewModel.bestSellerList[index], - onCartClick: onProductCartClick, - ); - }, - ), - ), - SizedBox( - height: 21, - ), - // // Best Seller Horizontal Scrollable List - Container( - width: double.infinity, - height: MediaQuery.of(context).size.width * 0.8, - child: ListView.separated( - scrollDirection: Axis.horizontal, - shrinkWrap: true, - itemCount: viewModel.latestOffersList.length, - separatorBuilder: (context, index) { - return mWidth(9.0); - }, - itemBuilder: (BuildContext context, int index) { - return PackagesItemCard( - itemModel: viewModel.latestOffersList[index], - onCartClick: onProductCartClick, - ); - }, - ), - ), - ], - ), - ), - SizedBox( - height: 50.0, - ) - ], - ), - ), - bottomSheet: Container( - color: Colors.white, - padding: const EdgeInsets.all(12.0), - child: SizedBox( - height: 43, - width: double.infinity, - child: FlatButton( - onPressed: () { - onCartClick(); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, + body: Column( + children: [ + Expanded( + child: ListView( + padding: EdgeInsets.only(top: 21, bottom: 21), + physics: BouncingScrollPhysics(), children: [ + inputWidget(TranslationBase.of(context).search, "", _searchTextController, isInputTypeNum: false), + SizedBox(height: 12), Padding( - padding: const EdgeInsets.only(left: 8.0, right: 8.0), - child: SvgPicture.asset("assets/images/new/cart.svg"), - // child: Icon( - // Icons.add_shopping_cart_rounded, - // size: 30.0, - // color: Colors.white, - // ), + padding: const EdgeInsets.only(left: 21, right: 21), + child: CommonDropDownView(TranslationBase.of(context).browseOffers, selectedClinic?.name ?? TranslationBase.of(context).selectClinic, () => showClinicSelectionList()) + .withBorderedContainer, + ), + SizedBox(height: 12), + Container( + width: double.infinity, + height: MediaQuery.of(context).size.width * 0.8, + child: ListView.separated( + scrollDirection: Axis.horizontal, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + padding: EdgeInsets.only(left: 21, right: 21), + itemCount: viewModel.bestSellerList.length, + separatorBuilder: (context, index) { + return mWidth(9.0); + }, + itemBuilder: (BuildContext context, int index) { + return PackagesItemCard( + itemModel: viewModel.bestSellerList[index], + onCartClick: onProductCartClick, + ); + }, + ), ), + SizedBox(height: 12), Container( - child: Text( - TranslationBase.of(context).myCart, - textAlign: TextAlign.center, - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.48), + width: double.infinity, + height: MediaQuery.of(context).size.width * 0.8, + child: ListView.separated( + scrollDirection: Axis.horizontal, + shrinkWrap: true, + physics: BouncingScrollPhysics(), + padding: EdgeInsets.only(left: 21, right: 21), + itemCount: viewModel.latestOffersList.length, + separatorBuilder: (context, index) { + return mWidth(9.0); + }, + itemBuilder: (BuildContext context, int index) { + return PackagesItemCard( + itemModel: viewModel.latestOffersList[index], + onCartClick: onProductCartClick, + ); + }, ), ), ], ), - color: const Color(0xffD02127), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(6), - ), ), - ), + DefaultButton( + TranslationBase.of(context).myCart, + onCartClick, + svgIcon: "assets/images/new/cart.svg", + isTextExpanded: false, + count: viewModel?.service?.customer?.shoppingCartItems?.length ?? 0, + ).insideContainer + ], ), ); }, ); } + int _selectedClinic = -1; + showClinicSelectionList() async { var clinics = viewModel.service.categoryList; if (clinics.isEmpty) { @@ -256,9 +197,10 @@ class _PackagesHomePageState extends State { context: context, child: RadioSelectionDialog( listData: list, - selectedIndex: 0, + selectedIndex: _selectedClinic, isScrollable: true, onValueSelected: (index) async { + _selectedClinic = index; selectedClinic = clinics[index]; var clinicProducts = await viewModel.service.getAllProducts(request: OffersProductsRequestModel(categoryId: selectedClinic.id), context: context, showLoading: true); if (clinicProducts.isNotEmpty) @@ -348,7 +290,7 @@ class _PackagesHomePageState extends State { {VoidCallback suffixTap, bool isEnable = true, bool hasSelection = false, int lines, bool isInputTypeNum = false}) { return Container( padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), - margin: projectViewModel.isArabic ? const EdgeInsets.only(left: 21) : const EdgeInsets.only(right: 21), + margin: const EdgeInsets.only(left: 21, right: 21), alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), diff --git a/lib/pages/pharmacies/ProductCheckTypeWidget.dart b/lib/pages/pharmacies/ProductCheckTypeWidget.dart index 46c5e7a3..d0a112c6 100644 --- a/lib/pages/pharmacies/ProductCheckTypeWidget.dart +++ b/lib/pages/pharmacies/ProductCheckTypeWidget.dart @@ -31,7 +31,8 @@ class _ProductCheckTypeWidgetState extends State { ? widget.model.wishListList[index].product.namen : widget.model.wishListList[index].product.name, productPrice: widget.model.wishListList[index].subtotal, - productRate: double.parse(widget.model.wishListList[index].subtotalVatRate), + // productRate: double.parse(widget.model.wishListList[index].subtotalVatRate), + productRate: widget.model.wishListList[index].product.approvedRatingSum.toDouble(), approvedTotalReviews:widget.model.wishListList[index].product.approvedTotalReviews, productImage: widget.model.wishListList[index].product.images[0].src, productID: widget.model.wishListList[index].product.id, diff --git a/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart b/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart index d217e3da..df44c706 100644 --- a/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart +++ b/lib/pages/pharmacies/screens/cart-page/cart-order-page.dart @@ -1,29 +1,25 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-conditions-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderItem.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; -import 'package:diplomaticquarterapp/uitl/navigation_service.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/GestureIconButton.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:http/http.dart'; import 'package:provider/provider.dart'; -import '../../../../locator.dart'; -import 'cart-order-preview.dart'; - class CartOrderPage extends StatefulWidget { final Function(int) changeTab; @@ -35,10 +31,13 @@ class CartOrderPage extends StatefulWidget { class _CartOrderPageState extends State { bool isLoading = true; + String customerId; + String customerGUID; @override void initState() { super.initState(); + getCustomer(); getData(); } @@ -64,8 +63,7 @@ class _CartOrderPageState extends State { body: NetworkBaseView( isLoading: isLoading, isLocalLoader: true, - child: !(model.cartResponse.shoppingCarts == null || - model.cartResponse.shoppingCarts.length == 0) + child: !(model.cartResponse.shoppingCarts == null || model.cartResponse.shoppingCarts.length == 0) ? Container( height: height * 0.85, width: double.infinity, @@ -92,18 +90,17 @@ class _CartOrderPageState extends State { ), Container( child: ListView.builder( - itemCount: - model.cartResponse.shoppingCarts.length, + itemCount: model.cartResponse.shoppingCarts.length, scrollDirection: Axis.vertical, shrinkWrap: true, - physics: const AlwaysScrollableScrollPhysics(), + physics: ScrollPhysics(), + // physics: const AlwaysScrollableScrollPhysics(), itemBuilder: (context, index) { return ProductOrderItem( item: model.cartResponse.shoppingCarts[index], changeCartItems: () async { GifLoaderDialogUtils.showMyDialog(context); - await model.changeProductQuantity(model - .cartResponse.shoppingCarts[index]); + await model.changeProductQuantity(model.cartResponse.shoppingCarts[index]); if (model.state != ViewState.Error) {} if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); @@ -112,10 +109,7 @@ class _CartOrderPageState extends State { }, deleteCartItems: () async { GifLoaderDialogUtils.showMyDialog(context); - await model - .deleteProduct(model - .cartResponse.shoppingCarts[index]) - .then((value) { + await model.deleteProduct(model.cartResponse.shoppingCarts[index]).then((value) { if (model.state == ViewState.ErrorLocal) { Utils.showErrorToast(model.error); } @@ -236,28 +230,47 @@ class _CartOrderPageState extends State { padding: const EdgeInsets.all(8.0), child: Text( TranslationBase.of(context).noData, -// 'There is no data', style: TextStyle(fontSize: 30), ), - ) + ), + Padding( + padding: const EdgeInsets.fromLTRB(60.0, 8.0, 60.0, 0.0), + child: DefaultButton( + TranslationBase.of(context).ordersDashboard, + () { + Navigator.push(context, FadePage(page: OrderPage(customerID: customerId, customerGUID: customerGUID))); + }, + color: Colors.green, + ), + ), ], ), ), ), bottomSheet: Container( - height: !(model.cartResponse.shoppingCarts == null || - model.cartResponse.shoppingCarts.length == 0) - ? height * 0.15 - : 0, + height: !(model.cartResponse.shoppingCarts == null || model.cartResponse.shoppingCarts.length == 0) ? height * 0.15 : 0, color: Colors.white, child: OrderBottomWidget(model.addresses, height, model, isLoading), ), ); } + getCustomer() async { + String custID; + String custGUID; + custID = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + custGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID); + setState(() { + customerId = custID; + customerGUID = custGUID; + }); + print("customer Id is" + customerId); + print("customer GUID is" + customerGUID); + return customerId; + } + void getData() async { - await Provider.of(context, listen: false) - .getShoppingCart(); + await Provider.of(context, listen: false).getShoppingCart(); setState(() { isLoading = false; }); @@ -283,9 +296,7 @@ class _OrderBottomWidgetState extends State { Widget build(BuildContext context) { ProjectViewModel projectProvider = Provider.of(context); - return !widget.isLoading && - !(widget.model.cartResponse.shoppingCarts == null || - widget.model.cartResponse.shoppingCarts.length == 0) + return !widget.isLoading && !(widget.model.cartResponse.shoppingCarts == null || widget.model.cartResponse.shoppingCarts.length == 0) ? Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -332,8 +343,7 @@ class _OrderBottomWidgetState extends State { padding: EdgeInsets.symmetric(horizontal: 4), margin: const EdgeInsets.symmetric(vertical: 4), child: Texts( - TranslationBase.of(context) - .pharmacyServiceTermsCondition, + TranslationBase.of(context).pharmacyServiceTermsCondition, fontSize: 13, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -341,10 +351,7 @@ class _OrderBottomWidgetState extends State { ), ), InkWell( - onTap: () => { - Navigator.push( - context, FadePage(page: PharmacyTermsConditions())) - }, + onTap: () => {Navigator.push(context, FadePage(page: PharmacyTermsConditions()))}, child: Container( child: Icon( Icons.info, @@ -370,8 +377,7 @@ class _OrderBottomWidgetState extends State { mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - margin: EdgeInsets.symmetric( - horizontal: 0, vertical: 0), + margin: EdgeInsets.symmetric(horizontal: 0, vertical: 0), child: Row( children: [ Texts( @@ -380,8 +386,7 @@ class _OrderBottomWidgetState extends State { fontWeight: FontWeight.bold, ), Padding( - padding: - const EdgeInsets.symmetric(horizontal: 4), + padding: const EdgeInsets.symmetric(horizontal: 4), child: Texts( "${TranslationBase.of(context).inclusiveVat}", fontSize: 8, @@ -403,33 +408,16 @@ class _OrderBottomWidgetState extends State { ), RaisedButton( onPressed: isAgree -// && cart.cartResponse.shoppingCarts[1].product.stockQuantity ==0 ? () => { if (widget.model.isCartItemsOutOfStock()) - { - // Toast msg - AppToast.showErrorToast( - message: TranslationBase.of(context) - .outOfStockMsg) - } + {AppToast.showErrorToast(message: TranslationBase.of(context).outOfStockMsg)} else - { - _navigateToAddressPage(widget - .model.user.patientIdentificationNo) - // Navigator.push( - // context, - // FadePage( - // page: - // OrderPreviewPage(widget.addresses))) - } + {_navigateToAddressPage(widget.model.user.patientIdentificationNo)} } : null, child: new Text( "${TranslationBase.of(context).checkOut}", - style: new TextStyle( - color: - isAgree ? Colors.white : Colors.grey.shade300, - fontSize: 14), + style: new TextStyle(color: isAgree ? Colors.white : Colors.grey.shade300, fontSize: 14), ), color: Color(0xFF4CAF50), disabledColor: Color(0xFF848484), @@ -453,8 +441,7 @@ class _OrderBottomWidgetState extends State { if (result != null) { GifLoaderDialogUtils.showMyDialog(context); var address = result; - widget.model.paymentCheckoutData.address = - Addresses.fromJson(address.toJson()); + widget.model.paymentCheckoutData.address = Addresses.fromJson(address.toJson()); await widget.model.getInformationsByAddress(identificationNo); await widget.model.getShoppingCart(); // widget.changeMainState(); diff --git a/lib/pages/pharmacies/screens/cart-page/lakum_widget.dart b/lib/pages/pharmacies/screens/cart-page/lakum_widget.dart index cdd26ddc..5d48fe1f 100644 --- a/lib/pages/pharmacies/screens/cart-page/lakum_widget.dart +++ b/lib/pages/pharmacies/screens/cart-page/lakum_widget.dart @@ -1,24 +1,8 @@ -import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/Addresses.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/payment-checkout-data.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; -import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/payment_bottom_widget.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/payment-method-select-page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductOrderPreviewItem.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; -import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -33,39 +17,42 @@ class LakumWidget extends StatefulWidget { class _LakumWidgetState extends State { TextEditingController _pointsController = new TextEditingController(); + bool useLakumWidgets = false; @override Widget build(BuildContext context) { ProjectViewModel projectProvider = Provider.of(context); + _pointsController.text = widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString(); return Container( color: Colors.white, padding: EdgeInsets.symmetric(vertical: 12, horizontal: 12), child: Row( children: [ - Image.asset( - "assets/images/pharmacy_module/lakum/lakum_checkout.png", - width: 30.0, - fit: BoxFit.scaleDown, - ), - Container( - decoration: BoxDecoration(color: Color(0x99ffffff)), - padding: const EdgeInsets.symmetric(horizontal: 8), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - "${TranslationBase.of(context).lakumPoints}", - fontSize: 12, - fontWeight: FontWeight.bold, - ), - Texts( - "${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount}", - fontSize: 12, - fontWeight: FontWeight.normal, + Row( + children: [ + SizedBox( + height: 24.0, + width: 24.0, + child: Checkbox( + activeColor: CustomColors.green, + value: useLakumWidgets, + onChanged: (bool value) { + setState(() { + useLakumWidgets = value; + print(useLakumWidgets); + }); + }, ), - ], - ), + ), + Padding( + padding: const EdgeInsets.only(left: 8.0, right: 8.0), + child: Text( + TranslationBase.of(context).useLakumPoints + + " (${widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalance.toString() + " " + TranslationBase.of(context).points})", + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56)), + ), + ], ), Expanded( child: Container( @@ -74,110 +61,93 @@ class _LakumWidgetState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - Texts( - "${TranslationBase.of(context).riyal}", - fontSize: 12, - fontWeight: FontWeight.bold, - ), Container( - margin: projectProvider.isArabic - ? EdgeInsets.only(right: 4) - : EdgeInsets.only(left: 4), - width: 60, - height: 50, - child: TextField( - decoration: InputDecoration( - border: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.black, width: 0.2), - gapPadding: 0, - borderRadius: projectProvider.isArabic - ? BorderRadius.only( - topRight: Radius.circular(8), - bottomRight: Radius.circular(8)) - : BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8)), + decoration: BoxDecoration(color: Color(0x99ffffff)), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + "${TranslationBase.of(context).availableBalance}", + fontSize: 12, + fontWeight: FontWeight.bold, ), - disabledBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.black, width: 0.4), - gapPadding: 0, - borderRadius: BorderRadius.only( - topLeft: Radius.circular(8), - bottomLeft: Radius.circular(8)), + Text( + "${TranslationBase.of(context).sar + " " + widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount.toString()}", + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.56) ), - ), - controller: _pointsController, - keyboardType: TextInputType.number, - style: TextStyle( - fontSize: 14, - color: widget - .model - .paymentCheckoutData - .lacumInformation - .lakumInquiryInformationObjVersion - .pointsBalanceAmount > - 0 - ? Colors.black - : Colors.grey, - ), - enabled: widget - .model - .paymentCheckoutData - .lacumInformation - .lakumInquiryInformationObjVersion - .pointsBalanceAmount == - 0 - ? false - : true, - onChanged: (val) { - var value = int.tryParse(val); - if (value != null && - value <= - widget - .model - .paymentCheckoutData - .lacumInformation - .lakumInquiryInformationObjVersion - .pointsBalanceAmount) { - widget.model.paymentCheckoutData.usedLakumPoints = - value; - } else { - widget.model.paymentCheckoutData.usedLakumPoints = 0; - } - _pointsController.text = - "${widget.model.paymentCheckoutData.usedLakumPoints}"; - }, - ), - ), - Container( - height: 50, - padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12), - decoration: new BoxDecoration( - color: Color(0xff3666E0), - shape: BoxShape.rectangle, - borderRadius: projectProvider.isArabic - ? BorderRadius.only( - topLeft: Radius.circular(6), - bottomLeft: Radius.circular(6)) - : BorderRadius.only( - topRight: Radius.circular(6), - bottomRight: Radius.circular(6)), - border: Border.fromBorderSide(BorderSide( - color: Color(0xff3666E0), - width: 0.8, - )), - ), - child: Texts( - "${TranslationBase.of(context).use}", - fontSize: 12, - color: Colors.white, - fontWeight: FontWeight.bold, + ], ), ), ], ), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // Texts( + // "${TranslationBase.of(context).riyal}", + // fontSize: 12, + // fontWeight: FontWeight.bold, + // ), + // Container( + // margin: projectProvider.isArabic ? EdgeInsets.only(right: 4) : EdgeInsets.only(left: 4), + // width: 60, + // height: 50, + // child: TextField( + // decoration: InputDecoration( + // border: OutlineInputBorder( + // borderSide: BorderSide(color: Colors.black, width: 0.2), + // gapPadding: 0, + // borderRadius: projectProvider.isArabic + // ? BorderRadius.only(topRight: Radius.circular(8), bottomRight: Radius.circular(8)) + // : BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)), + // ), + // disabledBorder: OutlineInputBorder( + // borderSide: BorderSide(color: Colors.black, width: 0.4), + // gapPadding: 0, + // borderRadius: BorderRadius.only(topLeft: Radius.circular(8), bottomLeft: Radius.circular(8)), + // ), + // ), + // controller: _pointsController, + // keyboardType: TextInputType.number, + // style: TextStyle( + // fontSize: 14, + // color: widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount > 0 ? Colors.black : Colors.grey, + // ), + // enabled: widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount == 0 ? false : true, + // onChanged: (val) { + // var value = int.tryParse(val); + // if (value != null && value <= widget.model.paymentCheckoutData.lacumInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount) { + // widget.model.paymentCheckoutData.usedLakumPoints = value; + // } else { + // widget.model.paymentCheckoutData.usedLakumPoints = 0; + // } + // _pointsController.text = "${widget.model.paymentCheckoutData.usedLakumPoints}"; + // }, + // ), + // ), + // Container( + // height: 50, + // padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12), + // decoration: new BoxDecoration( + // color: Color(0xff3666E0), + // shape: BoxShape.rectangle, + // borderRadius: projectProvider.isArabic + // ? BorderRadius.only(topLeft: Radius.circular(6), bottomLeft: Radius.circular(6)) + // : BorderRadius.only(topRight: Radius.circular(6), bottomRight: Radius.circular(6)), + // border: Border.fromBorderSide(BorderSide( + // color: Color(0xff3666E0), + // width: 0.8, + // )), + // ), + // child: Texts( + // "${TranslationBase.of(context).use}", + // fontSize: 12, + // color: Colors.white, + // fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), ), ), ], diff --git a/lib/pages/pharmacies/screens/lakum-main-page.dart b/lib/pages/pharmacies/screens/lakum-main-page.dart index c4415852..bac0ecc2 100644 --- a/lib/pages/pharmacies/screens/lakum-main-page.dart +++ b/lib/pages/pharmacies/screens/lakum-main-page.dart @@ -69,16 +69,15 @@ class LakumMainPage extends StatelessWidget { ], ), SizedBox( - width: 8, + height: 12, ), - LacumPointsWidget(mediaQuery, 2, TranslationBase.of(context).gained, model.lacumGroupInformation.lakumInquiryInformationObjVersion.pointsBalanceAmount, - model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPoints, model.lacumGroupInformation.lakumInquiryInformationObjVersion.gainedPointsAmountPerYear), + LakumHomeButtons(mediaQuery, model), SizedBox( - height: 20, + height: 12, ), Container( - height: 125, - margin: EdgeInsets.symmetric(horizontal: 16), + height: 100, + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 12.0), child: ListView( scrollDirection: Axis.horizontal, children: [ @@ -109,15 +108,15 @@ class LakumMainPage extends StatelessWidget { ], ), ), - LacumPointsWidget( - mediaQuery, - 3, - TranslationBase.of(context).consumed, - model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null - ? int.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount) - : 0, - model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints, - model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear), + // LacumPointsWidget( + // mediaQuery, + // 3, + // TranslationBase.of(context).consumed, + // model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount != null + // ? int.parse(model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmount) + // : 0, + // model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPoints, + // model.lacumGroupInformation.lakumInquiryInformationObjVersion.consumedPointsAmountPerYear), SizedBox( width: 8, ), @@ -371,8 +370,8 @@ class LacumPointsWidget extends StatelessWidget { final MediaQueryData mediaQuery; final int pointType; // 1. balance, 2. gained, 3. consume, 4. transfer final String title; - final int riyal; - final int point; + final num riyal; + final num point; Color titleColor; final List pointsAmountPerYear; @@ -403,7 +402,7 @@ class LacumPointsWidget extends StatelessWidget { }, child: Container( width: mediaQuery.size.width / 2 - 25, - padding: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 2), + padding: EdgeInsets.only(top: 12, left: 8, right: 8, bottom: 8), decoration: BoxDecoration( shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(8), @@ -411,13 +410,13 @@ class LacumPointsWidget extends StatelessWidget { color: Color(0xffe1e1e1), width: 0.4, )), - color: pointType == 1 ? Color(0xff004bcc) : Color(0xffefefef), + color: pointType == 1 ? Colors.green : Color(0xffefefef), ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded( + Container( + margin: EdgeInsets.only(bottom: 10.0), child: Column( children: [ Row( @@ -443,15 +442,15 @@ class LacumPointsWidget extends StatelessWidget { ), Expanded( child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ if (pointType != 4) Expanded( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).RIYAL, -// "RIYAL", + TranslationBase.of(context).sar, fontSize: 13, fontWeight: FontWeight.bold, color: pointType == 1 ? Colors.white : Colors.black, @@ -479,11 +478,10 @@ class LacumPointsWidget extends StatelessWidget { child: Container( margin: EdgeInsets.only(left: 8, right: 8), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, children: [ Texts( - TranslationBase.of(context).point, -// "POINT", + TranslationBase.of(context).points, fontSize: 12, fontWeight: FontWeight.bold, color: pointType == 1 ? Colors.white : Colors.black, diff --git a/lib/pages/pharmacies/screens/payment-method-select-page.dart b/lib/pages/pharmacies/screens/payment-method-select-page.dart index 978afae3..53b0357e 100644 --- a/lib/pages/pharmacies/screens/payment-method-select-page.dart +++ b/lib/pages/pharmacies/screens/payment-method-select-page.dart @@ -16,13 +16,10 @@ class PaymentMethodSelectPage extends StatefulWidget { final bool isUpdating; final Function changeMainState; - const PaymentMethodSelectPage( - {Key key, this.model, this.isUpdating = false, this.changeMainState}) - : super(key: key); + const PaymentMethodSelectPage({Key key, this.model, this.isUpdating = false, this.changeMainState}) : super(key: key); @override - _PaymentMethodSelectPageState createState() => - _PaymentMethodSelectPageState(); + _PaymentMethodSelectPageState createState() => _PaymentMethodSelectPageState(); } class _PaymentMethodSelectPageState extends State { @@ -85,16 +82,17 @@ class _PaymentMethodSelectPageState extends State { selectedPaymentOption = PaymentOption.mastercard; }) }), - PaymentMethodCard( - cardWidth, - selectedPaymentOption, - PaymentOption.installments, - () => { - setState(() { - selectedPaymentOption = - PaymentOption.installments; - }) - }), + widget.model.cartResponse.totalAmount > 1000 + ? PaymentMethodCard( + cardWidth, + selectedPaymentOption, + PaymentOption.installments, + () => { + setState(() { + selectedPaymentOption = PaymentOption.installments; + }) + }) + : Container(), if (Platform.isIOS) PaymentMethodCard( cardWidth, @@ -118,8 +116,7 @@ class _PaymentMethodSelectPageState extends State { TranslationBase.of(context).next, selectedPaymentOption != null ? () { - widget.model.paymentCheckoutData.paymentOption = - selectedPaymentOption; + widget.model.paymentCheckoutData.paymentOption = selectedPaymentOption; if (widget.isUpdating) { widget.changeMainState(); Navigator.pop(context); @@ -150,14 +147,12 @@ class PaymentMethodCard extends StatelessWidget { final PaymentOption paymentOption; final Function selectMethod; - PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, - this.paymentOption, this.selectMethod); + PaymentMethodCard(this.cardWidth, this.selectedPaymentOption, this.paymentOption, this.selectMethod); @override Widget build(BuildContext context) { bool isSelected = false; - if (selectedPaymentOption != null && - selectedPaymentOption == paymentOption) { + if (selectedPaymentOption != null && selectedPaymentOption == paymentOption) { isSelected = true; } @@ -171,9 +166,7 @@ class PaymentMethodCard extends StatelessWidget { color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), - side: isSelected - ? BorderSide(color: Colors.green, width: 2.0) - : BorderSide(color: Colors.transparent, width: 0.0), + side: isSelected ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), ), child: Padding( padding: const EdgeInsets.all(12.0), @@ -182,13 +175,7 @@ class PaymentMethodCard extends StatelessWidget { Container( width: 24, height: 24, - decoration: containerColorRadiusBorderWidth( - isSelected - ? CustomColors.accentColor - : Colors.transparent, - 100, - Colors.grey, - 0.5), + decoration: containerColorRadiusBorderWidth(isSelected ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5), ), mWidth(12), Container( @@ -200,8 +187,7 @@ class PaymentMethodCard extends StatelessWidget { if (isSelected) Container( decoration: containerRadius(CustomColors.green, 200), - padding: - EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), + padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), child: Text( TranslationBase.of(context).paymentSelected, style: TextStyle( diff --git a/lib/pages/pharmacies/screens/product-details/availability_info.dart b/lib/pages/pharmacies/screens/product-details/availability_info.dart index 13e94c87..2c10c8bf 100644 --- a/lib/pages/pharmacies/screens/product-details/availability_info.dart +++ b/lib/pages/pharmacies/screens/product-details/availability_info.dart @@ -1,6 +1,8 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:maps_launcher/maps_launcher.dart'; +import 'package:url_launcher/url_launcher.dart'; class AvailabilityInfo extends StatelessWidget { final ProductDetailViewModel previousModel; @@ -49,7 +51,9 @@ class AvailabilityInfo extends StatelessWidget { child: IconButton( icon: Icon(Icons.location_on), color: Colors.red, - onPressed: () {}, + onPressed: () { + MapsLauncher.launchCoordinates(double.parse(previousModel.productLocationService[index].latitude), double.parse(previousModel.productLocationService[index].latitude), previousModel.productLocationService[index].locationDescription); + }, ), ), Expanded( @@ -57,7 +61,9 @@ class AvailabilityInfo extends StatelessWidget { child: IconButton( icon: Icon(Icons.phone), color: Colors.red, - onPressed: () {}, + onPressed: () { + launch("tel://" + previousModel.productLocationService[index].phoneNumber); + }, ), ), ], diff --git a/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart b/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart index 644ab693..2d9a3489 100644 --- a/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart +++ b/lib/pages/pharmacies/screens/product-details/footor/footer-widget.dart @@ -1,11 +1,15 @@ +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-page/cart-order-page.dart'; +import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/footor/quantity_box.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import '../../../../../locator.dart'; @@ -35,6 +39,7 @@ class _FooterWidgetState extends State { double quantityUI = 80; bool showUI = false; AuthenticatedUserObject authenticatedUserObject = locator(); + AppSharedPreferences sharedPref = new AppSharedPreferences(); @override Widget build(BuildContext context) { @@ -182,9 +187,7 @@ class _FooterWidgetState extends State { disabled: (!widget.isAvailable && widget.quantity > 0) || widget.quantity > widget.quantityLimit || widget.item.isRx, onTap: () async { if (!authenticatedUserObject.isLogin) { - Navigator.of(context).pushNamed( - WELCOME_LOGIN, - ); + login(); } else await widget.addToCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model); }, @@ -204,12 +207,9 @@ class _FooterWidgetState extends State { disabled: (!widget.isAvailable && widget.quantity > 0) || (widget.quantity > widget.quantityLimit) || widget.item.isRx, onTap: () async { if (!authenticatedUserObject.isLogin) { - Navigator.of(context).pushNamed( - WELCOME_LOGIN, - ); + login(); } else { await widget.addToShoppingCartFunction(quantity: widget.quantity, itemID: widget.item.id, model: widget.model); - } }, fontWeight: FontWeight.w600, @@ -227,6 +227,37 @@ class _FooterWidgetState extends State { ); } + void setUserValues(value) async { + if (value != null) sharedPref.setObject(IMEI_USER_DATA, value); + } + + login() async { + final authService = new AuthProvider(); + var data = await sharedPref.getObject(IMEI_USER_DATA); + sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); + if (data != null) { + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + GifLoaderDialogUtils.showMyDialog(context); + authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { + GifLoaderDialogUtils.hideDialog(context); + if (value != null) { + setUserValues(value); + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + }); + } + } + onChangeValue(int i) { setState(() { widget.quantity = i; diff --git a/lib/pages/pharmacies/screens/product-details/product-detail.dart b/lib/pages/pharmacies/screens/product-details/product-detail.dart index ad802349..c414e61e 100644 --- a/lib/pages/pharmacies/screens/product-details/product-detail.dart +++ b/lib/pages/pharmacies/screens/product-details/product-detail.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; @@ -5,7 +6,6 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_deta import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/product-name-and-price.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/recommended_products.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/reviews_info.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/product-details/shared/custom-divider.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -185,7 +185,8 @@ class __ProductDetailPageState extends State { ), Container( // width: 500, - margin: EdgeInsets.only(bottom: 6), + margin: EdgeInsets.only(bottom: 10), + padding: EdgeInsets.only(bottom: 10), color: Colors.white, child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -251,17 +252,19 @@ class __ProductDetailPageState extends State { Column( children: [ FlatButton( - onPressed: () async { - GifLoaderDialogUtils.showMyDialog(context); - await model.getProductLocationData(widget.product.sku); - GifLoaderDialogUtils.hideDialog(context); - - setState(() { - isDetails = false; - isReviews = false; - isAvailability = true; - }); - }, + onPressed: model.isStockAvailable + ? () async { + GifLoaderDialogUtils.showMyDialog(context); + await model.getProductLocationData(widget.product.sku); + GifLoaderDialogUtils.hideDialog(context); +// + setState(() { + isDetails = false; + isReviews = false; + isAvailability = true; + }); + } + : null, child: Text( TranslationBase.of(context).availability, style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), @@ -287,28 +290,36 @@ class __ProductDetailPageState extends State { product: widget.product, previousModel: model, ) - : isAvailability - ? AvailabilityInfo( - previousModel: model, - ) - : Container(), + : isAvailability && widget.product.stockAvailability != "Out of stock" + ? AvailabilityInfo(previousModel: model) + : isAvailability && widget.product.stockAvailability == "Out of stock" + ? Container( + // padding: EdgeInsets.all(15), + padding: EdgeInsets.fromLTRB(15, 15, 15, 20), + margin: EdgeInsets.only(bottom: 20), + alignment: Alignment.center, + child: Text( + TranslationBase.of(context).noLocationAvailable, + ), + ) + : Container(), ], ), ), SizedBox( height: 10, ), - if (projectViewModel.isLogin) - RecommendedProducts( - product: widget.product, - productDetailViewModel: model, - addToWishlistFunction: (itemID) async { - await addToWishlistFunction(itemID: itemID, model: model); - }, - deleteFromWishlistFunction: (itemID) async { - await deleteFromWishlistFunction(itemID: itemID, model: model); - }, - ) +// if (projectViewModel.isLogin) +// RecommendedProducts( +// product: widget.product, +// productDetailViewModel: model, +// addToWishlistFunction: (itemID) async { +// await addToWishlistFunction(itemID: itemID, model: model); +// }, +// deleteFromWishlistFunction: (itemID) async { +// await deleteFromWishlistFunction(itemID: itemID, model: model); +// }, +// ) ], ), ), @@ -358,8 +369,9 @@ class __ProductDetailPageState extends State { await model.addToCartData(quantity, itemID, context); GifLoaderDialogUtils.hideDialog(context); } -} -notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model, context}) async { - await model.notifyMe(customerId, itemId, context); + notifyMeWhenAvailable({itemId, customerId, ProductDetailViewModel model}) async { + await model.notifyMe(customerId, itemId); + } + } diff --git a/lib/pages/pharmacies/screens/product-details/reviews_info.dart b/lib/pages/pharmacies/screens/product-details/reviews_info.dart index 64336d85..e3050927 100644 --- a/lib/pages/pharmacies/screens/product-details/reviews_info.dart +++ b/lib/pages/pharmacies/screens/product-details/reviews_info.dart @@ -30,15 +30,21 @@ class ReviewsInfo extends StatelessWidget { Container( child: Row( children: [ - Container( - child: Text( - previousModel.productDetailService[0] - .reviews[index].customerId - .toString(), - style: TextStyle( - fontSize: 17, - color: Colors.grey, - fontWeight: FontWeight.w600), + Expanded( + child: Container( + child: Text(previousModel.productDetailService[0].reviews[index].customer.firstName != null + && previousModel.productDetailService[0].reviews[index].customer.firstName != null + ? previousModel.productDetailService[0].reviews[index].customer.firstName.toString() + " " + + previousModel.productDetailService[0].reviews[index].customer.lastName.toString() + :"", +// previousModel.productDetailService[0] +// .reviews[index].customerId +// .toString(), + style: TextStyle( + fontSize: 17, + color: Colors.grey, + fontWeight: FontWeight.w600), + ), ), ), Container( @@ -79,7 +85,8 @@ class ReviewsInfo extends StatelessWidget { }, ) : Container( - padding: EdgeInsets.all(15), + padding: EdgeInsets.fromLTRB(15,15,15,20), + margin: EdgeInsets.only(bottom: 20), alignment: Alignment.center, child: Text( TranslationBase.of(context).noReviewsAvailable, diff --git a/lib/pages/pharmacies/widgets/lacum-banner-widget.dart b/lib/pages/pharmacies/widgets/lacum-banner-widget.dart index 7d10b886..60ca4693 100644 --- a/lib/pages/pharmacies/widgets/lacum-banner-widget.dart +++ b/lib/pages/pharmacies/widgets/lacum-banner-widget.dart @@ -229,13 +229,15 @@ class _LakumBannerWidgetState extends State { width: widget.mediaQuery.size.width * 1.0, height: widget.mediaQuery.size.width * 1.0, ), - Container( - margin: EdgeInsets.fromLTRB(12, 70, 12, 4), - child: widget.model.convertBase64ToBarCodeImage() != - null - ? Image.memory( - widget.model.convertBase64ToBarCodeImage()) - : Container(), + Center( + child: Container( + margin: EdgeInsets.fromLTRB(12, 70, 12, 4), + child: widget.model.convertBase64ToBarCodeImage() != + null + ? Image.memory( + widget.model.convertBase64ToBarCodeImage()) + : Container(), + ), ), ], ), diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart index d1afd5a8..9eda1004 100644 --- a/lib/pages/pharmacy/order/Order.dart +++ b/lib/pages/pharmacy/order/Order.dart @@ -217,12 +217,10 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), Container( margin: EdgeInsets.all(8.0), - child: SvgPicture.asset( - projectViewModel.isArabic - ? 'assets/images/pharmacy/arrow_left.svg' - : 'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20, + child: Icon( + Icons.arrow_forward, + size: 18, + color: Colors.grey[500], ), ), ], @@ -246,11 +244,11 @@ class _OrderPageState extends State with SingleTickerProviderStateMix left: 13.0, right: 13.0), decoration: BoxDecoration( border: Border.all( - color: Colors.blue[700], + color: Color(0xFF4CAF50), style: BorderStyle.solid, width: 5.0, ), - color: Colors.blue[700], + color: Color(0xFF4CAF50), borderRadius: BorderRadius.circular( 30.0)), child: deliveredOrderList[ @@ -503,12 +501,10 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), Container( margin: EdgeInsets.all(8.0), - child: SvgPicture.asset( - projectViewModel.isArabic - ? 'assets/images/pharmacy/arrow_left.svg' - : 'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20, + child: Icon( + Icons.arrow_forward, + size: 18, + color: Colors.grey[500], ), ), ], @@ -532,11 +528,11 @@ class _OrderPageState extends State with SingleTickerProviderStateMix left: 13.0, right: 13.0), decoration: BoxDecoration( border: Border.all( - color: Colors.green, + color: Colors.grey[500], style: BorderStyle.solid, width: 5.0, ), - color: Colors.green, + color: Colors.grey[500], borderRadius: BorderRadius.circular( 30.0)), child: processingOrderList[ @@ -863,6 +859,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix pendingOrderList.add(model.orders[i]); } } + _tabController.animateTo(2); return Container( child: pendingOrderList.length != 0 ? SingleChildScrollView( @@ -969,12 +966,10 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), Container( margin: EdgeInsets.all(8.0), - child: SvgPicture.asset( - projectViewModel.isArabic - ? 'assets/images/pharmacy/arrow_left.svg' - : 'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20, + child: Icon( + Icons.arrow_forward, + size: 18, + color: Colors.grey[500], ), ), ], @@ -1139,7 +1134,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix cancelledOrderList.clear(); for (int i = 0; i < model.orders.length; i++) { if (model.orders[i].orderStatusId == 40 || - model.orders[i].orderStatus == 996 || + model.orders[i].orderStatusId == 996 || model.orders[i].orderStatusId == 200) { cancelledOrderList.add(model.orders[i]); } @@ -1243,12 +1238,10 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ), Container( margin: EdgeInsets.all(8.0), - child: SvgPicture.asset( - projectViewModel.isArabic - ? 'assets/images/pharmacy/arrow_left.svg' - : 'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20, + child: Icon( + Icons.arrow_forward, + size: 18, + color: Colors.grey[500], ), ), ], diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart index eb08584a..035c516c 100644 --- a/lib/pages/pharmacy/order/OrderDetails.dart +++ b/lib/pages/pharmacy/order/OrderDetails.dart @@ -604,9 +604,9 @@ class _OrderDetailsPageState extends State { print(widget.orderModel.orderStatusId); // if(orderStatus == 'delivered') if (widget.orderModel.orderStatusId == 30 || widget.orderModel.orderStatusId == 997 || widget.orderModel.orderStatusId == 994) - return Colors.blue[700]; + return Color(0xFF4CAF50); else if (widget.orderModel.orderStatusId == 20 || widget.orderModel.orderStatusId == 995 || widget.orderModel.orderStatusId == 998 || widget.orderModel.orderStatusId == 999) - return Colors.green; + return Colors.grey[500]; else if (widget.orderModel.orderStatusId == 10) return Colors.orange[300]; else if (widget.orderModel.orderStatusId == 40 || widget.orderModel.orderStatusId == 996 || widget.orderModel.orderStatusId == 200) return Colors.red[900]; diff --git a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart index 514ea1a5..5e55d537 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/AddAddress.dart @@ -62,7 +62,7 @@ class _AddAddressPageState extends State { return BaseView( builder: (_, model, wi) => AppScaffold( appBarTitle: TranslationBase.of(context).changeAddress, - isShowAppBar: true, + isShowAppBar: false, isPharmacy: true, backgroundColor: Colors.white, body: Container( diff --git a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart index 21bb77eb..a38104b9 100644 --- a/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart +++ b/lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart @@ -126,11 +126,16 @@ class _PharmacyAddressesState extends State { GifLoaderDialogUtils.showMyDialog(context); await widget.orderPreviewViewModel.getInformationsByAddress(widget.orderPreviewViewModel.user.patientIdentificationNo); - await widget.orderPreviewViewModel.getShoppingCart(); - // widget.changeMainState(); - GifLoaderDialogUtils.hideDialog(context); - model.saveSelectedAddressLocally(model.addresses[model.selectedAddressIndex]); - _navigateToPaymentOption(model); + if (widget.orderPreviewViewModel.error == "") { + await widget.orderPreviewViewModel.getShoppingCart(); + GifLoaderDialogUtils.hideDialog(context); + model.saveSelectedAddressLocally(model.addresses[model.selectedAddressIndex]); + _navigateToPaymentOption(model); + } else { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: widget.orderPreviewViewModel.error); + return; + } }, ), ), diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index 74f4662d..1f2520b6 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -18,7 +18,6 @@ import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; @@ -84,8 +83,6 @@ class _ProfilePageState extends State { ); } } - -// this.isLogin = user != null; } void initState() { @@ -101,511 +98,512 @@ class _ProfilePageState extends State { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) async { - // var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); - // var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID); - // GifLoaderDialogUtils.showMyDialog(context); - // model.getOrder(customerId, customerGUID, page_id); - // GifLoaderDialogUtils.hideDialog(context); - }, - builder: (_, model, wi) => AppScaffold( - appBarTitle: TranslationBase.of(context).myAccount, - isShowAppBar: true, - isShowDecPage: true, - isPharmacy: true, + onModelReady: (model) async { + // var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID); + // var customerGUID = await sharedPref.getObject(PHARMACY_CUSTOMER_GUID); + // GifLoaderDialogUtils.showMyDialog(context); + // model.getOrder(customerId, customerGUID, page_id); + // GifLoaderDialogUtils.hideDialog(context); + }, + builder: (_, model, wi) => AppScaffold( + appBarTitle: TranslationBase.of(context).myAccount, + isShowAppBar: true, + isShowDecPage: true, + isPharmacy: true, - //isBottomBar: true, - isMainPharmacyPages: true, - body: user != null - ? Container( - color: Colors.white, - child: SingleChildScrollView( - child: Column( + //isBottomBar: true, + isMainPharmacyPages: true, + body: user != null + ? Container( + color: Colors.white, + child: SingleChildScrollView( + child: Column( + children: [ + Container( + child: Row( children: [ Container( child: Row( children: [ Container( - child: Row( - children: [ - Container( - padding: EdgeInsets.only( - top: 20.0, - left: 10.0, - right: 10.0, - bottom: 10.0, - ), - child: LargeAvatar( - name: user.firstName.toString(), - url: '', - ), - ), - Column(children: [ - Row(children: [ - Text( - TranslationBase.of(context).welcome, - style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, color: Colors.grey), - ), - ]), - SizedBox( - height: 10, - ), - Row(children: [ - Text( - languageID == "ar" ? user.firstNameN.toString() + " " + user.lastNameN.toString() : user.firstName.toString() + " " + user.lastName.toString(), - style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), - ), - ]), - ]), - ], + padding: EdgeInsets.only( + top: 20.0, + left: 10.0, + right: 10.0, + bottom: 10.0, ), - ) - ], - ), - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 15, - ), - Container( - child: Row( - children: [ - Expanded( - child: InkWell( - onTap: () { - if (customerId == null) { - AppToast.showErrorToast(message: "Customer not found"); - return; - } - Navigator.push(context, FadePage(page: OrderPage(customerID: customerId, customerGUID: customerGUID))); - }, - child: Column( - children: [ -// Image(image: AssetImage('assets/images/pharmacy/orders_icon.svg')), - SvgPicture.asset( - 'assets/images/pharmacy/orders_icon.svg', - width: 50, - height: 50, - ), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).orders, - style: TextStyle( - fontSize: 13.0, - fontWeight: FontWeight.bold, - ), - ), - ], + child: LargeAvatar( + name: user.firstName.toString(), + url: '', ), ), - ), - Expanded( - child: InkWell( - onTap: () { - if (customerId == null || customerId == '') - Navigator.push(context, FadePage(page: LakumActivationVidaPage())); - else - Navigator.push(context, FadePage(page: LakumMainPage())); - }, - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/lakum_icon.svg', - width: 50, - height: 50, - ), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).lakum, - style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold), - ), - ], + Column(children: [ + Row(children: [ + Text( + TranslationBase.of(context).welcome, + style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, color: Colors.grey), + ), + ]), + SizedBox( + height: 10, ), + Row(children: [ + Text( + languageID == "ar" ? user.firstNameN.toString() + " " + user.lastNameN.toString() : user.firstName.toString() + " " + user.lastName.toString(), + style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold), + ), + ]), + ]), + ], + ), + ) + ], + ), + ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 5, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 15, + ), + Container( + child: Row( + children: [ + Expanded( + child: InkWell( + onTap: () { + if (customerId == null) { + AppToast.showErrorToast(message: "Customer not found"); + return; + } + Navigator.push(context, FadePage(page: OrderPage(customerID: customerId, customerGUID: customerGUID))); + }, + child: Column( + children: [ +// Image(image: AssetImage('assets/images/pharmacy/orders_icon.svg')), + SvgPicture.asset( + 'assets/images/pharmacy/orders_icon.svg', + width: 50, + height: 50, ), - ), - Expanded( - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: WishlistPage())); - }, - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/wishlist_icon.svg', - width: 50, - height: 50, - ), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).wishlist, - style: TextStyle( - fontSize: 13.0, - fontWeight: FontWeight.bold, - ), - ), - ], - ), + SizedBox( + height: 5, ), - ), - Expanded( - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MyReviewsPage())); - }, - child: Column( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/review_icon.svg', - width: 50, - height: 50, - ), - SizedBox( - height: 5, - ), - Text( - TranslationBase.of(context).reviews, - style: TextStyle( - fontSize: 13.0, - fontWeight: FontWeight.bold, - ), - ), - ], + Text( + TranslationBase.of(context).orders, + style: TextStyle( + fontSize: 13.0, + fontWeight: FontWeight.bold, ), ), - ), - ], - )), - SizedBox( - height: 15, - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 10, + ], + ), ), - Container( - padding: EdgeInsets.only(left: 10.0), + ), + Expanded( + child: InkWell( + onTap: () { + if (customerId == null || customerId == '') + Navigator.push(context, FadePage(page: LakumActivationVidaPage())); + else + Navigator.push(context, FadePage(page: LakumMainPage())); + }, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - TranslationBase.of(context).myAccount, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold), + SvgPicture.asset( + 'assets/images/pharmacy/lakum_icon.svg', + width: 50, + height: 50, ), SizedBox( - height: 10, + height: 5, ), - Divider( - color: Colors.grey, - height: 20, + Text( + TranslationBase.of(context).lakum, + style: TextStyle(fontSize: 13.0, fontWeight: FontWeight.bold), ), - InkWell( - onTap: () { - Navigator.push(context, FadePage(page: HomePrescriptionsPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/my_prescription_icon.svg', - width: 28, - height: 28, - ), - SizedBox( - width: 15, - ), - Text( - TranslationBase.of(context).myPrescription, - style: TextStyle( - fontSize: 13.0, - ), - ), - ], - ), + ], + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: WishlistPage())); + }, + child: Column( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/wishlist_icon.svg', + width: 50, + height: 50, ), SizedBox( height: 5, ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - onTap: () { - Navigator.push(context, FadePage(page: ComparePage())); - }, - child: Row( - children: [ - Image.asset('assets/images/pharmacy/compare.png', width: 35, height: 35), - SizedBox( - width: 15, - ), - Text( - TranslationBase.of(context).compare, - style: TextStyle( - fontSize: 13.0, - ), - ), - ], + Text( + TranslationBase.of(context).wishlist, + style: TextStyle( + fontSize: 13.0, + fontWeight: FontWeight.bold, ), ), + ], + ), + ), + ), + Expanded( + child: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MyReviewsPage())); + }, + child: Column( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/review_icon.svg', + width: 50, + height: 50, + ), SizedBox( height: 5, ), - Divider( - color: Colors.grey, - height: 20, - ), - InkWell( - onTap: () { - Navigator.push(context, FadePage(page: HomePrescriptionsPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/medication_refill_icon.svg', - width: 30, - height: 30, - ), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).medicationsRefill, - style: TextStyle( - fontSize: 13.0, - ), - ), - ], + Text( + TranslationBase.of(context).reviews, + style: TextStyle( + fontSize: 13.0, + fontWeight: FontWeight.bold, ), ), + ], + ), + ), + ), + ], + )), + SizedBox( + height: 15, + ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 5, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 10, + ), + Container( + padding: EdgeInsets.only(left: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).myAccount, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold), + ), + SizedBox( + height: 10, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: HomePrescriptionsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/my_prescription_icon.svg', + width: 28, + height: 28, + ), SizedBox( - height: 5, + width: 15, ), - Divider( - color: Colors.grey, - height: 20, + Text( + TranslationBase.of(context).myPrescription, + style: TextStyle( + fontSize: 13.0, + ), ), - InkWell( - onTap: () { - Navigator.push(context, FadePage(page: MyFamily())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/my_family_icon.svg', - width: 20, - height: 20, - ), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).family, - style: TextStyle( - fontSize: 13.0, - ), - ), - ], + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: ComparePage())); + }, + child: Row( + children: [ + Image.asset('assets/images/pharmacy/compare.png', width: 35, height: 35), + SizedBox( + width: 15, + ), + Text( + TranslationBase.of(context).compare, + style: TextStyle( + fontSize: 13.0, ), ), + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: HomePrescriptionsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/medication_refill_icon.svg', + width: 30, + height: 30, + ), SizedBox( - height: 5, + width: 20, + ), + Text( + TranslationBase.of(context).medicationsRefill, + style: TextStyle( + fontSize: 13.0, + ), ), - Divider( - color: Colors.grey, + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: MyFamily())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/my_family_icon.svg', + width: 20, height: 20, ), - InkWell( - onTap: () { - Navigator.push(context, FadePage(page: PharmacyAddressesPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/shipping_addresses_icon.svg', - width: 30, - height: 30, - ), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).shippingAddresses, - style: TextStyle( - fontSize: 13.0, - ), - ), - ], + SizedBox( + width: 20, + ), + Text( + TranslationBase.of(context).family, + style: TextStyle( + fontSize: 13.0, ), ), - SizedBox( - height: 5, + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: PharmacyAddressesPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/shipping_addresses_icon.svg', + width: 30, + height: 30, ), - Divider( - color: Colors.grey, - height: 20, + SizedBox( + width: 20, ), - InkWell( - onTap: () { - Navigator.push(context, FadePage(page: PharmacyTermsConditions())); - }, - child: Row( - children: [ - Image.asset( - 'assets/images/pharmacy/terms.png', - width: 25, - height: 25, - ), - SizedBox( - width: 10, - ), - Text( - TranslationBase.of(context).conditionsHMG, - style: TextStyle( - fontSize: 13.0, - ), - ), - ], + Text( + TranslationBase.of(context).shippingAddresses, + style: TextStyle( + fontSize: 13.0, ), ), + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: PharmacyTermsConditions())); + }, + child: Row( + children: [ + Image.asset( + 'assets/images/pharmacy/terms.png', + width: 25, + height: 25, + ), SizedBox( - height: 5, + width: 10, ), - Divider( - color: Colors.grey, - height: 20, + Text( + TranslationBase.of(context).conditionsHMG, + style: TextStyle( + fontSize: 13.0, + ), + ), + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: LakumTermsConditions(this.identificationNo, this.firstName, this.lastName, this.mobileNo, this.languageId))); + }, + child: Row( + children: [ + Image.asset( + 'assets/images/pharmacy/terms.png', + width: 25, + height: 25, ), - InkWell( - onTap: () { - Navigator.push(context, FadePage(page: LakumTermsConditions(this.identificationNo, this.firstName, this.lastName, this.mobileNo, this.languageId))); - }, - child: Row( - children: [ - Image.asset( - 'assets/images/pharmacy/terms.png', - width: 25, - height: 25, - ), // IconButton(icon: Icon(Icons.error_outline), iconSize: 30, // color: Colors.black,), - SizedBox( - width: 10, - ), - Text( - TranslationBase.of(context).conditions, - style: TextStyle( - fontSize: 13.0, - ), - ), - ], + SizedBox( + width: 10, + ), + Text( + TranslationBase.of(context).conditions, + style: TextStyle( + fontSize: 13.0, ), ), ], ), ), + ], + ), + ), + SizedBox( + height: 10, + ), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 5, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 10, + ), + Container( + padding: EdgeInsets.only(left: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).reachUs, + style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold), + ), SizedBox( - height: 10, + height: 5, ), Divider( - color: Colors.grey[350], + color: Colors.grey, height: 20, - thickness: 5, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 10, ), - Container( - padding: EdgeInsets.only(left: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: LiveChatPage())); + }, + child: Row( children: [ - Text( - TranslationBase.of(context).reachUs, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold), + SvgPicture.asset( + 'assets/images/pharmacy/contact_us_icon.svg', + width: 20, + height: 20, ), SizedBox( - height: 5, + width: 20, ), - Divider( - color: Colors.grey, - height: 20, + Text( + TranslationBase.of(context).contactUs, + style: TextStyle(fontSize: 13.0), ), - InkWell( - onTap: () { - Navigator.push(context, FadePage(page: LiveChatPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/contact_us_icon.svg', - width: 20, - height: 20, - ), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).contactUs, - style: TextStyle(fontSize: 13.0), - ), - ], - ), + ], + ), + ), + SizedBox( + height: 5, + ), + Divider( + color: Colors.grey, + height: 20, + ), + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: FindUsPage())); + }, + child: Row( + children: [ + SvgPicture.asset( + 'assets/images/pharmacy/our_locations_icon.svg', + width: 30, + height: 30, ), SizedBox( - height: 5, + width: 20, ), - Divider( - color: Colors.grey, - height: 20, + Text( + TranslationBase.of(context).ourLocations, + style: TextStyle(fontSize: 13.0), ), - InkWell( - onTap: () { - Navigator.push(context, FadePage(page: FindUsPage())); - }, - child: Row( - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/our_locations_icon.svg', - width: 30, - height: 30, - ), - SizedBox( - width: 20, - ), - Text( - TranslationBase.of(context).ourLocations, - style: TextStyle(fontSize: 13.0), - ), - ], - ), - ) ], ), ) ], ), - ), - ) - : Container(), - )); + ) + ], + ), + ), + ) + : Container(), + ), + ); } } diff --git a/lib/services/pharmacy_services/product_detail_service.dart b/lib/services/pharmacy_services/product_detail_service.dart index 5599fc87..d326c130 100644 --- a/lib/services/pharmacy_services/product_detail_service.dart +++ b/lib/services/pharmacy_services/product_detail_service.dart @@ -123,10 +123,11 @@ class ProductDetailService extends BaseService { return Future.value(localRes); } - Future notifyMe(customerId, itemID, context) async { + Future notifyMe(customerId, itemID) async { hasError = false; await baseAppClient.getPharmacy(SUBSCRIBE_PRODUCT + "SinceId=$customerId&ProductId=$itemID", onSuccess: (dynamic response, int statusCode) { - AppToast.showSuccessToast(message: TranslationBase.of(context).notifyMeMsg + AppToast.showSuccessToast(message: TranslationBase.of(AppGlobal.context).notifyMeMsg + // TranslationBase.of(context).notifyMeMsg //'You will be notified when product available' ); }, onFailure: (String error, int statusCode) { diff --git a/lib/uitl/laser_body_parts_data.dart b/lib/uitl/laser_body_parts_data.dart index b8e8e58e..e52b4870 100644 --- a/lib/uitl/laser_body_parts_data.dart +++ b/lib/uitl/laser_body_parts_data.dart @@ -10,95 +10,98 @@ class LaserBodyParts { factory LaserBodyParts() => _instance; static Widget image(String assetUri) { - return new SvgPicture.asset(assetUri, fit: BoxFit.cover,width: 97,height: 97,); + return new SvgPicture.asset(assetUri, fit: BoxFit.cover, width: 88, height: 88); + } + + static Widget imagePng(String assetUri) { + return Image.asset(assetUri, fit: BoxFit.cover, width: 88, height: 88); } Map maleBodyMap = { - "40": image("assets/images/new/body_parts/male/upper_arm.svg"), - "41": image("assets/images/new/body_parts/male/lower_arm.svg"), - "42": image("assets/images/new/body_parts/male/chest.svg"), - "43": image("assets/images/new/body_parts/male/chest_line.svg"), - "44": image("assets/images/new/body_parts/male/shoulders.svg"), - "45": image("assets/images/new/body_parts/male/back.svg"), - "46": image("assets/images/new/body_parts/male/abdomin.svg"), - "47": image("assets/images/new/body_parts/male/upper_leg.svg"), - "48": image("assets/images/new/body_parts/male/lower_leg.svg"), - "49": image("assets/images/new/body_parts/male/axilla.svg") + "40": imagePng("assets/images/new/body_parts/male/upper_arm.png"), + "41": imagePng("assets/images/new/body_parts/male/lower_arm.png"), + "42": imagePng("assets/images/new/body_parts/male/chest.png"), + "43": imagePng("assets/images/new/body_parts/male/chest_line.png"), + "44": imagePng("assets/images/new/body_parts/male/shoulders.png"), + "45": imagePng("assets/images/new/body_parts/male/back.png"), + "46": imagePng("assets/images/new/body_parts/male/abdomin.png"), + "47": imagePng("assets/images/new/body_parts/male/upper_legs.png"), + "48": imagePng("assets/images/new/body_parts/male/lower_legs.png"), + "49": imagePng("assets/images/new/body_parts/male/axilla.png") }; Map maleFaceMap = { - "62": image("assets/images/new/body_parts/male/hydra_facial.svg"), - "5": image("assets/images/new/body_parts/male/upper_lips.svg"), - "6": image("assets/images/new/body_parts/male/chin.svg"), - "7": image("assets/images/new/body_parts/male/cheek.svg"), - "8": image("assets/images/new/body_parts/male/side_burn.svg"), - "9": image("assets/images/new/body_parts/male/ears.svg"), - "10": image("assets/images/new/body_parts/male/full_neck.svg"), - "11": image("assets/images/new/body_parts/male/half_neck.svg"), - "12": image("assets/images/new/body_parts/male/eyebrows.svg") + "62": image("assets/images/new/body_parts/male/hydra_facial.svg"), + "5": image("assets/images/new/body_parts/male/upper_lips.svg"), + "6": image("assets/images/new/body_parts/male/chin.svg"), + "7": image("assets/images/new/body_parts/male/cheek.svg"), + "8": image("assets/images/new/body_parts/male/side_burn.svg"), + "9": image("assets/images/new/body_parts/male/ears.svg"), + "10": image("assets/images/new/body_parts/male/full_neck.svg"), + "11": image("assets/images/new/body_parts/male/half_neck.svg"), + "12": image("assets/images/new/body_parts/male/eyebrows.svg") }; Map maleBodyRetouchMap = { - "51": image("assets/images/new/body_parts/male/upper_arm.svg"), - "52": image("assets/images/new/body_parts/male/lower_arm.svg"), - "53": image("assets/images/new/body_parts/male/chest.svg"), - "54": image("assets/images/new/body_parts/male/shoulders.svg"), - "55": image("assets/images/new/body_parts/male/back.svg"), - "56": image("assets/images/new/body_parts/male/abdomin.svg"), - "57": image("assets/images/new/body_parts/male/full_leg.svg"), - "58": image("assets/images/new/body_parts/male/upper_leg.svg"), - "59": image("assets/images/new/body_parts/male/lower_leg.svg"), - "60": image("assets/images/new/body_parts/male/bikini.svg"), - "61": image("assets/images/new/body_parts/male/bikini_line.svg") + "51": imagePng("assets/images/new/body_parts/male/upper_arm.png"), + "52": imagePng("assets/images/new/body_parts/male/lower_arm.png"), + "53": imagePng("assets/images/new/body_parts/male/chest.png"), + "54": imagePng("assets/images/new/body_parts/male/shoulders.png"), + "55": imagePng("assets/images/new/body_parts/male/back.png"), + "56": imagePng("assets/images/new/body_parts/male/abdomin.png"), + "57": imagePng("assets/images/new/body_parts/male/full_legs.png"), + "58": imagePng("assets/images/new/body_parts/male/upper_legs.png"), + "59": imagePng("assets/images/new/body_parts/male/lower_legs.png"), + "60": imagePng("assets/images/new/body_parts/male/bikini.png"), + "61": imagePng("assets/images/new/body_parts/male/bikini_line.png") }; Map femaleBodyMap = { - "40": image("assets/images/new/body_parts/female/upper_arm.svg"), - "41": image("assets/images/new/body_parts/female/lower_arm.svg"), - "42": image("assets/images/new/body_parts/female/chest.svg"), - "43": image("assets/images/new/body_parts/female/chest_line.svg"), - "44": image("assets/images/new/body_parts/female/shoulder.svg"), - "45": image("assets/images/new/body_parts/female/back.svg"), - "46": image("assets/images/new/body_parts/female/abdomin.svg"), - "47": image("assets/images/new/body_parts/female/upper_leg.svg"), - "48": image("assets/images/new/body_parts/female/lower_leg.svg"), - "49": image("assets/images/new/body_parts/female/axilla.svg") + "40": imagePng("assets/images/new/body_parts/female/upper_arm.png"), + "41": imagePng("assets/images/new/body_parts/female/lower_arm.png"), + "42": imagePng("assets/images/new/body_parts/female/chest.png"), + "43": imagePng("assets/images/new/body_parts/female/chest_line.png"), + "44": imagePng("assets/images/new/body_parts/female/shoulders.png"), + "45": imagePng("assets/images/new/body_parts/female/back.png"), + "46": imagePng("assets/images/new/body_parts/female/abdomin.png"), + "47": imagePng("assets/images/new/body_parts/female/upper_legs.png"), + "48": imagePng("assets/images/new/body_parts/female/lower_leg.png"), + "49": imagePng("assets/images/new/body_parts/female/axilla.png") }; Map femaleFaceMap = { - "62": image("assets/images/new/body_parts/female/hydra_facial.svg"), - "5": image("assets/images/new/body_parts/female/upper_lips.svg"), - "6": image("assets/images/new/body_parts/female/chin.svg"), - "7": image("assets/images/new/body_parts/female/cheeks.svg"), - "8": image("assets/images/new/body_parts/female/side_burn.svg"), - "9": image("assets/images/new/body_parts/female/ears.svg"), - "10": image("assets/images/new/body_parts/female/full_neck.svg"), - "11": image("assets/images/new/body_parts/female/half_neck.svg"), - "12": image("assets/images/new/body_parts/female/eyebrows.svg") + "62": image("assets/images/new/body_parts/female/hydra_facial.svg"), + "5": image("assets/images/new/body_parts/female/upper_lips.svg"), + "6": image("assets/images/new/body_parts/female/chin.svg"), + "7": image("assets/images/new/body_parts/female/cheeks.svg"), + "8": image("assets/images/new/body_parts/female/side_burn.svg"), + "9": image("assets/images/new/body_parts/female/ears.svg"), + "10": image("assets/images/new/body_parts/female/full_neck.svg"), + "11": image("assets/images/new/body_parts/female/half_neck.svg"), + "12": image("assets/images/new/body_parts/female/eyebrows.svg") }; Map femaleBodyBikiniMap = { - "34": image("assets/images/new/body_parts/female/bikini.svg"), - "36": image("assets/images/new/body_parts/female/bikini_line.svg"), - "38": image("assets/images/new/body_parts/female/buttocks.svg"), - "39": image("assets/images/new/body_parts/female/anal.svg") + "34": imagePng("assets/images/new/body_parts/female/bikini.png"), + "36": imagePng("assets/images/new/body_parts/female/bikini_line.png"), + "38": imagePng("assets/images/new/body_parts/female/buttocks.png"), + "39": imagePng("assets/images/new/body_parts/female/anal.png") }; Map femaleBodyRetouchMap = { - "51": image("assets/images/new/body_parts/female/upper_arm.svg"), - "52": image("assets/images/new/body_parts/female/lower_arm.svg"), - "53": image("assets/images/new/body_parts/female/chest.svg"), - "54": image("assets/images/new/body_parts/female/shoulder.svg"), - "55": image("assets/images/new/body_parts/female/back.svg"), - "56": image("assets/images/new/body_parts/female/abdomin.svg"), - "57": image("assets/images/new/body_parts/female/full_leg.svg"), - "58": image("assets/images/new/body_parts/female/upper_leg.svg"), - "59": image("assets/images/new/body_parts/female/lower_leg.svg"), - "60": image("assets/images/new/body_parts/female/bikini.svg"), - "61": image("assets/images/new/body_parts/female/bikini_line.svg") + "51": imagePng("assets/images/new/body_parts/female/upper_arm.png"), + "52": imagePng("assets/images/new/body_parts/female/lower_arm.png"), + "53": imagePng("assets/images/new/body_parts/female/chest.png"), + "54": imagePng("assets/images/new/body_parts/female/shoulders.png"), + "55": imagePng("assets/images/new/body_parts/female/back.png"), + "56": imagePng("assets/images/new/body_parts/female/abdomin.png"), + "57": imagePng("assets/images/new/body_parts/female/full_legs.png"), + "58": imagePng("assets/images/new/body_parts/female/upper_legs.png"), + "59": imagePng("assets/images/new/body_parts/female/lower_leg.png"), + "60": imagePng("assets/images/new/body_parts/female/bikini.png"), + "61": imagePng("assets/images/new/body_parts/female/bikini_line.png") }; - Widget getCategoryImage(bool isMale, int category, String mappingCode) { if (isMale) { if (category == 1) { diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index fb13232b..76e8a8d2 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -511,7 +511,7 @@ class TranslationBase { String get switchUser => localizedValues['switch-login'][locale.languageCode]; - String get removeMember => localizedValues['remove-membe'][locale.languageCode]; + String get removeMember => localizedValues['remove-member'][locale.languageCode]; String get allowView => localizedValues['allow-view'][locale.languageCode]; @@ -2789,8 +2789,14 @@ class TranslationBase { String get gr => localizedValues["gr"][locale.languageCode]; String get gramsPerMeal => localizedValues["gramsPerMeal"][locale.languageCode]; + String get cancelReminder => localizedValues["CancelReminder"][locale.languageCode]; - + String get reminderCancelSuccess => localizedValues["reminderCancelSuccess"][locale.languageCode]; + String get syncSuccess => localizedValues["syncSuccess"][locale.languageCode]; + String get useLakumPoints => localizedValues["useLakumPoints"][locale.languageCode]; + String get points => localizedValues["points"][locale.languageCode]; + String get availableBalance => localizedValues["availableBalance"][locale.languageCode]; + String get ordersDashboard => localizedValues["ordersDashboard"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/buttons/defaultButton.dart b/lib/widgets/buttons/defaultButton.dart index 14e93d66..affd9a3e 100644 --- a/lib/widgets/buttons/defaultButton.dart +++ b/lib/widgets/buttons/defaultButton.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_svg/svg.dart'; extension WithContainer on Widget { Widget get insideContainer => Container(color: Colors.white, padding: EdgeInsets.only(top: 16, bottom: 16, right: 21, left: 21), child: this); @@ -11,8 +12,12 @@ class DefaultButton extends StatelessWidget { final Color color; final Color disabledColor; final IconData iconData; + final String svgIcon; final double fontSize; - DefaultButton(this.text, this.onPress, {this.color, this.disabledColor, this.textColor = Colors.white, this.iconData, this.fontSize}); + final bool isTextExpanded; + final int count; + + DefaultButton(this.text, this.onPress, {this.color, this.isTextExpanded = true, this.svgIcon, this.disabledColor, this.count = 0, this.textColor = Colors.white, this.iconData, this.fontSize}); @override Widget build(BuildContext context) { @@ -22,15 +27,43 @@ class DefaultButton extends StatelessWidget { child: FlatButton( onPressed: onPress, child: Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ if (iconData != null) Icon(iconData, color: textColor), - Expanded( - child: Text( - text, - textAlign: TextAlign.center, - style: TextStyle(fontSize: fontSize ?? 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48), + if (svgIcon != null) SvgPicture.asset(svgIcon,color: textColor), + if (!isTextExpanded) + Padding( + padding: EdgeInsets.only(left: (iconData ?? svgIcon) != null ? 6 : 0), + child: Text( + text, + textAlign: TextAlign.center, + style: TextStyle(fontSize: fontSize ?? 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48), + ), + ), + if (isTextExpanded) + Expanded( + child: Text( + text, + textAlign: TextAlign.center, + style: TextStyle(fontSize: fontSize ?? 16, fontWeight: FontWeight.w600, color: textColor, letterSpacing: -0.48), + ), ), - ), + if (count > 0) + Align( + alignment: Alignment.topCenter, + child: Container( + margin: EdgeInsets.only(top: 6, bottom: 6), + padding: EdgeInsets.only(left: 5, right: 5), + alignment: Alignment.center, + height: 16, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(10.0), color: Colors.white), + child: Text( + "$count", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 12, fontWeight: FontWeight.w700, color: Color(0xffD02127), letterSpacing: -0.6), + ), + ), + ) ], ), // color: Color(0xffD02127), diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index e24fd6f0..5ae0d119 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -48,9 +48,9 @@ class MyInAppBrowser extends InAppBrowser { static String PACKAGES_PAYMENT_SUCCESS_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess'; static String PACKAGES_PAYMENT_FAIL_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed'; - static List successURLS = ['success', 'PayFortResponse', 'PayFortSucess', 'mobilepaymentcomplete']; + static List successURLS = ['success', 'PayFortResponse', 'PayFortSucess', 'mobilepaymentcomplete', 'orderdetails']; - static List errorURLS = ['PayfortCancel', 'errorpage', 'Failed']; + static List errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails']; final Function onExitCallback; final Function onLoadStartCallback; diff --git a/lib/widgets/offers_packages/PackagesCartItemCard.dart b/lib/widgets/offers_packages/PackagesCartItemCard.dart index 10c7e5b1..d53f9505 100644 --- a/lib/widgets/offers_packages/PackagesCartItemCard.dart +++ b/lib/widgets/offers_packages/PackagesCartItemCard.dart @@ -30,21 +30,20 @@ class PackagesCartItemCardState extends State { wide = !wide; return Container( decoration: cardRadius(15.0), - margin: EdgeInsets.only(left: 21.0, right: 21.0, top: 12.0), - height: 90, + height: 95, + padding: EdgeInsets.all(9), child: Row( mainAxisSize: MainAxisSize.max, children: [ _image(widget.itemModel.product), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - _itemName(widget.itemModel.product.getName()), - _itemDescription(widget.itemModel.product.shortDescription), - Container( - padding: const EdgeInsets.only(top: 12.0), - width: MediaQuery.of(context).size.width * 0.65, - child: Row( + SizedBox(width: 7), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _itemName(widget.itemModel.product.getName()), + Expanded(child: _itemDescription(widget.itemModel.product.shortDescription)), + Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -54,11 +53,12 @@ class PackagesCartItemCardState extends State { await widget.viewModel.service.deleteProductFromCart(widget.itemModel.id, context: context, showLoading: false); widget.getCartItems(); }, - child: Row( - children: [ - Padding( - padding: const EdgeInsets.only(left: 5.0, right: 5.0), - child: Text( + child: Padding( + padding: const EdgeInsets.only(right: 3, bottom: 3), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( TranslationBase.of(context).removeMember, style: TextStyle( fontSize: 10, @@ -67,15 +67,16 @@ class PackagesCartItemCardState extends State { letterSpacing: -0.36, ), ), - ), - SvgPicture.asset("assets/images/new-design/delete.svg", color: CustomColors.accentColor), - ], + SizedBox(width: 2), + SvgPicture.asset("assets/images/new-design/delete.svg", color: CustomColors.accentColor), + ], + ), ), ), ], ), - ), - ], + ], + ), ) ], ), @@ -85,52 +86,41 @@ class PackagesCartItemCardState extends State { Widget _image(PackagesResponseModel model) => AspectRatio( aspectRatio: 1 / 1, - child: Padding( - padding: const EdgeInsets.all(9), - child: Container( - decoration: BoxDecoration( - border: Border.all(color: Colors.grey[300], width: 0.25), - boxShadow: [BoxShadow(color: Colors.grey[200], blurRadius: 2.0, spreadRadius: 1, offset: Offset(1, 1.5))], - borderRadius: BorderRadius.circular(15), - color: Colors.white, - shape: BoxShape.rectangle, - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(15), - child: (model.images.isNotEmpty) ? Utils.loadNetworkImage(url: model.images.first.src, fitting: BoxFit.fill) : Container(color: Colors.grey[200])), - ), - ), + child: ClipRRect( + borderRadius: BorderRadius.circular(15), child: (model.images.isNotEmpty) ? Utils.loadNetworkImage(url: model.images.first.src, fitting: BoxFit.fill) : Container(color: Colors.grey[200])), ); -Widget _itemName(String name) => Padding( - padding: const EdgeInsets.only(top: 9.0), - child: Text(name, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - letterSpacing: -0.56, - ))); - -Widget _itemDescription(String desc) => Padding( - padding: const EdgeInsets.only(top: 0.0), - child: Text(desc, - style: TextStyle( - fontSize: 10, - // fontWeight: FontWeight.bold, - letterSpacing: -0.4, - ))); +Widget _itemName(String name) => Text( + name, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: Color(0xff2B353E), + letterSpacing: -0.56, + ), + ); -Widget _itemPrice(double price, {@required BuildContext context}) { - final prc = (price ?? 0.0).toStringAsFixed(2); - return Padding( - padding: const EdgeInsets.all(0), - child: Text( - '${prc} ${TranslationBase.of(context).sar}', +Widget _itemDescription(String desc) => Text( + desc, + maxLines: 2, + overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: 11, - fontWeight: FontWeight.w600, + fontSize: 10, + fontWeight: FontWeight.w500, + color: Color(0xff535353), letterSpacing: -0.4, ), + ); + +Widget _itemPrice(double price, {@required BuildContext context}) { + final prc = (price ?? 0.0).toStringAsFixed(2); + return Text( + '$prc ${TranslationBase.of(context).sar}', + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff5D5D5D), + letterSpacing: -0.44, ), ); } diff --git a/lib/widgets/offers_packages/PackagesOfferCard.dart b/lib/widgets/offers_packages/PackagesOfferCard.dart index be756caf..14b1aeb0 100644 --- a/lib/widgets/offers_packages/PackagesOfferCard.dart +++ b/lib/widgets/offers_packages/PackagesOfferCard.dart @@ -2,10 +2,7 @@ import 'package:diplomaticquarterapp/core/model/packages_offers/responses/Packag import 'package:diplomaticquarterapp/pages/packages_offers/OfferAndPackageDetailPage.dart'; import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils_new.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -32,6 +29,103 @@ class PackagesItemCardState extends State { @override Widget build(BuildContext context) { wide = !wide; + return InkWell( + onTap: () { + Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => OfferAndPackagesDetail(itemModel: widget.itemModel, onCartClick: widget.onCartClick))); + }, + child: AspectRatio( + aspectRatio: 162 / 279, + child: Container( + // width: widget.itemWidth, + // color: Colors.transparent, + decoration: cardRadius(15.0), + padding: const EdgeInsets.all(9.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AspectRatio( + aspectRatio: 144 / 144, + child: ClipRRect( + borderRadius: BorderRadius.circular(12.0), + child: Image.network("https://mdlaboratories.com/offersdiscounts/images/thumbs/0000162_dermatology-testing.jpeg", fit: BoxFit.fill, height: 180.0, width: 180.0), + ), + ), + SizedBox(height: 6), + Text( + widget.itemModel.name, + maxLines: 1, + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.bold, + letterSpacing: -0.56, + color: Color(0xff2B353E), + ), + ), + Text("Special discount for all HMG Employees and their first…", + maxLines: 2, + style: TextStyle( + fontSize: 12.0, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + color: Color(0xff535353), + ), + overflow: TextOverflow.ellipsis), + if (widget.itemModel.hasDiscountsApplied) + Container( + margin: const EdgeInsets.only(top: 19.0), + child: Text( + widget.itemModel.oldPrice.toString() + " " + TranslationBase.of(context).sar, + style: TextStyle( + fontSize: 9.0, + fontWeight: FontWeight.w600, + letterSpacing: -0.36, + decoration: TextDecoration.lineThrough, + color: Color(0xffA0A0A0), + ), + ), + ), + Container( + margin: widget.itemModel.hasDiscountsApplied ? const EdgeInsets.only(top: 0.0) : const EdgeInsets.only(top: 19.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: const EdgeInsets.only(top: 0.0), + child: Text( + widget.itemModel.price.toString().trim() + " " + TranslationBase.of(context).sar, + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, color: Color(0xff2B353E), letterSpacing: -0.48), + ), + ), + RatingBar.readOnly( + initialRating: 4.5, // todo ask haroon about parameter for rating + size: 18.0, + filledColor: Color(0XFFD02127), + emptyColor: Color(0XFFD02127), + isHalfAllowed: true, + halfFilledIcon: Icons.star_half, + filledIcon: Icons.star, + emptyIcon: Icons.star_border, + ), + ], + ), + InkWell( + child: SvgPicture.asset("assets/images/new/add_to_cart.svg"), + onTap: () { + widget.onCartClick(widget.itemModel); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ); + return InkWell( onTap: () { Navigator.of(context).push(MaterialPageRoute(builder: (BuildContext context) => OfferAndPackagesDetail(itemModel: widget.itemModel, onCartClick: widget.onCartClick))); @@ -50,8 +144,15 @@ class PackagesItemCardState extends State { child: Image.network("https://mdlaboratories.com/offersdiscounts/images/thumbs/0000162_dermatology-testing.jpeg", fit: BoxFit.fill, height: 180.0, width: 180.0), ), Container(margin: const EdgeInsets.only(top: 8.0), child: Text(widget.itemModel.name, maxLines: 1, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.bold, letterSpacing: -0.56))), - Container(width: MediaQuery.of(context).size.width * 0.4, child: Text("Special discount for all HMG Employees and their first…", maxLines: 2, style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.w600, letterSpacing: -0.4, color: CustomColors.textColor), overflow: TextOverflow.clip)), - if (widget.itemModel.hasDiscountsApplied) Container(margin: const EdgeInsets.only(top: 19.0), child: Text(widget.itemModel.oldPrice.toString() + " " + TranslationBase.of(context).sar, style: TextStyle(fontSize: 9.0, fontWeight: FontWeight.w600, letterSpacing: -0.36, decoration: TextDecoration.lineThrough, color: CustomColors.grey2))), + Container( + width: MediaQuery.of(context).size.width * 0.4, + child: Text("Special discount for all HMG Employees and their first…", + maxLines: 2, style: TextStyle(fontSize: 10.0, fontWeight: FontWeight.w600, letterSpacing: -0.4, color: CustomColors.textColor), overflow: TextOverflow.clip)), + if (widget.itemModel.hasDiscountsApplied) + Container( + margin: const EdgeInsets.only(top: 19.0), + child: Text(widget.itemModel.oldPrice.toString() + " " + TranslationBase.of(context).sar, + style: TextStyle(fontSize: 9.0, fontWeight: FontWeight.w600, letterSpacing: -0.36, decoration: TextDecoration.lineThrough, color: CustomColors.grey2))), Container( margin: widget.itemModel.hasDiscountsApplied ? const EdgeInsets.only(top: 0.0) : const EdgeInsets.only(top: 19.0), child: Row( @@ -60,7 +161,10 @@ class PackagesItemCardState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container(margin: const EdgeInsets.only(top: 0.0), child: Text(widget.itemModel.price.toString().trim() + " " + TranslationBase.of(context).sar, style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, letterSpacing: -0.56))), + Container( + margin: const EdgeInsets.only(top: 0.0), + child: Text(widget.itemModel.price.toString().trim() + " " + TranslationBase.of(context).sar, + style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold, letterSpacing: -0.56))), RatingBar.readOnly( initialRating: 4.5, size: 18.0, diff --git a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart index 9731f2b1..1d5893fd 100644 --- a/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart +++ b/lib/widgets/pharmacy/bottom_nav_pharmacy_item.dart @@ -1,16 +1,16 @@ -import 'package:diplomaticquarterapp/Constants.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/ShoppingCartResponse.dart'; -import 'package:diplomaticquarterapp/core/service/parmacyModule/order-preview-service.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/OrderPreviewViewModel.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/login/welcome.dart'; +import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; +import 'package:diplomaticquarterapp/routes.dart'; +import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import '../../locator.dart'; - class BottomNavPharmacyItem extends StatelessWidget { final String title; final IconData icon; @@ -22,15 +22,10 @@ class BottomNavPharmacyItem extends StatelessWidget { final bool isHome; final IconData activeIcon; - BottomNavPharmacyItem( - {this.icon, - this.changeIndex, - this.index, - this.currentIndex, - this.activeIcon, - this.title, - this.onTap, - this.isHome = false}); + + BottomNavPharmacyItem({this.icon, this.changeIndex, this.index, this.currentIndex, this.activeIcon, this.title, this.onTap, this.isHome = false}); + + AppSharedPreferences sharedPref = AppSharedPreferences(); @override Widget build(BuildContext context) { @@ -39,7 +34,7 @@ class BottomNavPharmacyItem extends StatelessWidget { return Expanded( child: SizedBox( - height: 66.0, + height: 66.0, child: Stack( clipBehavior: Clip.none, children: [ @@ -49,13 +44,8 @@ class BottomNavPharmacyItem extends StatelessWidget { highlightColor: Colors.transparent, splashColor: Colors.transparent, onTap: () { - if (!Provider.of(context, listen: false) - .isLogin && - (currentIndex == 2 || currentIndex == 3)) - Navigator.push( - context, - FadePage(page: WelcomeLogin()), - ); + if (!Provider.of(context, listen: false).isLogin && (currentIndex == 2 || currentIndex == 3)) + login(context); else changeIndex(currentIndex); }, @@ -63,9 +53,6 @@ class BottomNavPharmacyItem extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ -// SizedBox( -// height: 15, -// ), currentIndex == index ? Divider( color: Color(0xff5AB133), @@ -93,20 +80,14 @@ class BottomNavPharmacyItem extends StatelessWidget { title, textAlign: TextAlign.center, color: currentIndex == index ? Colors.grey : Colors.grey, - fontWeight: currentIndex == index - ? FontWeight.normal - : FontWeight.w400, + fontWeight: currentIndex == index ? FontWeight.normal : FontWeight.w400, fontSize: currentIndex == index ? 11 : 9, ), ], ), ), ), - if (currentIndex == 3 && - Provider.of(context, listen: false) - .cartResponse - .quantityCount != - 0) + if (currentIndex == 3 && Provider.of(context, listen: false).cartResponse.quantityCount != 0) Positioned( top: 11.5, right: -3.5, @@ -131,4 +112,35 @@ class BottomNavPharmacyItem extends StatelessWidget { ), ); } + + void setUserValues(value) async { + if (value != null) sharedPref.setObject(IMEI_USER_DATA, value); + } + + login(BuildContext context) async { + final authService = new AuthProvider(); + var data = await sharedPref.getObject(IMEI_USER_DATA); + sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); + if (data != null) { + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + GifLoaderDialogUtils.showMyDialog(context); + authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES value) { + GifLoaderDialogUtils.hideDialog(context); + if (value != null) { + setUserValues(value); + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + }); + } + } }