resto5_models 0.0.2+3 copy "resto5_models: ^0.0.2+3" to clipboard
resto5_models: ^0.0.2+3 copied to clipboard

discontinued
outdated

This package exposes all models and utily methods provided and used by Restomax 5

example/resto5_models_example.dart

import 'dart:convert';

import 'package:resto5_models/resto5_models.dart' show RMXData;

const String resto5WSPath = "https://RESTOMAX_ADDRESS:RESTOMAX_PORT";

Future<Map<String, dynamic>?> getData() async {
  final Uri url = Uri.parse('$resto5WSPath/getData');

  final Map<String, String> headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
  };

  try {
    const dynamic http = {}; // For example api call
    final response = await http.get(url, headers: headers);
    return jsonDecode(response.body as String) as Map<String, dynamic>;
  } catch (e) {
    print(e.toString());
  }
}

void main() {
  getData().then((data) {
    final restomaxdata = RMXData.fromJson(data);
    print('Restomax Inf: ${restomaxdata.restomax.toJson()}');
    print('Etab Inf: ${restomaxdata.etab.toJson()}');
  });
}
1
likes
0
pub points
0%
popularity

Publisher

verified publisherraphxyz.com

This package exposes all models and utily methods provided and used by Restomax 5

Homepage
Repository (GitLab)
View/report issues

License

unknown (LICENSE)

Dependencies

json_annotation

More

Packages that depend on resto5_models