Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thexxturboxx/dart-openmensa
A simple OpenMensa API wrapper in Dart
https://github.com/thexxturboxx/dart-openmensa
dart flutter hacktoberfest openmensa openmensa-api
Last synced: about 2 months ago
JSON representation
A simple OpenMensa API wrapper in Dart
- Host: GitHub
- URL: https://github.com/thexxturboxx/dart-openmensa
- Owner: ThexXTURBOXx
- License: mit
- Created: 2021-08-01T18:18:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-30T22:22:34.000Z (over 1 year ago)
- Last Synced: 2024-10-14T14:08:01.380Z (3 months ago)
- Topics: dart, flutter, hacktoberfest, openmensa, openmensa-api
- Language: Dart
- Homepage: https://pub.dev/packages/openmensa
- Size: 49.8 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Dart OpenMensa
A library which provides simple access to OpenMensa's API services for Dart.
## Usage
Add to ``pubspec.yaml``:
```yaml
dependencies:
openmensa: ^2.1.2
```**See [here](https://github.com/ThexXTURBOXx/dart-openmensa/blob/main/example/openmensa_example.dart) for a more detailed example!**
A simple usage example:
```dart
import 'package:openmensa/openmensa.dart';/// Provides some simple use-case examples.
Future main() async {
// Initialize the API client
final api = OpenMensaAPI();// Get the first page of canteens with a limit of 4
// Thanks to equatable, all objects can be easily
// printed out with a nice representation
final canteens14 = await api.getCanteens(page: 1, limit: 4);
print(canteens14);// Get the second page of canteens with a limit of 1
final canteens21 = await api.getCanteens(page: 2, limit: 1);
print(canteens21);// Thanks to equatable, all objects can be
// easily compared by using the == operator
print(canteens21[0] == canteens14[1]); // true
print(canteens21[0] == canteens14[2]); // false// Get all available information about the meals
// within the next few days from the canteen 196
final mealsOfCanteen = await api.getMealsOfCanteen(196);
print(mealsOfCanteen);
}
```## Feature requests and bugs
Please file feature requests and bugs at the [issue tracker](https://github.com/ThexXTURBOXx/dart-openmensa/issues).