Skip to content

Error to add a new ingredient wieght #721

Open
@hhugoac

Description

Steps to Reproduce

  1. Go to the Nutritional plans and select one, then add a meal
  2. Click on the pencil to add an ingredient
  3. Search an ingredient and type the name
  4. In the weight field add a number less than 1.0 and the app sends an exception

Image
Image
Image
Image

Expected results:
An error message or hint into the textfield to send an explaining the error

Actual results:
The result is that the page pop and didn't save the ingredient

Logs #1 NutritionPlansProvider.addMealItem (package:wger/providers/nutrition.dart:260:18) nutrition.dart:260 2 [log] Saved ingredient 'Meal One' to db cache [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: [Ensure this value is greater than or equal to 1.] #0 WgerBaseProvider.post (package:wger/providers/base_provider.dart:106:7) base_provider.dart:106 #1 NutritionPlansProvider.addMealItem (package:wger/providers/nutrition.dart:260:18) nutrition.dart:260

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions