nutrition 1.0.0

Flutter Android iOS

Flutter plugin which allows you to acess Google Fit and iOS Health nutrition data.

Nutrition for Flutter

Google Fit and Apple Health Wrapper

Pub Version License: MIT

✨ Demo #

See example

🚀 Usage #

Supported Data Types
Total Fat
Calcium
Sugar
Fiber
Iron
Potassium
Sodium
Vitamin A
Vitamin C
Protein
Cholesterol
Total Carbohydrates

⚠️ Request Permission #

bool hasPermission = false;
await Nutrition.requestPermission().then((value) => setState(() {
  hasPermission = value;
}));

🍎 Get Data #

Note for Android users you must have Google Sign In setup with your Flutter app

DateTime endDate = DateTime.now();
DateTime startDate = DateTime.now().subtract(Duration(days: 7));
Nutrition.getData(startDate, endDate);

🍌 Add Data #

Note for Android users you must have Google Sign In setup with your Flutter app

DateTime date = DateTime.now();
Map<NutritionEnum, double> nutrients = {
  NutritionEnum.FIBRE: 10,
  NutritionEnum.FAT: 5,
  NutritionEnum.PROTEIN: 2.5,
  NutritionEnum.CARBOHYDRATES: 100
};

// Pass a Map<NutritionEnum, double> and a date
Nutrition.addData(nutrients, date);

📝 License #

This project is MIT licensed.

1
likes
90
pub points
5%
popularity

Publisher

covalsolutions.com

Flutter plugin which allows you to acess Google Fit and iOS Health nutrition data.

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on nutrition