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

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

example/resto5_models_example.dart

import 'dart:convert';

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());
  }
  return null;
}

void main() {
  getData().then((data) {
    // final restomaxdata = RMXData.fromJson(data);
    // print('Restomax Inf: ${restomaxdata.restomax.toJson()}');
    // print('Etab Inf: ${restomaxdata.etab.toJson()}');
  });
}
1
likes
115
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

Documentation

API reference

License

MIT (LICENSE)

Dependencies

json_annotation

More

Packages that depend on resto5_models