Update dart version + add null safety + add openapi generation with null safety

This commit is contained in:
Thomas Fransolet 2023-01-25 15:40:28 +01:00
parent 9f9d8fdda8
commit 2f67bbe7ac
307 changed files with 20195 additions and 3554 deletions

View File

@ -2,16 +2,16 @@ import 'package:flutter/material.dart';
import 'package:tablet_app/constants.dart'; import 'package:tablet_app/constants.dart';
class RoundedButton extends StatelessWidget { class RoundedButton extends StatelessWidget {
final String text; final String? text;
final Function press; final Function? press;
final IconData icon; final IconData? icon;
final Color color, textColor; final Color? color, textColor;
final double fontSize; final double? fontSize;
final double vertical; final double? vertical;
final double horizontal; final double? horizontal;
const RoundedButton({ const RoundedButton({
Key key, Key? key,
this.text, this.text,
this.press, this.press,
this.icon, this.icon,
@ -27,8 +27,8 @@ class RoundedButton extends StatelessWidget {
//Size size = MediaQuery.of(context).size; //Size size = MediaQuery.of(context).size;
return TextButton( return TextButton(
style: ButtonStyle( style: ButtonStyle(
padding: MaterialStateProperty.resolveWith((states) => EdgeInsets.symmetric(vertical: this.vertical != null ? this.vertical : 25, horizontal: this.horizontal != null ? this.horizontal : (icon == null ? 85 : 30))), padding: MaterialStateProperty.resolveWith((states) => EdgeInsets.symmetric(vertical: this.vertical != null ? this.vertical! : 25, horizontal: this.horizontal != null ? this.horizontal! : (icon == null ? 85 : 30))),
backgroundColor: MaterialStateColor.resolveWith((states) => color), backgroundColor: MaterialStateColor.resolveWith((states) => color!),
shape: MaterialStateProperty.all<RoundedRectangleBorder>( shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder( RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0), borderRadius: BorderRadius.circular(30.0),
@ -37,7 +37,7 @@ class RoundedButton extends StatelessWidget {
), ),
onPressed: () => { onPressed: () => {
press() press!()
}, },
child: getValue(icon) child: getValue(icon)
); );
@ -50,7 +50,7 @@ class RoundedButton extends StatelessWidget {
children: [ children: [
Center( Center(
child: Text( child: Text(
text, text!,
style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400), style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400),
), ),
), ),
@ -60,13 +60,13 @@ class RoundedButton extends StatelessWidget {
Icon( Icon(
icon, icon,
color: textColor, color: textColor,
size: fontSize + 8, size: fontSize! + 8,
) )
], ],
); );
} else { } else {
return Text( return Text(
text, text!,
style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400), style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400),
); );
} }

View File

@ -2,7 +2,7 @@ import 'package:flare_flutter/flare_actor.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class Loading extends StatelessWidget { class Loading extends StatelessWidget {
Loading({Key key}) : super(key: key); Loading({Key? key}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {

View File

@ -3,14 +3,14 @@ import 'package:tablet_app/Components/text_field_container.dart';
import 'package:tablet_app/constants.dart'; import 'package:tablet_app/constants.dart';
class RoundedInputField extends StatelessWidget { class RoundedInputField extends StatelessWidget {
final String hintText; final String? hintText;
final IconData icon; final IconData? icon;
final ValueChanged<String> onChanged; final ValueChanged<String>? onChanged;
final String initialValue; final String? initialValue;
final Color color, textColor, iconColor; final Color? color, textColor, iconColor;
final int maxLength; final int? maxLength;
const RoundedInputField({ const RoundedInputField({
Key key, Key? key,
this.hintText, this.hintText,
this.initialValue, this.initialValue,
this.icon, this.icon,

View File

@ -2,10 +2,10 @@ import 'package:flutter/material.dart';
import 'package:tablet_app/constants.dart'; import 'package:tablet_app/constants.dart';
class TextFieldContainer extends StatelessWidget { class TextFieldContainer extends StatelessWidget {
final Widget child; final Widget? child;
final Color color; final Color? color;
const TextFieldContainer({ const TextFieldContainer({
Key key, Key? key,
this.child, this.child,
this.color = kBackgroundGrey, this.color = kBackgroundGrey,
}) : super(key: key); }) : super(key: key);

View File

@ -1,6 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:path/path.dart'; import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart'; import 'package:sqflite/sqflite.dart';
import 'package:tablet_app/Models/tabletContext.dart'; import 'package:tablet_app/Models/tabletContext.dart';
@ -20,11 +20,11 @@ class DatabaseHelper {
DatabaseHelper._privateConstructor(); DatabaseHelper._privateConstructor();
static final DatabaseHelper instance = DatabaseHelper._privateConstructor(); static final DatabaseHelper instance = DatabaseHelper._privateConstructor();
static Database _database; static Database? _database;
Future<Database> get database async { Future<Database> get database async {
if (_database != null) return _database; if (_database != null) return _database!;
_database = await _initDatabase(); _database = await _initDatabase();
return _database; return _database!;
} }
_initDatabase() async { _initDatabase() async {
@ -76,13 +76,13 @@ class DatabaseHelper {
return await db.delete(table, where: '$columnId = ?', whereArgs: [email]); return await db.delete(table, where: '$columnId = ?', whereArgs: [email]);
} }
Future<void> clearTable() async { Future<List<Map<String, Object?>>> clearTable() async {
Database db = await instance.database; Database db = await instance.database;
return await db.rawQuery("DELETE FROM $table"); return await db.rawQuery("DELETE FROM $table");
} }
Future<TabletAppContext> getData() async { Future<TabletAppContext> getData() async {
TabletAppContext tabletAppContext; TabletAppContext tabletAppContext = TabletAppContext();
await DatabaseHelper.instance.queryAllRows().then((value) { await DatabaseHelper.instance.queryAllRows().then((value) {
value.forEach((element) { value.forEach((element) {

View File

@ -4,10 +4,10 @@ import 'package:device_info/device_info.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
class DeviceInfoHelper { class DeviceInfoHelper {
static Future<String> getDeviceDetails() async { static Future<String?> getDeviceDetails() async {
/* String deviceName; /* String deviceName;
String deviceVersion;*/ String deviceVersion;*/
String identifier; String? identifier;
final DeviceInfoPlugin deviceInfoPlugin = new DeviceInfoPlugin(); final DeviceInfoPlugin deviceInfoPlugin = new DeviceInfoPlugin();
try { try {
if (Platform.isAndroid) { if (Platform.isAndroid) {

View File

@ -1,9 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:developer';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:mqtt_client/mqtt_client.dart'; import 'package:mqtt_client/mqtt_client.dart';
import 'package:mqtt_client/mqtt_server_client.dart'; import 'package:mqtt_client/mqtt_server_client.dart';
import 'package:tablet_app/Helpers/DeviceInfoHelper.dart'; import 'package:tablet_app/Helpers/DeviceInfoHelper.dart';
@ -20,8 +18,9 @@ class MQTTHelper {
print('Connected !!!!!!!!!!!! ----------------------------------'); print('Connected !!!!!!!!!!!! ----------------------------------');
TabletAppContext tabletAppContext = appContext.getContext(); TabletAppContext tabletAppContext = appContext.getContext();
tabletAppContext.clientMQTT.updates.listen((List<MqttReceivedMessage<MqttMessage>> c) async { tabletAppContext.clientMQTT!.updates!.listen((List<MqttReceivedMessage<MqttMessage>> c) async {
final MqttPublishMessage message = c[0].payload; final MqttPublishMessage message = c[0].payload as MqttPublishMessage;
final payload = MqttPublishPayload.bytesToStringAsString(message.payload.message); final payload = MqttPublishPayload.bytesToStringAsString(message.payload.message);
print('Received message:$payload from topic: ${c[0].topic}'); print('Received message:$payload from topic: ${c[0].topic}');
@ -36,14 +35,14 @@ class MQTTHelper {
print("Check if tablet config"); print("Check if tablet config");
print(tabletAppContext.configuration); print(tabletAppContext.configuration);
if (tabletAppContext.configuration != null) { if (tabletAppContext.configuration != null) {
if (tabletAppContext.configuration.id == configId) { if (tabletAppContext.configuration!.id == configId) {
// refresh config // refresh config
try { try {
PlayerMessageDTO playerMessage = PlayerMessageDTO.fromJson(jsonDecode(payload)); PlayerMessageDTO playerMessage = PlayerMessageDTO.fromJson(jsonDecode(payload))!;
var isConfigChanged = playerMessage.configChanged != null ? playerMessage.configChanged : false; var isConfigChanged = playerMessage.configChanged != null ? playerMessage.configChanged : false;
var isDeleted = playerMessage.isDeleted != null ? playerMessage.isDeleted : false; var isDeleted = playerMessage.isDeleted != null ? playerMessage.isDeleted : false;
print(isDeleted); print(isDeleted);
if (isDeleted) { if (isDeleted!) {
// Clear all // Clear all
print("isDeleted"); print("isDeleted");
tabletAppContext.configuration = null; tabletAppContext.configuration = null;
@ -52,7 +51,7 @@ class MQTTHelper {
await DatabaseHelper.instance.update(tabletAppContext); await DatabaseHelper.instance.update(tabletAppContext);
} else { } else {
if (isConfigChanged) { if (isConfigChanged!) {
updateConfig(appContext); updateConfig(appContext);
} }
} }
@ -70,9 +69,9 @@ class MQTTHelper {
// refresh device info // refresh device info
try { try {
PlayerMessageDTO playerMessage = PlayerMessageDTO.fromJson(jsonDecode(payload)); PlayerMessageDTO playerMessage = PlayerMessageDTO.fromJson(jsonDecode(payload))!;
var isConfigChanged = playerMessage.configChanged != null ? playerMessage.configChanged : false; var isConfigChanged = playerMessage.configChanged != null ? playerMessage.configChanged : false;
if (isConfigChanged) { if (isConfigChanged!) {
updateDevice(appContext); updateDevice(appContext);
} }
} }
@ -109,19 +108,19 @@ class MQTTHelper {
var identifier = await DeviceInfoHelper.getDeviceDetails(); var identifier = await DeviceInfoHelper.getDeviceDetails();
var hostToTake = tabletAppContext.host; var hostToTake = tabletAppContext.host;
if(tabletAppContext.host.lastIndexOf(":") > 5) if(tabletAppContext.host!.lastIndexOf(":") > 5)
{ {
hostToTake = tabletAppContext.host.substring(0,tabletAppContext.host.lastIndexOf(":")); hostToTake = tabletAppContext.host!.substring(0,tabletAppContext.host!.lastIndexOf(":"));
} }
tabletAppContext.clientMQTT = MqttServerClient.withPort(hostToTake.replaceAll('http://', ''), 'tablet_app_'+identifier, 1883); tabletAppContext.clientMQTT = MqttServerClient.withPort(hostToTake!.replaceAll('http://', ''), 'tablet_app_'+identifier!, 1883);
isInstantiated = true; isInstantiated = true;
tabletAppContext.clientMQTT.logging(on: false); tabletAppContext.clientMQTT!.logging(on: false);
tabletAppContext.clientMQTT.keepAlivePeriod = 20; tabletAppContext.clientMQTT!.keepAlivePeriod = 20;
tabletAppContext.clientMQTT.onDisconnected = onDisconnected; tabletAppContext.clientMQTT!.onDisconnected = onDisconnected;
tabletAppContext.clientMQTT.onConnected = () => onConnected(appContext); tabletAppContext.clientMQTT!.onConnected = () => onConnected(appContext);
tabletAppContext.clientMQTT.onSubscribed = onSubscribed; tabletAppContext.clientMQTT!.onSubscribed = onSubscribed;
var message = { var message = {
"deviceId": tabletAppContext.deviceId != null ? tabletAppContext.deviceId : identifier, "deviceId": tabletAppContext.deviceId != null ? tabletAppContext.deviceId : identifier,
@ -132,23 +131,23 @@ class MQTTHelper {
.keepAliveFor(60) .keepAliveFor(60)
.withWillTopic('player/status') .withWillTopic('player/status')
.withWillMessage(jsonEncode(message)) .withWillMessage(jsonEncode(message))
.withClientIdentifier('tablet_app_'+identifier) .withClientIdentifier('tablet_app_'+identifier!)
.startClean() .startClean()
.withWillQos(MqttQos.atLeastOnce); .withWillQos(MqttQos.atLeastOnce);
tabletAppContext.clientMQTT.connectionMessage = connMessage; tabletAppContext.clientMQTT!.connectionMessage = connMessage;
tabletAppContext.clientMQTT.autoReconnect = true; tabletAppContext.clientMQTT!.autoReconnect = true;
try { try {
await tabletAppContext.clientMQTT.connect(); await tabletAppContext.clientMQTT!.connect();
// For get config changed request // For get config changed request
if(tabletAppContext.configuration != null) { if(tabletAppContext.configuration != null) {
tabletAppContext.clientMQTT.subscribe('config/#', MqttQos.atLeastOnce); tabletAppContext.clientMQTT!.subscribe('config/#', MqttQos.atLeastOnce);
} }
// For get device assignation config request // For get device assignation config request
if(tabletAppContext.deviceId != null) { if(tabletAppContext.deviceId != null) {
tabletAppContext.clientMQTT.subscribe('player/${tabletAppContext.deviceId}', MqttQos.atLeastOnce); tabletAppContext.clientMQTT!.subscribe('player/${tabletAppContext.deviceId}', MqttQos.atLeastOnce);
var message = { var message = {
"deviceId": tabletAppContext.deviceId, "deviceId": tabletAppContext.deviceId,
@ -159,21 +158,21 @@ class MQTTHelper {
final builder = MqttClientPayloadBuilder(); final builder = MqttClientPayloadBuilder();
builder.addString(jsonEncode(message)); builder.addString(jsonEncode(message));
tabletAppContext.clientMQTT.publishMessage(pubTopic, MqttQos.atLeastOnce, builder.payload); tabletAppContext.clientMQTT!.publishMessage(pubTopic, MqttQos.atLeastOnce, builder.payload!);
} }
} catch (e) { } catch (e) {
print('Exception: $e'); print('Exception: $e');
tabletAppContext.clientMQTT.disconnect(); tabletAppContext.clientMQTT!.disconnect();
} }
return tabletAppContext.clientMQTT; return tabletAppContext.clientMQTT!;
} }
Future<void> updateDevice(dynamic appContext) async { Future<void> updateDevice(dynamic appContext) async {
print("updateDevice"); print("updateDevice");
TabletAppContext tabletAppContext = appContext.getContext(); TabletAppContext tabletAppContext = appContext.getContext();
DeviceDetailDTO device = await tabletAppContext.clientAPI.deviceApi.deviceGetDetail(tabletAppContext.deviceId); DeviceDetailDTO? device = await tabletAppContext.clientAPI!.deviceApi!.deviceGetDetail(tabletAppContext.deviceId!);
print(device); print(device);
@ -181,7 +180,7 @@ class MQTTHelper {
// STORE IT LOCALLY !! // STORE IT LOCALLY !!
TabletAppContext tabletAppContext = appContext.getContext(); TabletAppContext tabletAppContext = appContext.getContext();
tabletAppContext.deviceId = device.id; tabletAppContext.deviceId = device.id;
tabletAppContext.configuration.id = device.configurationId; tabletAppContext.configuration!.id = device.configurationId;
appContext.setContext(tabletAppContext); appContext.setContext(tabletAppContext);
@ -214,15 +213,15 @@ class MQTTHelper {
print("update config"); print("update config");
TabletAppContext tabletAppContext = appContext.getContext(); TabletAppContext tabletAppContext = appContext.getContext();
ConfigurationDTO configuration = await tabletAppContext.clientAPI.configurationApi.configurationGetDetail(tabletAppContext.configuration.id); ConfigurationDTO? configuration = await tabletAppContext.clientAPI!.configurationApi!.configurationGetDetail(tabletAppContext.configuration!.id!);
if (configuration != null) { if (configuration != null) {
// STORE IT LOCALLY !! // STORE IT LOCALLY !!
TabletAppContext tabletAppContext = appContext.getContext(); TabletAppContext tabletAppContext = appContext.getContext();
tabletAppContext.configuration = configuration; tabletAppContext.configuration = configuration;
if(!configuration.languages.contains(tabletAppContext.language)) { if(!configuration.languages!.contains(tabletAppContext.language)) {
tabletAppContext.language = configuration.languages[0]; tabletAppContext.language = configuration.languages![0];
} }
appContext.setContext(tabletAppContext); appContext.setContext(tabletAppContext);

View File

@ -1,9 +1,9 @@
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
class ResponseSubDTO { class ResponseSubDTO {
List<TranslationDTO> label; List<TranslationDTO>? label;
bool isGood; bool? isGood;
int order; int? order;
ResponseSubDTO({this.label, this.isGood, this.order}); ResponseSubDTO({this.label, this.isGood, this.order});
@ -25,12 +25,12 @@ class ResponseSubDTO {
} }
class QuestionSubDTO { class QuestionSubDTO {
List<TranslationDTO> label; List<TranslationDTO>? label;
List<ResponseSubDTO> responsesSubDTO; List<ResponseSubDTO>? responsesSubDTO;
int chosen; int? chosen;
String resourceId; String? resourceId;
String source_; String? source_;
int order; int? order;
QuestionSubDTO({this.label, this.responsesSubDTO, this.chosen, this.resourceId, this.source_, this.order}); QuestionSubDTO({this.label, this.responsesSubDTO, this.chosen, this.resourceId, this.source_, this.order});
@ -41,7 +41,7 @@ class QuestionSubDTO {
questionSubDTO.add(new QuestionSubDTO( questionSubDTO.add(new QuestionSubDTO(
chosen: null, chosen: null,
label: questionDTO.label, label: questionDTO.label,
responsesSubDTO: ResponseSubDTO().fromJSON(questionDTO.responses), responsesSubDTO: ResponseSubDTO().fromJSON(questionDTO.responses!),
resourceId: questionDTO.resourceId, resourceId: questionDTO.resourceId,
source_: questionDTO.source_, source_: questionDTO.source_,
order: questionDTO.order, order: questionDTO.order,

View File

@ -1,12 +1,12 @@
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
class MapMarker { class MapMarker {
int id; int? id;
String title; String? title;
String description; String? description;
List<ImageGeoPoint> images; List<ImageGeoPoint>? images;
String latitude; String? latitude;
String longitude; String? longitude;
MapMarker({this.id, this.title, this.description, this.images, this.latitude, this.longitude}); MapMarker({this.id, this.title, this.description, this.images, this.latitude, this.longitude});

View File

@ -1,9 +1,9 @@
class Section { class Section {
int id; int? id;
String title; String? title;
String description; String? description;
String image; String? image;
int category; int? category;
Section({this.id, this.title, this.description, this.image, this.category}); Section({this.id, this.title, this.description, this.image, this.category});

View File

@ -1,18 +1,18 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:mqtt_client/mqtt_server_client.dart'; import 'package:mqtt_client/mqtt_server_client.dart';
import 'package:tablet_app/client.dart'; import 'package:tablet_app/client.dart';
import 'dart:convert'; import 'dart:convert';
class TabletAppContext with ChangeNotifier{ class TabletAppContext with ChangeNotifier{
Client clientAPI; Client? clientAPI;
MqttServerClient clientMQTT; MqttServerClient? clientMQTT;
String id; String? id;
String host; String? host;
ConfigurationDTO configuration; ConfigurationDTO? configuration;
String language; String? language;
String deviceId; String? deviceId;
TabletAppContext({this.id, this.deviceId, this.host, this.configuration, this.language}); TabletAppContext({this.id, this.deviceId, this.host, this.configuration, this.language});
@ -21,7 +21,7 @@ class TabletAppContext with ChangeNotifier{
'id': id, 'id': id,
'deviceId': deviceId, 'deviceId': deviceId,
'host': host, 'host': host,
'configuration': configuration == null ? null : jsonEncode(configuration.toJson()), 'configuration': configuration == null ? null : jsonEncode(configuration!.toJson()),
'language': language 'language': language
}; };
} }

View File

@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:fluttertoast/fluttertoast.dart'; import 'package:fluttertoast/fluttertoast.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:mqtt_client/mqtt_server_client.dart'; import 'package:mqtt_client/mqtt_server_client.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tablet_app/Components/Buttons/rounded_button.dart'; import 'package:tablet_app/Components/Buttons/rounded_button.dart';
@ -30,7 +30,7 @@ class ConfigViewWidget extends StatefulWidget {
class _ConfigViewWidget extends State<ConfigViewWidget> { class _ConfigViewWidget extends State<ConfigViewWidget> {
Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution
String url = "http://192.168.1.19"; //DEV "http://192.168.31.96" http://192.168.31.140:8089 String url = "https://api.mymuseum.be"; //DEV "http://192.168.31.96" http://192.168.31.140:8089 // PROD MDLF "http://192.168.1.19"
bool configOk = false; bool configOk = false;
@override @override
@ -41,7 +41,7 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
TabletAppContext tabletAppContext = appContext.getContext(); TabletAppContext tabletAppContext = appContext.getContext();
if (tabletAppContext != null) { if (tabletAppContext != null) {
if (tabletAppContext.host != null) if (tabletAppContext.host != null)
url = tabletAppContext.host; url = tabletAppContext.host!;
} }
return Scaffold( return Scaffold(
body: Container( body: Container(
@ -164,8 +164,11 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
tabletAppContext.host = url; tabletAppContext.host = url;
tabletAppContext.clientAPI = client; tabletAppContext.clientAPI = client;
var identifier = await DeviceInfoHelper.getDeviceDetails(); // Add if web TODO
tabletAppContext.clientMQTT = new MqttServerClient(url.replaceAll('http://', ''),'tablet_app_'+identifier); //var identifier = await DeviceInfoHelper.getDeviceDetails();
var identifier = "WEB TEST";
// TODO WEB !
// tabletAppContext.clientMQTT = new MqttServerClient(url.replaceAll('http://', ''),'tablet_app_'+identifier);
setState(() { setState(() {
appContext.setContext(tabletAppContext); appContext.setContext(tabletAppContext);
configOk = true; configOk = true;
@ -199,14 +202,15 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
newDevice.configurationId = configurationDTO.id; newDevice.configurationId = configurationDTO.id;
newDevice.configuration = configurationDTO.label; newDevice.configuration = configurationDTO.label;
newDevice.connected = true; newDevice.connected = true;
newDevice.identifier = await DeviceInfoHelper.getDeviceDetails(); //newDevice.identifier = await DeviceInfoHelper.getDeviceDetails(); // TODO WEB
newDevice.ipAddressWLAN = await getIP(true); //newDevice.ipAddressWLAN = await getIP(true);
newDevice.ipAddressETH = await getIP(false); //newDevice.ipAddressETH = await getIP(false);
newDevice.name = newDevice.ipAddressWLAN; //newDevice.name = newDevice.ipAddressWLAN;
newDevice.name = "WEB TEST";
print(newDevice); print(newDevice);
DeviceDetailDTO device = await tabletAppContext.clientAPI.deviceApi.deviceCreate(newDevice); DeviceDetailDTO? device = await tabletAppContext.clientAPI!.deviceApi!.deviceCreate(newDevice);
if (device != null) { if (device != null) {
// STORE IT LOCALLY !! // STORE IT LOCALLY !!
@ -251,7 +255,7 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
isValidApi(Client client) async { isValidApi(Client client) async {
print("TEST URL"); print("TEST URL");
try { try {
var configs = await client.configurationApi.configurationGet(); var configs = await client.configurationApi!.configurationGet();
return configs != null; return configs != null;
} catch (ex) { } catch (ex) {
print(ex); print(ex);
@ -260,7 +264,7 @@ class _ConfigViewWidget extends State<ConfigViewWidget> {
} }
} }
Future<String> getIP(bool isWLAN) async { Future<String?> getIP(bool isWLAN) async {
for (var interface in await NetworkInterface.list()) { for (var interface in await NetworkInterface.list()) {
print('== Interface: ${interface.name} =='); print('== Interface: ${interface.name} ==');
if (interface.name == "wlan0" && isWLAN) { if (interface.name == "wlan0" && isWLAN) {
@ -284,7 +288,7 @@ boxDecoration(SectionDTO section) {
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop), colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop),
image: new NetworkImage( image: new NetworkImage(
section.imageSource, section.imageSource!,
), ),
), ),
boxShadow: [ boxShadow: [
@ -299,6 +303,7 @@ boxDecoration(SectionDTO section) {
} }
Future<List<ConfigurationDTO>> getConfigurations(dynamic appContext) async { Future<List<ConfigurationDTO>> getConfigurations(dynamic appContext) async {
List<ConfigurationDTO> configurations = await appContext.getContext().clientAPI.configurationApi.configurationGet(); List<ConfigurationDTO> configurations = await appContext.getContext().clientAPI.configurationApi.configurationGet();
print("number of configurations " + configurations.length.toString()); print("number of configurations " + configurations.length.toString());
configurations.forEach((element) { configurations.forEach((element) {

View File

@ -1,14 +1,14 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tablet_app/app_context.dart'; import 'package:tablet_app/app_context.dart';
import 'package:tablet_app/constants.dart'; import 'package:tablet_app/constants.dart';
class DropDownConfig extends StatefulWidget { class DropDownConfig extends StatefulWidget {
final List<ConfigurationDTO> configurations; final List<ConfigurationDTO>? configurations;
final ValueChanged<ConfigurationDTO> onChange; final ValueChanged<ConfigurationDTO>? onChange;
const DropDownConfig({ const DropDownConfig({
Key key, Key? key,
this.configurations, this.configurations,
this.onChange, this.onChange,
}) : super(key: key); }) : super(key: key);
@ -18,7 +18,7 @@ class DropDownConfig extends StatefulWidget {
} }
class _DropDownConfigState extends State<DropDownConfig> { class _DropDownConfigState extends State<DropDownConfig> {
ConfigurationDTO configurationDTO; ConfigurationDTO configurationDTO = ConfigurationDTO();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -34,16 +34,16 @@ class _DropDownConfigState extends State<DropDownConfig> {
height: 2, height: 2,
color: kMainRed, // TODO CHANGEEEEE color: kMainRed, // TODO CHANGEEEEE
), ),
onChanged: (ConfigurationDTO newValue) { onChanged: (ConfigurationDTO? newValue) {
setState(() { setState(() {
configurationDTO = newValue; configurationDTO = newValue!;
widget.onChange(configurationDTO); widget.onChange!(configurationDTO);
}); });
}, },
items: widget.configurations.map<DropdownMenuItem<ConfigurationDTO>>((ConfigurationDTO value) { items: widget.configurations!.map<DropdownMenuItem<ConfigurationDTO>>((ConfigurationDTO value) {
return DropdownMenuItem<ConfigurationDTO>( return DropdownMenuItem<ConfigurationDTO>(
value: value, value: value,
child: Text(value.label, style: TextStyle(fontSize: 20, fontWeight: FontWeight.w400)), child: Text(value.label!, style: TextStyle(fontSize: 20, fontWeight: FontWeight.w400)),
); );
}).toList(), }).toList(),
); );

View File

@ -13,20 +13,20 @@ class LanguageSelection extends StatefulWidget {
} }
class _LanguageSelection extends State<LanguageSelection> with TickerProviderStateMixin { class _LanguageSelection extends State<LanguageSelection> with TickerProviderStateMixin {
List<String> languagesEnable; List<String>? languagesEnable;
Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution
double flagSize = 60; double flagSize = 60;
String selectedLanguage; String? selectedLanguage;
double elementMinimizedSize; double? elementMinimizedSize;
bool minimized = false; bool minimized = false;
double _leftLanguage; double? _leftLanguage;
double _topLanguage; double? _topLanguage;
double _rightLanguage; double? _rightLanguage;
double _bottomLanguage; double? _bottomLanguage;
AnimationController _controller; AnimationController? _controller;
@override @override
void initState() { void initState() {
@ -39,14 +39,14 @@ class _LanguageSelection extends State<LanguageSelection> with TickerProviderSta
_controller = AnimationController( _controller = AnimationController(
value: 12, vsync: this, duration: Duration(seconds: 1)); value: 12, vsync: this, duration: Duration(seconds: 1));
_controller.animateBack(0); _controller!.animateBack(0);
super.initState(); super.initState();
} }
@override @override
void dispose() { void dispose() {
_controller.dispose(); _controller!.dispose();
super.dispose(); super.dispose();
} }
@ -55,7 +55,7 @@ class _LanguageSelection extends State<LanguageSelection> with TickerProviderSta
final appContext = Provider.of<AppContext>(context); final appContext = Provider.of<AppContext>(context);
Size size = MediaQuery.of(context).size; Size size = MediaQuery.of(context).size;
selectedLanguage = (appContext.getContext() as TabletAppContext).language; selectedLanguage = (appContext.getContext() as TabletAppContext).language;
languagesEnable = (appContext.getContext() as TabletAppContext).configuration.languages; languagesEnable = (appContext.getContext() as TabletAppContext).configuration!.languages;
return Stack( return Stack(
children: [ children: [
@ -71,7 +71,7 @@ class _LanguageSelection extends State<LanguageSelection> with TickerProviderSta
child: Container( child: Container(
height: size.height *0.07,//size.height *0.07, height: size.height *0.07,//size.height *0.07,
width: size.width *0.07,//size.width *0.07, width: size.width *0.07,//size.width *0.07,
decoration: flagDecoration(selectedLanguage), decoration: flagDecoration(selectedLanguage!),
), ),
), ),
) )
@ -88,7 +88,7 @@ class _LanguageSelection extends State<LanguageSelection> with TickerProviderSta
ListView( ListView(
children: [ children: [
if(minimized) ... [ if(minimized) ... [
for(var language in languagesEnable.where((element) => element.toUpperCase() != selectedLanguage )) for(var language in languagesEnable!.where((element) => element.toUpperCase() != selectedLanguage ))
InkWell( InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
@ -121,9 +121,9 @@ class _LanguageSelection extends State<LanguageSelection> with TickerProviderSta
minimizedAnimation(Size size) { minimizedAnimation(Size size) {
minimized = !minimized; minimized = !minimized;
if (minimized) { if (minimized) {
_controller.animateBack(15.0); _controller!.animateBack(15.0);
} else { } else {
_controller.animateBack(0.0); _controller!.animateBack(0.0);
} }
setState(() { setState(() {
_leftLanguage = size.width - (size.width *0.07); //size.width - size.width *0.07; _leftLanguage = size.width - (size.width *0.07); //size.width - size.width *0.07;

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tablet_app/Components/loading.dart'; import 'package:tablet_app/Components/loading.dart';
import 'package:tablet_app/Helpers/MQTTHelper.dart'; import 'package:tablet_app/Helpers/MQTTHelper.dart';
@ -30,7 +30,7 @@ class MainViewWidget extends StatefulWidget {
class _MainViewWidget extends State<MainViewWidget> { class _MainViewWidget extends State<MainViewWidget> {
Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution
SectionDTO sectionSelected; SectionDTO? sectionSelected;
int rowCount = 4; int rowCount = 4;
@ -45,7 +45,7 @@ class _MainViewWidget extends State<MainViewWidget> {
if(sectionSelected != null) { if(sectionSelected != null) {
var elementToShow; var elementToShow;
switch (sectionSelected.type) { switch (sectionSelected!.type) {
case SectionType.map : // MAP case SectionType.map : // MAP
elementToShow = ChangeNotifierProvider<MapContext>( elementToShow = ChangeNotifierProvider<MapContext>(
create: (_) => create: (_) =>
@ -54,7 +54,7 @@ class _MainViewWidget extends State<MainViewWidget> {
longitude: null, longitude: null,
title: '', title: '',
description: '')), description: '')),
child: MapViewWidget(section: sectionSelected) /*FutureBuilder( child: MapViewWidget(section: sectionSelected!) /*FutureBuilder(
future: _url, future: _url,
builder: (BuildContext context, AsyncSnapshot snapshot) => snapshot.hasData builder: (BuildContext context, AsyncSnapshot snapshot) => snapshot.hasData
? WebViewWidget(url: snapshot.data,) ? WebViewWidget(url: snapshot.data,)
@ -62,7 +62,7 @@ class _MainViewWidget extends State<MainViewWidget> {
); );
break; break;
case SectionType.web : // WEB case SectionType.web : // WEB
elementToShow = WebViewWidget(section: sectionSelected); elementToShow = WebView(section: sectionSelected);
break; break;
case SectionType.video : // Video case SectionType.video : // Video
elementToShow = VideoViewWidget(section: sectionSelected); elementToShow = VideoViewWidget(section: sectionSelected);
@ -71,7 +71,7 @@ class _MainViewWidget extends State<MainViewWidget> {
elementToShow = SliderViewWidget(section: sectionSelected); elementToShow = SliderViewWidget(section: sectionSelected);
break; break;
case SectionType.menu : case SectionType.menu :
elementToShow = MenuViewWidget(section: sectionSelected); elementToShow = MenuViewWidget(section: sectionSelected!);
break; break;
case SectionType.quizz : case SectionType.quizz :
elementToShow = QuizzViewWidget(section: sectionSelected); elementToShow = QuizzViewWidget(section: sectionSelected);
@ -100,7 +100,7 @@ class _MainViewWidget extends State<MainViewWidget> {
child: Container( child: Container(
/*width: 125, /*width: 125,
height: 125,*/ height: 125,*/
decoration: boxDecoration(sectionSelected, true), decoration: boxDecoration(sectionSelected!, true),
), ),
), ),
), ),
@ -117,7 +117,7 @@ class _MainViewWidget extends State<MainViewWidget> {
child: Align( child: Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: AutoSizeText( child: AutoSizeText(
sectionSelected.title.firstWhere((translation) => translation.language == appContext.getContext().language).value, sectionSelected!.title!.firstWhere((translation) => translation.language == appContext.getContext().language).value!,
style: new TextStyle(fontSize: kSectionTitleDetailSize), style: new TextStyle(fontSize: kSectionTitleDetailSize),
maxLines: 1, maxLines: 1,
), ),
@ -127,7 +127,7 @@ class _MainViewWidget extends State<MainViewWidget> {
child: Align( child: Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: AutoSizeText( child: AutoSizeText(
sectionSelected.description.firstWhere((translation) => translation.language == appContext.getContext().language).value, sectionSelected!.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value!,
style: new TextStyle(fontSize: kSectionDescriptionDetailSize), style: new TextStyle(fontSize: kSectionDescriptionDetailSize),
maxLines: 2, maxLines: 2,
), ),
@ -140,11 +140,11 @@ class _MainViewWidget extends State<MainViewWidget> {
), ),
), ),
Padding( Padding(
padding: sectionSelected.type != SectionType.slider ? const EdgeInsets.only(left: 15.0, right: 15.0, top: 15.0) : const EdgeInsets.only(top: 15.0), padding: sectionSelected!.type != SectionType.slider ? const EdgeInsets.only(left: 15.0, right: 15.0, top: 15.0) : const EdgeInsets.only(top: 15.0),
child: Container( child: Container(
width: size.width, width: size.width,
height: size.height * 0.85, height: size.height * 0.85,
decoration: sectionSelected.type != SectionType.video && sectionSelected.type != SectionType.web && sectionSelected.type != SectionType.slider && sectionSelected.type != SectionType.map ? BoxDecoration( decoration: sectionSelected!.type != SectionType.video && sectionSelected!.type != SectionType.web && sectionSelected!.type != SectionType.slider && sectionSelected!.type != SectionType.map ? BoxDecoration(
color: kBackgroundLight, color: kBackgroundLight,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(30.0), borderRadius: BorderRadius.circular(30.0),
@ -270,11 +270,11 @@ class _MainViewWidget extends State<MainViewWidget> {
} }
} }
Future<List<SectionDTO>> getSections(dynamic appContext) async { Future<List<SectionDTO>?> getSections(dynamic appContext) async {
TabletAppContext tabletAppContext = await appContext.getContext(); TabletAppContext tabletAppContext = await appContext.getContext();
try { try {
List<SectionDTO> sections = await tabletAppContext.clientAPI.sectionApi.sectionGetFromConfiguration(tabletAppContext.configuration.id); List<SectionDTO>? sections = await tabletAppContext.clientAPI!.sectionApi!.sectionGetFromConfiguration(tabletAppContext.configuration!.id!);
sections.sort((a, b) => a.order.compareTo(b.order)); sections!.sort((a, b) => a.order!.compareTo(b.order!));
return sections; return sections;
} catch (e) { } catch (e) {
print(e); print(e);
@ -301,7 +301,7 @@ boxDecoration(SectionDTO section, bool isSelected) {
fit: !isSelected? BoxFit.cover : BoxFit.contain, fit: !isSelected? BoxFit.cover : BoxFit.contain,
colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop) : null, colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop) : null,
image: new NetworkImage( image: new NetworkImage(
section.imageSource, section.imageSource!,
), ),
): null, ): null,
boxShadow: [ boxShadow: [

View File

@ -3,17 +3,17 @@ import 'dart:typed_data';
import 'package:enum_to_string/enum_to_string.dart'; import 'package:enum_to_string/enum_to_string.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tablet_app/Models/map-marker.dart'; import 'package:tablet_app/Models/map-marker.dart';
import 'package:tablet_app/Screens/Map/map_context.dart'; import 'package:tablet_app/Screens/Map/map_context.dart';
class GoogleMapView extends StatefulWidget { class GoogleMapView extends StatefulWidget {
final MapDTO mapDTO; final MapDTO? mapDTO;
final Uint8List selectedMarkerIcon; final Uint8List? selectedMarkerIcon;
final String language; final String? language;
const GoogleMapView({ const GoogleMapView({
Key key, Key? key,
this.mapDTO, this.mapDTO,
this.selectedMarkerIcon, this.selectedMarkerIcon,
this.language, this.language,
@ -24,19 +24,19 @@ class GoogleMapView extends StatefulWidget {
} }
class _GoogleMapViewState extends State<GoogleMapView> { class _GoogleMapViewState extends State<GoogleMapView> {
ConfigurationDTO configurationDTO; ConfigurationDTO? configurationDTO;
Completer<GoogleMapController> _controller = Completer(); Completer<GoogleMapController> _controller = Completer();
Set<Marker> markers = {}; Set<Marker> markers = {};
List<MapMarker> markersList = List(); List<MapMarker> markersList = [];
Set<Marker> getMarkers(language, mapContext) { Set<Marker> getMarkers(language, mapContext) {
markers = {}; markers = {};
widget.mapDTO.points.forEach((point) { widget.mapDTO!.points!.forEach((point) {
var mapMarker = new MapMarker( var mapMarker = new MapMarker(
id: point.id, id: point.id,
title: point.title.firstWhere((translation) => translation.language == language).value, title: point.title!.firstWhere((translation) => translation.language == language).value,
description: point.description.firstWhere((translation) => translation.language == language).value, description: point.description!.firstWhere((translation) => translation.language == language).value,
longitude: point.longitude, longitude: point.longitude,
latitude: point.latitude, latitude: point.latitude,
images: point.images images: point.images
@ -48,12 +48,12 @@ class _GoogleMapViewState extends State<GoogleMapView> {
if (element.latitude != null && element.longitude != null) { if (element.latitude != null && element.longitude != null) {
markers.add(Marker( markers.add(Marker(
draggable: false, draggable: false,
markerId: MarkerId(element.latitude + element.longitude), markerId: MarkerId(element.latitude! + element.longitude!),
position: LatLng( position: LatLng(
double.tryParse(element.latitude), double.tryParse(element.latitude!)!,
double.tryParse(element.longitude), double.tryParse(element.longitude!)!,
), ),
icon: BitmapDescriptor.fromBytes(widget.selectedMarkerIcon), icon: BitmapDescriptor.fromBytes(widget.selectedMarkerIcon!),
/*icon: BitmapDescriptor.defaultMarkerWithHue( /*icon: BitmapDescriptor.defaultMarkerWithHue(
BitmapDescriptor.hueYellow, BitmapDescriptor.hueYellow,
),*/ ),*/
@ -93,11 +93,11 @@ class _GoogleMapViewState extends State<GoogleMapView> {
Size size = MediaQuery.of(context).size; Size size = MediaQuery.of(context).size;
return GoogleMap( return GoogleMap(
mapType: widget.mapDTO.mapType != null ? EnumToString.fromString(MapType.values, widget.mapDTO.mapType.toString()): MapType.hybrid, mapType: widget.mapDTO!.mapType != null ? EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString())!: MapType.hybrid,
mapToolbarEnabled: false, mapToolbarEnabled: false,
initialCameraPosition: CameraPosition( initialCameraPosition: CameraPosition(
target: LatLng(50.416639, 4.879169), target: LatLng(50.416639, 4.879169),
zoom: widget.mapDTO.zoom != null ? widget.mapDTO.zoom.toDouble() : 18, zoom: widget.mapDTO!.zoom != null ? widget.mapDTO!.zoom!.toDouble() : 18,
), ),
onMapCreated: (GoogleMapController controller) { onMapCreated: (GoogleMapController controller) {
_controller.complete(controller); _controller.complete(controller);

View File

@ -4,7 +4,7 @@ import 'dart:typed_data';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tablet_app/Components/loading.dart'; import 'package:tablet_app/Components/loading.dart';
import 'package:tablet_app/Models/map-marker.dart'; import 'package:tablet_app/Models/map-marker.dart';
@ -16,20 +16,20 @@ import '../../app_context.dart';
import 'google_map_view.dart'; import 'google_map_view.dart';
Set<Marker> markers = {}; Set<Marker> markers = {};
List<MapMarker> markersList = List(); List<MapMarker> markersList = [];
class MapViewWidget extends StatefulWidget { class MapViewWidget extends StatefulWidget {
final SectionDTO section; final SectionDTO? section;
MapViewWidget({Key key, this.section}) : super(key: key); MapViewWidget({Key? key, this.section}) : super(key: key);
@override @override
_MapViewWidget createState() => _MapViewWidget(); _MapViewWidget createState() => _MapViewWidget();
} }
class _MapViewWidget extends State<MapViewWidget> { class _MapViewWidget extends State<MapViewWidget> {
MapDTO mapDTO; MapDTO? mapDTO;
Completer<GoogleMapController> _controller = Completer(); Completer<GoogleMapController> _controller = Completer();
Uint8List selectedMarkerIcon; Uint8List? selectedMarkerIcon;
Future<Uint8List> getBytesFromAsset(ByteData data, int width) async { Future<Uint8List> getBytesFromAsset(ByteData data, int width) async {
//ByteData data = await rootBundle.load(path); //ByteData data = await rootBundle.load(path);
@ -37,14 +37,14 @@ class _MapViewWidget extends State<MapViewWidget> {
targetWidth: width); targetWidth: width);
ui.FrameInfo fi = await codec.getNextFrame(); ui.FrameInfo fi = await codec.getNextFrame();
return (await fi.image.toByteData(format: ui.ImageByteFormat.png)) return (await fi.image.toByteData(format: ui.ImageByteFormat.png))
.buffer !.buffer
.asUint8List(); .asUint8List();
} }
@override @override
void initState() { void initState() {
print(widget.section.data); print(widget.section!.data);
mapDTO = MapDTO.fromJson(jsonDecode(widget.section.data)); mapDTO = MapDTO.fromJson(jsonDecode(widget.section!.data!));
print(mapDTO); print(mapDTO);
super.initState(); super.initState();
@ -69,10 +69,10 @@ class _MapViewWidget extends State<MapViewWidget> {
return Stack( return Stack(
children: <Widget>[ children: <Widget>[
FutureBuilder( FutureBuilder(
future: getByteIcon(mapDTO.iconSource), future: getByteIcon(mapDTO!.iconSource!),
builder: (context, AsyncSnapshot<dynamic> snapshot) { builder: (context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState == ConnectionState.done) { if (snapshot.connectionState == ConnectionState.done) {
return GoogleMapView(language: appContext.getContext().language, mapDTO: mapDTO, selectedMarkerIcon: selectedMarkerIcon); return GoogleMapView(language: appContext.getContext().language, mapDTO: mapDTO!, selectedMarkerIcon: selectedMarkerIcon);
} else if (snapshot.connectionState == ConnectionState.none) { } else if (snapshot.connectionState == ConnectionState.none) {
return Text("No data"); return Text("No data");
} else { } else {

View File

@ -16,7 +16,7 @@ class MarkerViewWidget extends StatefulWidget {
class _MarkerInfoWidget extends State<MarkerViewWidget> { class _MarkerInfoWidget extends State<MarkerViewWidget> {
Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution
CarouselController sliderController; CarouselController? sliderController;
int currentIndex = 1; int currentIndex = 1;
@override @override
@ -205,7 +205,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (mapContext.getSelectedMarker().images.length > 0) if (mapContext.getSelectedMarker().images.length > 0)
sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); sliderController!.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
}, },
child: Icon( child: Icon(
Icons.chevron_right, Icons.chevron_right,
@ -221,7 +221,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (mapContext.getSelectedMarker().images.length > 0) if (mapContext.getSelectedMarker().images.length > 0)
sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); sliderController!.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
}, },
child: Icon( child: Icon(
Icons.chevron_left, Icons.chevron_left,

View File

@ -1,7 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tablet_app/Models/map-marker.dart'; import 'package:tablet_app/Models/map-marker.dart';
import 'package:tablet_app/Screens/Map/map_context.dart'; import 'package:tablet_app/Screens/Map/map_context.dart';
@ -13,7 +13,7 @@ import 'package:tablet_app/app_context.dart';
import 'package:tablet_app/constants.dart'; import 'package:tablet_app/constants.dart';
class MenuViewWidget extends StatefulWidget { class MenuViewWidget extends StatefulWidget {
final SectionDTO section; final SectionDTO? section;
MenuViewWidget({this.section}); MenuViewWidget({this.section});
@override @override
@ -21,12 +21,12 @@ class MenuViewWidget extends StatefulWidget {
} }
class _MenuViewWidget extends State<MenuViewWidget> { class _MenuViewWidget extends State<MenuViewWidget> {
MenuDTO menuDTO; MenuDTO menuDTO = MenuDTO();
SectionDTO selectedSection; SectionDTO? selectedSection;
@override @override
void initState() { void initState() {
print(widget.section.data); print(widget.section!.data);
menuDTO = MenuDTO.fromJson(jsonDecode(widget.section.data)); menuDTO = MenuDTO.fromJson(jsonDecode(widget.section!.data!))!;
print(menuDTO); print(menuDTO);
super.initState(); super.initState();
@ -44,7 +44,7 @@ class _MenuViewWidget extends State<MenuViewWidget> {
if (selectedSection != null) { if (selectedSection != null) {
var elementToShow; var elementToShow;
switch (selectedSection.type) { switch (selectedSection!.type) {
case SectionType.map : case SectionType.map :
elementToShow = ChangeNotifierProvider<MapContext>( elementToShow = ChangeNotifierProvider<MapContext>(
create: (_) => create: (_) =>
@ -61,7 +61,7 @@ class _MenuViewWidget extends State<MenuViewWidget> {
); );
break; break;
case SectionType.web : // WEB case SectionType.web : // WEB
elementToShow = WebViewWidget(section: selectedSection); elementToShow = WebView(section: selectedSection);
break; break;
case SectionType.video : // Video case SectionType.video : // Video
elementToShow = VideoViewWidget(section: selectedSection); elementToShow = VideoViewWidget(section: selectedSection);
@ -79,7 +79,7 @@ class _MenuViewWidget extends State<MenuViewWidget> {
child: Container( child: Container(
width: size.width, width: size.width,
height: size.height * 0.8, height: size.height * 0.8,
decoration: selectedSection.type != SectionType.video && selectedSection.type != SectionType.web && selectedSection.type != SectionType.slider && selectedSection.type != SectionType.map ? BoxDecoration( decoration: selectedSection!.type != SectionType.video && selectedSection!.type != SectionType.web && selectedSection!.type != SectionType.slider && selectedSection!.type != SectionType.map ? BoxDecoration(
color: kBackgroundLight, color: kBackgroundLight,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(30.0), borderRadius: BorderRadius.circular(30.0),
@ -137,16 +137,16 @@ class _MenuViewWidget extends State<MenuViewWidget> {
child: GridView.builder( child: GridView.builder(
shrinkWrap: true, shrinkWrap: true,
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 1.4), gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: 1.4),
itemCount: menuDTO.sections.length, itemCount: menuDTO.sections!.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
selectedSection = menuDTO.sections[index]; selectedSection = menuDTO.sections![index];
}); });
}, },
child: Container( child: Container(
decoration: boxDecoration(menuDTO.sections[index], false), decoration: boxDecoration(menuDTO.sections![index], false),
padding: const EdgeInsets.all(25), padding: const EdgeInsets.all(25),
margin: EdgeInsets.symmetric(vertical: 25, horizontal: 25), margin: EdgeInsets.symmetric(vertical: 25, horizontal: 25),
child: Align( child: Align(
@ -158,7 +158,7 @@ class _MenuViewWidget extends State<MenuViewWidget> {
Align( Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: AutoSizeText( child: AutoSizeText(
menuDTO.sections[index].title.firstWhere((translation) => translation.language == appContext.getContext().language).value, menuDTO.sections![index].title!.firstWhere((translation) => translation.language == appContext.getContext().language).value!,
style: new TextStyle(fontSize: kMenuTitleDetailSize), style: new TextStyle(fontSize: kMenuTitleDetailSize),
maxLines: 1, maxLines: 1,
), ),
@ -166,7 +166,7 @@ class _MenuViewWidget extends State<MenuViewWidget> {
Align( Align(
alignment: Alignment.centerRight, alignment: Alignment.centerRight,
child: AutoSizeText( child: AutoSizeText(
menuDTO.sections[index].description.firstWhere((translation) => translation.language == appContext.getContext().language).value, menuDTO.sections![index].description!.firstWhere((translation) => translation.language == appContext.getContext().language).value!,
style: new TextStyle(fontSize: kSectionDescriptionDetailSize, fontFamily: ""), style: new TextStyle(fontSize: kSectionDescriptionDetailSize, fontFamily: ""),
maxLines: 1, maxLines: 1,
), ),
@ -193,7 +193,7 @@ boxDecoration(SectionDTO section, bool isSelected) {
fit: BoxFit.contain, fit: BoxFit.contain,
colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop) : null, colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop) : null,
image: new NetworkImage( image: new NetworkImage(
section.imageSource, section.imageSource!,
), ),
): null, ): null,
boxShadow: [ boxShadow: [

View File

@ -12,9 +12,9 @@ import '../../constants.dart';
import '../custom_clipper.dart'; import '../custom_clipper.dart';
class PreviousViewWidget extends StatefulWidget { class PreviousViewWidget extends StatefulWidget {
PreviousViewWidget({Key key, this.title}) : super(key: key); PreviousViewWidget({Key? key, this.title}) : super(key: key);
final String title; final String? title;
@override @override
_PreviousViewWidget createState() => _PreviousViewWidget(); _PreviousViewWidget createState() => _PreviousViewWidget();
@ -27,27 +27,27 @@ class _PreviousViewWidget extends State<PreviousViewWidget> with TickerProviderS
double elementMaximizedSize = 400.0; double elementMaximizedSize = 400.0;
bool minimized = false; bool minimized = false;
double _leftMain; double? _leftMain;
double _topMain; double? _topMain;
double _rightMain; double? _rightMain;
double _bottomMain; double? _bottomMain;
double _leftTitle; double? _leftTitle;
double _topTitle; double? _topTitle;
double _rightTitle; double? _rightTitle;
double _bottomTitle; double? _bottomTitle;
double _leftElement; double? _leftElement;
double _topElement; double? _topElement;
double _rightElement; double? _rightElement;
double _bottomElement; double? _bottomElement;
double _leftMenu; double? _leftMenu;
double _topMenu; double? _topMenu;
double _rightMenu; double? _rightMenu;
double _bottomMenu; double? _bottomMenu;
AnimationController _controller; AnimationController? _controller;
Completer<WebViewController> _webViewController = Completer< Completer<WebViewController> _webViewController = Completer<
WebViewController>(); WebViewController>();
@ -77,7 +77,7 @@ class _PreviousViewWidget extends State<PreviousViewWidget> with TickerProviderS
_controller = AnimationController( _controller = AnimationController(
value: 12, vsync: this, duration: Duration(seconds: 1)); value: 12, vsync: this, duration: Duration(seconds: 1));
_controller.animateBack(0); _controller!.animateBack(0);
super.initState(); super.initState();
} }
@ -87,9 +87,9 @@ class _PreviousViewWidget extends State<PreviousViewWidget> with TickerProviderS
minimized = !minimized; minimized = !minimized;
if (minimized) { if (minimized) {
_controller.animateBack(5.0); _controller!.animateBack(5.0);
} else { } else {
_controller.animateBack(0.0); _controller!.animateBack(0.0);
} }
_leftMenu = 0; _leftMenu = 0;
@ -131,7 +131,7 @@ class _PreviousViewWidget extends State<PreviousViewWidget> with TickerProviderS
@override @override
void dispose() { void dispose() {
_controller.dispose(); _controller!.dispose();
super.dispose(); super.dispose();
} }
@ -222,10 +222,10 @@ class _PreviousViewWidget extends State<PreviousViewWidget> with TickerProviderS
child: Padding( child: Padding(
padding: const EdgeInsets.all(5.0), padding: const EdgeInsets.all(5.0),
child: AnimatedBuilder( child: AnimatedBuilder(
animation: _controller, animation: _controller!,
builder: (BuildContext context, Widget child) { builder: (BuildContext context, Widget? child) {
return ClipPath( return ClipPath(
clipper: WaveClipper(move: _controller.value, clipper: WaveClipper(move: _controller!.value,
minimized: minimized, minimized: minimized,
height: _leftMain, height: _leftMain,
width: _topMain), width: _topMain),

View File

@ -4,7 +4,7 @@ import 'package:carousel_slider/carousel_slider.dart';
import 'package:confetti/confetti.dart'; import 'package:confetti/confetti.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tablet_app/Components/Buttons/rounded_button.dart'; import 'package:tablet_app/Components/Buttons/rounded_button.dart';
import 'package:tablet_app/Models/ResponseSubDTO.dart'; import 'package:tablet_app/Models/ResponseSubDTO.dart';
@ -16,8 +16,8 @@ import 'drawStrawberry.dart';
class QuizzViewWidget extends StatefulWidget { class QuizzViewWidget extends StatefulWidget {
final SectionDTO section; final SectionDTO? section;
GlobalKey<ScaffoldState> key; GlobalKey<ScaffoldState>? key;
QuizzViewWidget({this.section, this.key}); QuizzViewWidget({this.section, this.key});
@override @override
@ -25,10 +25,10 @@ class QuizzViewWidget extends StatefulWidget {
} }
class _QuizzViewWidget extends State<QuizzViewWidget> { class _QuizzViewWidget extends State<QuizzViewWidget> {
ConfettiController _controllerCenter; ConfettiController? _controllerCenter;
QuizzDTO quizzDTO; QuizzDTO quizzDTO = QuizzDTO();
List<QuestionSubDTO> _questionsSubDTO = <QuestionSubDTO>[]; List<QuestionSubDTO> _questionsSubDTO = <QuestionSubDTO>[];
CarouselController sliderController; CarouselController? sliderController;
int currentIndex = 1; int currentIndex = 1;
bool showResult = false; bool showResult = false;
bool showResponses = false; bool showResponses = false;
@ -41,12 +41,12 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
sliderController = CarouselController(); sliderController = CarouselController();
quizzDTO = QuizzDTO.fromJson(jsonDecode(widget.section.data)); quizzDTO = QuizzDTO.fromJson(jsonDecode(widget.section!.data!))!;
quizzDTO.questions.sort((a, b) => a.order.compareTo(b.order)); quizzDTO.questions!.sort((a, b) => a.order!.compareTo(b.order!));
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions); _questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions!);
_controllerCenter.play(); _controllerCenter!.play();
} }
@ -54,8 +54,8 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
void dispose() { void dispose() {
sliderController = null; sliderController = null;
currentIndex = 1; currentIndex = 1;
_controllerCenter.dispose(); _controllerCenter!.dispose();
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions); _questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions!);
super.dispose(); super.dispose();
} }
@ -68,12 +68,12 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
{ {
var goodResponses = 0; var goodResponses = 0;
_questionsSubDTO.forEach((question) { _questionsSubDTO.forEach((question) {
if(question.chosen == question.responsesSubDTO.indexWhere((response) => response.isGood)) if(question.chosen == question.responsesSubDTO!.indexWhere((response) => response.isGood!))
goodResponses +=1; goodResponses +=1;
}); });
log("goodResponses =" + goodResponses.toString()); log("goodResponses =" + goodResponses.toString());
var levelToShow; var levelToShow;
var test = goodResponses/quizzDTO.questions.length; var test = goodResponses/quizzDTO.questions!.length;
if(0 == test || test < 0.25) if(0 == test || test < 0.25)
levelToShow = quizzDTO.badLevel; levelToShow = quizzDTO.badLevel;
@ -93,7 +93,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
width: 5, width: 5,
height: 5, height: 5,
child: ConfettiWidget( child: ConfettiWidget(
confettiController: _controllerCenter, confettiController: _controllerCenter!,
blastDirectionality: BlastDirectionality.explosive, blastDirectionality: BlastDirectionality.explosive,
shouldLoop: false, // start again as soon as the animation is finished shouldLoop: false, // start again as soon as the animation is finished
colors: const [ colors: const [
@ -150,7 +150,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
), ),
), ),
Container( Container(
child: Text('$goodResponses/${quizzDTO.questions.length}', textAlign: TextAlign.center, style: TextStyle(fontSize: 150, color: kBackgroundSecondGrey )), child: Text('$goodResponses/${quizzDTO.questions!.length}', textAlign: TextAlign.center, style: TextStyle(fontSize: 150, color: kBackgroundSecondGrey)),
), ),
Container( Container(
child: Padding( child: Padding(
@ -229,7 +229,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
showResult = false; showResult = false;
showResponses = false; showResponses = false;
currentIndex = 1; currentIndex = 1;
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions); _questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions!);
}); });
}, },
fontSize: 30, fontSize: 30,
@ -299,7 +299,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
fit: BoxFit.contain, fit: BoxFit.contain,
opacity: 0.35, opacity: 0.35,
image: new NetworkImage( image: new NetworkImage(
i.source_, i.source_!,
), ),
): null, ): null,
boxShadow: [ boxShadow: [
@ -343,7 +343,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Text(i.label.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)), child: Text(i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)),
), ),
), ),
), ),
@ -372,7 +372,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
mainAxisSpacing: 150, mainAxisSpacing: 150,
crossAxisSpacing: 150, crossAxisSpacing: 150,
), ),
itemCount: i.responsesSubDTO.length, itemCount: i.responsesSubDTO!.length,
itemBuilder: (BuildContext ctx, index) { itemBuilder: (BuildContext ctx, index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
@ -381,9 +381,9 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
if(currentIndex == _questionsSubDTO.length && i.chosen == index) if(currentIndex == _questionsSubDTO.length && i.chosen == index)
{ {
showResult = true; showResult = true;
_controllerCenter.play(); _controllerCenter!.play();
} else { } else {
sliderController.nextPage(duration: new Duration(milliseconds: 650), curve: Curves.fastOutSlowIn); sliderController!.nextPage(duration: new Duration(milliseconds: 650), curve: Curves.fastOutSlowIn);
} }
}); });
}, },
@ -391,7 +391,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
child: Text(i.responsesSubDTO[index].label.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO[index].label.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black)), child: Text(i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black)),
decoration: BoxDecoration( decoration: BoxDecoration(
color: i.chosen == index ? kTestSecondColor : kBackgroundLight, color: i.chosen == index ? kTestSecondColor : kBackgroundLight,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
@ -423,14 +423,14 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
), ),
], ],
), ),
if(_questionsSubDTO != null && _questionsSubDTO.length > 1 && currentIndex != _questionsSubDTO.length && _questionsSubDTO[currentIndex-1].chosen != null && quizzDTO.questions.length > 0) if(_questionsSubDTO != null && _questionsSubDTO.length > 1 && currentIndex != _questionsSubDTO.length && _questionsSubDTO[currentIndex-1].chosen != null && quizzDTO.questions!.length > 0)
Positioned( Positioned(
top: MediaQuery.of(context).size.height * 0.35, top: MediaQuery.of(context).size.height * 0.35,
right: 60, right: 60,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if(_questionsSubDTO[currentIndex-1].chosen != null && quizzDTO.questions.length > 0) { if(_questionsSubDTO[currentIndex-1].chosen != null && quizzDTO.questions!.length > 0) {
sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); sliderController!.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
/*Fluttertoast.showToast( /*Fluttertoast.showToast(
msg: "Vous n'avez pas répondu à cette question", msg: "Vous n'avez pas répondu à cette question",
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,
@ -456,7 +456,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if(currentIndex > 1) if(currentIndex > 1)
sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); sliderController!.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
}, },
child: Icon( child: Icon(
Icons.chevron_left, Icons.chevron_left,
@ -472,7 +472,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
child: Text( child: Text(
currentIndex.toString()+'/'+quizzDTO.questions.length.toString(), currentIndex.toString()+'/'+quizzDTO.questions!.length.toString(),
style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500), style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500),
), ),
) )

View File

@ -3,7 +3,7 @@ import 'dart:developer';
import 'package:carousel_slider/carousel_slider.dart'; import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tablet_app/Models/ResponseSubDTO.dart'; import 'package:tablet_app/Models/ResponseSubDTO.dart';
import 'package:tablet_app/app_context.dart'; import 'package:tablet_app/app_context.dart';
@ -12,7 +12,7 @@ import 'package:tablet_app/constants.dart';
class ShowReponsesWidget extends StatefulWidget { class ShowReponsesWidget extends StatefulWidget {
List<QuestionSubDTO> questionsSubDTO; List<QuestionSubDTO>? questionsSubDTO;
ShowReponsesWidget({this.questionsSubDTO}); ShowReponsesWidget({this.questionsSubDTO});
@override @override
@ -21,14 +21,14 @@ class ShowReponsesWidget extends StatefulWidget {
class _ShowReponsesWidget extends State<ShowReponsesWidget> { class _ShowReponsesWidget extends State<ShowReponsesWidget> {
List<QuestionSubDTO> _questionsSubDTO = <QuestionSubDTO>[]; List<QuestionSubDTO> _questionsSubDTO = <QuestionSubDTO>[];
CarouselController sliderController; CarouselController? sliderController;
int currentIndex = 1; int currentIndex = 1;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
sliderController = CarouselController(); sliderController = CarouselController();
_questionsSubDTO = widget.questionsSubDTO; _questionsSubDTO = widget.questionsSubDTO!;
} }
@override @override
@ -78,7 +78,7 @@ class _ShowReponsesWidget extends State<ShowReponsesWidget> {
fit: BoxFit.contain, fit: BoxFit.contain,
opacity: 0.35, opacity: 0.35,
image: new NetworkImage( image: new NetworkImage(
i.source_, i.source_!,
), ),
): null, ): null,
boxShadow: [ boxShadow: [
@ -122,7 +122,7 @@ class _ShowReponsesWidget extends State<ShowReponsesWidget> {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Padding( child: Padding(
padding: const EdgeInsets.all(1.0), padding: const EdgeInsets.all(1.0),
child: Text(i.label.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)), child: Text(i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)),
), ),
), ),
), ),
@ -148,15 +148,15 @@ class _ShowReponsesWidget extends State<ShowReponsesWidget> {
mainAxisSpacing: 15, mainAxisSpacing: 15,
crossAxisSpacing: 5, crossAxisSpacing: 5,
), ),
itemCount: i.responsesSubDTO.length, itemCount: i.responsesSubDTO!.length,
itemBuilder: (BuildContext ctx, index) { itemBuilder: (BuildContext ctx, index) {
return Padding( return Padding(
padding: const EdgeInsets.all(5.0), padding: const EdgeInsets.all(5.0),
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
child: Text(i.responsesSubDTO[index].label.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO[index].label.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black)), child: Text(i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black)),
decoration: BoxDecoration( decoration: BoxDecoration(
color: i.responsesSubDTO[index].isGood ? kGreen : i.chosen == index ? kMainRed : kBackgroundLight, color: i.responsesSubDTO![index].isGood! ? kGreen : i.chosen == index ? kMainRed : kBackgroundLight,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),
boxShadow: [ boxShadow: [
@ -183,14 +183,14 @@ class _ShowReponsesWidget extends State<ShowReponsesWidget> {
); );
}).toList(), }).toList(),
), ),
if(_questionsSubDTO != null && _questionsSubDTO.length > 1 && currentIndex != _questionsSubDTO.length && _questionsSubDTO[currentIndex-1].chosen != null && widget.questionsSubDTO.length > 0) if(_questionsSubDTO != null && _questionsSubDTO.length > 1 && currentIndex != _questionsSubDTO.length && _questionsSubDTO[currentIndex-1].chosen != null && widget.questionsSubDTO!.length > 0)
Positioned( Positioned(
top: size.height * 0.35, top: size.height * 0.35,
right: 60, right: 60,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if(_questionsSubDTO[currentIndex-1].chosen != null && widget.questionsSubDTO.length > 0) { if(_questionsSubDTO[currentIndex-1].chosen != null && widget.questionsSubDTO!.length > 0) {
sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); sliderController!.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
/*Fluttertoast.showToast( /*Fluttertoast.showToast(
msg: "Vous n'avez pas répondu à cette question", msg: "Vous n'avez pas répondu à cette question",
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,
@ -216,7 +216,7 @@ class _ShowReponsesWidget extends State<ShowReponsesWidget> {
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if(currentIndex > 1) if(currentIndex > 1)
sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); sliderController!.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
}, },
child: Icon( child: Icon(
Icons.chevron_left, Icons.chevron_left,
@ -232,7 +232,7 @@ class _ShowReponsesWidget extends State<ShowReponsesWidget> {
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
child: Text( child: Text(
currentIndex.toString()+'/'+ widget.questionsSubDTO.length.toString(), currentIndex.toString()+'/'+ widget.questionsSubDTO!.length.toString(),
style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500), style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500),
), ),
) )

View File

@ -2,14 +2,14 @@ import 'dart:convert';
import 'package:carousel_slider/carousel_slider.dart'; import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tablet_app/app_context.dart'; import 'package:tablet_app/app_context.dart';
import 'package:tablet_app/constants.dart'; import 'package:tablet_app/constants.dart';
import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view.dart';
class SliderViewWidget extends StatefulWidget { class SliderViewWidget extends StatefulWidget {
final SectionDTO section; final SectionDTO? section;
SliderViewWidget({this.section}); SliderViewWidget({this.section});
@override @override
@ -17,16 +17,16 @@ class SliderViewWidget extends StatefulWidget {
} }
class _SliderViewWidget extends State<SliderViewWidget> { class _SliderViewWidget extends State<SliderViewWidget> {
SliderDTO sliderDTO; SliderDTO sliderDTO = SliderDTO();
CarouselController sliderController; CarouselController? sliderController;
int currentIndex = 1; int currentIndex = 1;
@override @override
void initState() { void initState() {
sliderController = CarouselController(); sliderController = CarouselController();
sliderDTO = SliderDTO.fromJson(jsonDecode(widget.section.data)); sliderDTO = SliderDTO.fromJson(jsonDecode(widget.section!.data!))!;
sliderDTO.images.sort((a, b) => a.order.compareTo(b.order)); sliderDTO.images!.sort((a, b) => a.order!.compareTo(b.order!));
super.initState(); super.initState();
} }
@ -48,7 +48,7 @@ class _SliderViewWidget extends State<SliderViewWidget> {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
if(sliderDTO.images != null && sliderDTO.images.length > 0) if(sliderDTO.images != null && sliderDTO.images!.length > 0)
CarouselSlider( CarouselSlider(
carouselController: sliderController, carouselController: sliderController,
options: CarouselOptions( options: CarouselOptions(
@ -61,7 +61,7 @@ class _SliderViewWidget extends State<SliderViewWidget> {
enlargeCenterPage: true, enlargeCenterPage: true,
reverse: false, reverse: false,
), ),
items: sliderDTO.images.map<Widget>((i) { items: sliderDTO.images!.map<Widget>((i) {
return Builder( return Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return Container( return Container(
@ -112,7 +112,7 @@ class _SliderViewWidget extends State<SliderViewWidget> {
child: ClipRect( child: ClipRect(
child: PhotoView( child: PhotoView(
imageProvider: new NetworkImage( imageProvider: new NetworkImage(
i.source_, i.source_!,
), ),
minScale: PhotoViewComputedScale.contained * 0.8, minScale: PhotoViewComputedScale.contained * 0.8,
maxScale: PhotoViewComputedScale.contained * 3.0, maxScale: PhotoViewComputedScale.contained * 3.0,
@ -131,7 +131,7 @@ class _SliderViewWidget extends State<SliderViewWidget> {
right: 0, right: 0,
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Text(i.title.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.title.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kTitleSize, color: kBackgroundLight)), child: Text(i.title!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.title!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kTitleSize, color: kBackgroundLight)),
) )
) )
] ]
@ -160,7 +160,7 @@ class _SliderViewWidget extends State<SliderViewWidget> {
child: SingleChildScrollView( child: SingleChildScrollView(
child: Padding( child: Padding(
padding: const EdgeInsets.all(15.0), padding: const EdgeInsets.all(15.0),
child: Text(i.description.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.description.firstWhere((translation) => translation.language == appContext.getContext().language).value : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)), child: Text(i.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textAlign: TextAlign.center, style: TextStyle(fontSize: kDescriptionSize)),
), ),
), ),
), ),
@ -175,14 +175,14 @@ class _SliderViewWidget extends State<SliderViewWidget> {
), ),
], ],
), ),
if(sliderDTO.images != null && sliderDTO.images.length > 1) if(sliderDTO.images != null && sliderDTO.images!.length > 1)
Positioned( Positioned(
top: MediaQuery.of(context).size.height * 0.35, top: MediaQuery.of(context).size.height * 0.35,
right: 60, right: 60,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (sliderDTO.images.length > 0) if (sliderDTO.images!.length > 0)
sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); sliderController!.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
}, },
child: Icon( child: Icon(
Icons.chevron_right, Icons.chevron_right,
@ -191,14 +191,14 @@ class _SliderViewWidget extends State<SliderViewWidget> {
), ),
) )
), ),
if(sliderDTO.images != null && sliderDTO.images.length > 1) if(sliderDTO.images != null && sliderDTO.images!.length > 1)
Positioned( Positioned(
top: MediaQuery.of(context).size.height * 0.35, top: MediaQuery.of(context).size.height * 0.35,
left: 60, left: 60,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if (sliderDTO.images.length > 0) if (sliderDTO.images!.length > 0)
sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); sliderController!.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
}, },
child: Icon( child: Icon(
Icons.chevron_left, Icons.chevron_left,
@ -207,23 +207,23 @@ class _SliderViewWidget extends State<SliderViewWidget> {
), ),
) )
), ),
if(sliderDTO.images != null && sliderDTO.images.length > 0) if(sliderDTO.images != null && sliderDTO.images!.length > 0)
Padding( Padding(
padding: widget.section.parentId == null ? EdgeInsets.only() : const EdgeInsets.only(left: 15, bottom: 10), padding: widget.section!.parentId == null ? EdgeInsets.only() : const EdgeInsets.only(left: 15, bottom: 10),
child: Align( child: Align(
alignment: widget.section.parentId == null ? Alignment.bottomCenter : Alignment.bottomLeft, alignment: widget.section!.parentId == null ? Alignment.bottomCenter : Alignment.bottomLeft,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); sliderController!.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
}, },
child: Text( child: Text(
currentIndex.toString()+'/'+sliderDTO.images.length.toString(), currentIndex.toString()+'/'+sliderDTO.images!.length.toString(),
style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500), style: TextStyle(fontSize: 30, fontWeight: FontWeight.w500),
), ),
) )
), ),
), ),
if(sliderDTO.images == null || sliderDTO.images.length == 0) if(sliderDTO.images == null || sliderDTO.images!.length == 0)
Center(child: Text("Aucune image à afficher", style: TextStyle(fontSize: kNoneInfoOrIncorrect),)) Center(child: Text("Aucune image à afficher", style: TextStyle(fontSize: kNoneInfoOrIncorrect),))
// Description // Description
/*Container( /*Container(

View File

@ -1,12 +1,12 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:tablet_app/constants.dart'; import 'package:tablet_app/constants.dart';
import 'package:youtube_player_flutter/youtube_player_flutter.dart'; import 'package:youtube_player_flutter/youtube_player_flutter.dart';
class VideoViewWidget extends StatefulWidget { class VideoViewWidget extends StatefulWidget {
final SectionDTO section; final SectionDTO? section;
VideoViewWidget({this.section}); VideoViewWidget({this.section});
@override @override
@ -14,21 +14,21 @@ class VideoViewWidget extends StatefulWidget {
} }
class _VideoViewWidget extends State<VideoViewWidget> { class _VideoViewWidget extends State<VideoViewWidget> {
YoutubePlayer _videoView; YoutubePlayer? _videoView;
VideoDTO videoDTO; VideoDTO? videoDTO;
@override @override
void initState() { void initState() {
print(widget.section.data); print(widget.section!.data);
videoDTO = VideoDTO.fromJson(jsonDecode(widget.section.data)); videoDTO = VideoDTO.fromJson(jsonDecode(widget.section!.data!));
print(videoDTO); print(videoDTO);
String videoId; String? videoId;
if (videoDTO.source_ != null && videoDTO.source_.length > 0 ) { if (videoDTO!.source_ != null && videoDTO!.source_!.length > 0 ) {
videoId = YoutubePlayer.convertUrlToId(videoDTO.source_); videoId = YoutubePlayer.convertUrlToId(videoDTO!.source_!);
YoutubePlayerController _controller = YoutubePlayerController( YoutubePlayerController _controller = YoutubePlayerController(
initialVideoId: videoId, initialVideoId: videoId!,
flags: YoutubePlayerFlags( flags: YoutubePlayerFlags(
autoPlay: true, autoPlay: true,
controlsVisibleAtStart: false, controlsVisibleAtStart: false,
@ -59,5 +59,7 @@ class _VideoViewWidget extends State<VideoViewWidget> {
} }
@override @override
Widget build(BuildContext context) => videoDTO.source_ != null && videoDTO.source_.length > 0 ? _videoView : Center(child: Text("La vidéo ne peut pas être affichée, l'url est incorrecte", style: new TextStyle(fontSize: kNoneInfoOrIncorrect),)); Widget build(BuildContext context) => videoDTO!.source_ != null && videoDTO!.source_!.length > 0 ?
_videoView! :
Center(child: Text("La vidéo ne peut pas être affichée, l'url est incorrecte", style: new TextStyle(fontSize: kNoneInfoOrIncorrect)));
} }

View File

@ -1,28 +1,52 @@
import 'dart:convert'; import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:webview_flutter/webview_flutter.dart'; import 'package:webview_flutter/webview_flutter.dart';
class WebViewWidget extends StatefulWidget { class WebView extends StatefulWidget {
final SectionDTO section; final SectionDTO? section;
WebViewWidget({this.section}); WebView({this.section});
@override @override
_WebViewWidget createState() => _WebViewWidget(); _WebViewWidget createState() => _WebViewWidget();
} }
class _WebViewWidget extends State<WebViewWidget> { class _WebViewWidget extends State<WebView> {
WebView _webView; //WebView _webView;
WebDTO webDTO; WebDTO webDTO = WebDTO();
WebViewController? controller;
@override @override
void initState() { void initState() {
print(widget.section.data); print(widget.section!.data);
webDTO = WebDTO.fromJson(jsonDecode(widget.section.data)); webDTO = WebDTO.fromJson(jsonDecode(widget.section!.data!))!;
print(webDTO); print(webDTO);
controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..setBackgroundColor(const Color(0x00000000))
..setNavigationDelegate(
NavigationDelegate(
onProgress: (int progress) {
// Update loading bar.
},
onPageStarted: (String url) {},
onPageFinished: (String url) {},
onWebResourceError: (WebResourceError error) {},
onNavigationRequest: (NavigationRequest request) {
if (request.url != webDTO.source_) {
print('blocking navigation to $request}');
return NavigationDecision.prevent;
}
return NavigationDecision.navigate;
},
),
)
..loadRequest(Uri.parse(webDTO.source_!));
super.initState(); super.initState();
_webView = WebView( /*_webView = WebView(
initialUrl: webDTO.source_, //"https://my.matterport.com/show/?m=k8bvdezfHbT" initialUrl: webDTO.source_, //"https://my.matterport.com/show/?m=k8bvdezfHbT"
javascriptMode: JavascriptMode.unrestricted, javascriptMode: JavascriptMode.unrestricted,
navigationDelegate: (NavigationRequest request) { navigationDelegate: (NavigationRequest request) {
@ -35,15 +59,15 @@ class _WebViewWidget extends State<WebViewWidget> {
print('allowing navigation to $request'); print('allowing navigation to $request');
return NavigationDecision.navigate; return NavigationDecision.navigate;
} }
); );*/
} }
@override @override
void dispose() { void dispose() {
_webView = null; //_webView = null;
super.dispose(); super.dispose();
} }
@override @override
Widget build(BuildContext context) => webDTO.source_ != null && webDTO.source_.length > 0 ? _webView : Center(child: Text("La page internet ne peut pas être affichée, l'url est incorrecte ou vide")); Widget build(BuildContext context) => webDTO.source_ != null && webDTO.source_!.length > 0 ? WebViewWidget(controller: controller!) : Center(child: Text("La page internet ne peut pas être affichée, l'url est incorrecte ou vide"));
} } //_webView

View File

@ -1,10 +1,10 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class WaveClipper extends CustomClipper<Path> { class WaveClipper extends CustomClipper<Path> {
bool minimized; bool? minimized;
double height; double? height;
double width; double? width;
double move = 0; double? move = 0;
WaveClipper({ WaveClipper({
this.move, this.move,
@ -36,7 +36,7 @@ class WaveClipper extends CustomClipper<Path> {
Path path = Path() Path path = Path()
..lineTo(0, size.width) ..lineTo(0, size.width)
..lineTo(size.width, size.height) ..lineTo(size.width, size.height)
..lineTo(size.width*move, 0) ..lineTo(size.width*move!, 0)
..close(); ..close();
//print("move is = " + move.toString()); //print("move is = " + move.toString());

14
lib/api/openApi.dart Normal file
View File

@ -0,0 +1,14 @@
import 'package:openapi_generator_annotations/openapi_generator_annotations.dart';
@Openapi(
additionalProperties: AdditionalProperties(pubName: 'manager_api', pubAuthor: 'Fransolet Thomas'),
inputSpecFile: 'lib/api/swagger.yaml',
generatorName: Generator.dart,
alwaysRun: true,
outputDirectory: 'manager_api')
class Example extends OpenapiGeneratorConfig {}
/*
RUN
>flutter pub run build_runner build --delete-conflicting-outputs
*/

2239
lib/api/swagger.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@ import 'package:tablet_app/client.dart';
class AppContext with ChangeNotifier { class AppContext with ChangeNotifier {
TabletAppContext _tabletContext; TabletAppContext _tabletContext;
Client clientAPI; Client? clientAPI;
AppContext(this._tabletContext); AppContext(this._tabletContext);

View File

@ -1,27 +1,27 @@
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
//import 'package:openapi_dart_common/openapi.dart'; //import 'package:openapi_dart_common/openapi.dart';
class Client { class Client {
ApiClient _apiClient; ApiClient? _apiClient;
ApiClient get apiApi => _apiClient; ApiClient? get apiApi => _apiClient;
AuthenticationApi _authenticationApi; AuthenticationApi? _authenticationApi;
AuthenticationApi get authenticationApi => _authenticationApi; AuthenticationApi? get authenticationApi => _authenticationApi;
UserApi _userApi; UserApi? _userApi;
UserApi get userApi => _userApi; UserApi? get userApi => _userApi;
ConfigurationApi _configurationApi; ConfigurationApi? _configurationApi;
ConfigurationApi get configurationApi => _configurationApi; ConfigurationApi? get configurationApi => _configurationApi;
SectionApi _sectionApi; SectionApi? _sectionApi;
SectionApi get sectionApi => _sectionApi; SectionApi? get sectionApi => _sectionApi;
ResourceApi _resourceApi; ResourceApi? _resourceApi;
ResourceApi get resourceApi => _resourceApi; ResourceApi? get resourceApi => _resourceApi;
DeviceApi _deviceApi; DeviceApi? _deviceApi;
DeviceApi get deviceApi => _deviceApi; DeviceApi? get deviceApi => _deviceApi;
Client(String path) { Client(String path) {
_apiClient = ApiClient( _apiClient = ApiClient(

View File

@ -1,5 +1,8 @@
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:tablet_app/client.dart'; import 'package:tablet_app/client.dart';
import 'Helpers/DatabaseHelper.dart'; import 'Helpers/DatabaseHelper.dart';
@ -13,19 +16,21 @@ import 'constants.dart';
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
String initialRoute; String initialRoute;
TabletAppContext localContext = new TabletAppContext(); TabletAppContext? localContext;
bool isConfig = false; bool isConfig = false;
localContext = await DatabaseHelper.instance.getData(); if(!kIsWeb) {
localContext = await DatabaseHelper.instance.getData();
}
if(localContext != null) { if(localContext != null) {
print("we've got an local db !"); print("we've got an local db !");
localContext.clientAPI = new Client(localContext.host); localContext.clientAPI = new Client(localContext.host!);
isConfig = localContext.configuration != null; isConfig = localContext.configuration != null;
print(localContext); print(localContext);
// Get config from manager // Get config from manager
DeviceDetailDTO device = await localContext.clientAPI.deviceApi.deviceGetDetail(localContext.deviceId); DeviceDetailDTO? device = await localContext.clientAPI!.deviceApi!.deviceGetDetail(localContext.deviceId!);
localContext.configuration.id = device.configurationId; localContext.configuration!.id = device!.configurationId;
if (device.configurationId == null) { if (device.configurationId == null) {
print("device.configurationId == null"); print("device.configurationId == null");
localContext.configuration = null; localContext.configuration = null;
@ -35,6 +40,10 @@ void main() async {
print("NO LOCAL DB !"); print("NO LOCAL DB !");
} }
if(kIsWeb) {
localContext = TabletAppContext(host: "https://api.mymuseum.be");
}
initialRoute = isConfig ? '/main' : '/config'; initialRoute = isConfig ? '/main' : '/config';
final MyApp myApp = MyApp( final MyApp myApp = MyApp(
@ -45,8 +54,8 @@ void main() async {
} }
class MyApp extends StatefulWidget { class MyApp extends StatefulWidget {
final String initialRoute; final String? initialRoute;
final TabletAppContext tabletAppContext; final TabletAppContext? tabletAppContext;
MyApp({this.initialRoute, this.tabletAppContext}); MyApp({this.initialRoute, this.tabletAppContext});
@override @override
@ -54,7 +63,7 @@ class MyApp extends StatefulWidget {
} }
class _MyAppState extends State<MyApp> { class _MyAppState extends State<MyApp> {
TabletAppContext tabletAppContext; TabletAppContext? tabletAppContext;
@override @override
void initState() { void initState() {
@ -65,7 +74,7 @@ class _MyAppState extends State<MyApp> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ChangeNotifierProvider<AppContext>( return ChangeNotifierProvider<AppContext>(
create: (_) => AppContext(widget.tabletAppContext), create: (_) => AppContext(widget.tabletAppContext!),
child: MaterialApp( child: MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
title: 'Tablet App Demo', title: 'Tablet App Demo',
@ -76,7 +85,7 @@ class _MyAppState extends State<MyApp> {
],*/ ],*/
theme: ThemeData( theme: ThemeData(
primarySwatch: Colors.grey, primarySwatch: Colors.grey,
scaffoldBackgroundColor: widget.tabletAppContext != null ? widget.tabletAppContext.configuration != null ? widget.tabletAppContext.configuration.secondaryColor != null ? new Color(int.parse(widget.tabletAppContext.configuration.secondaryColor.split('(0x')[1].split(')')[0], radix: 16)): kBackgroundGrey : kBackgroundGrey : kBackgroundGrey, scaffoldBackgroundColor: widget.tabletAppContext != null ? widget.tabletAppContext!.configuration != null ? widget.tabletAppContext!.configuration!.secondaryColor != null ? new Color(int.parse(widget.tabletAppContext!.configuration!.secondaryColor!.split('(0x')[1].split(')')[0], radix: 16)): kBackgroundGrey : kBackgroundGrey : kBackgroundGrey,
//fontFamily: "Vollkorn", //fontFamily: "Vollkorn",
textTheme: TextTheme(bodyText1: TextStyle(color: kMainRed)), textTheme: TextTheme(bodyText1: TextStyle(color: kMainRed)),
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,

View File

@ -6,6 +6,10 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <url_launcher_linux/url_launcher_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
} }

View File

@ -3,6 +3,7 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_linux
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST

View File

@ -6,7 +6,9 @@ import FlutterMacOS
import Foundation import Foundation
import sqflite import sqflite
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
} }

View File

@ -1,27 +1,17 @@
# See https://www.dartlang.org/tools/private-files.html # See https://dart.dev/guides/libraries/private-files
# Files and directories created by pub .dart_tool/
.buildlog
.packages .packages
.project
.pub/
build/ build/
**/packages/ pubspec.lock # Except for application packages
# Files created by dart2js
# (Most Dart developers will use pub build to compile Dart, use/modify these
# rules if you intend to use dart2js directly
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
# differentiate from explicit Javascript files)
*.dart.js
*.part.js
*.js.deps
*.js.map
*.info.json
# Directory created by dartdoc
doc/api/ doc/api/
# Don't commit pubspec lock file # IntelliJ
# (Library packages only! Remove pattern if developing an application package) *.iml
pubspec.lock *.ipr
*.iws
.idea/
# Mac
.DS_Store

View File

@ -1,6 +1,8 @@
.gitignore .gitignore
.travis.yml .travis.yml
README.md README.md
analysis_options.yaml
doc/ArticleDTO.md
doc/AuthenticationApi.md doc/AuthenticationApi.md
doc/ConfigurationApi.md doc/ConfigurationApi.md
doc/ConfigurationDTO.md doc/ConfigurationDTO.md
@ -13,6 +15,9 @@ doc/ExportConfigurationDTOAllOf.md
doc/GeoPointDTO.md doc/GeoPointDTO.md
doc/ImageDTO.md doc/ImageDTO.md
doc/ImageGeoPoint.md doc/ImageGeoPoint.md
doc/Instance.md
doc/InstanceApi.md
doc/InstanceDTO.md
doc/LevelDTO.md doc/LevelDTO.md
doc/LoginDTO.md doc/LoginDTO.md
doc/MapDTO.md doc/MapDTO.md
@ -21,6 +26,7 @@ doc/MenuDTO.md
doc/PlayerMessageDTO.md doc/PlayerMessageDTO.md
doc/QuestionDTO.md doc/QuestionDTO.md
doc/QuizzDTO.md doc/QuizzDTO.md
doc/QuizzDTOBadLevel.md
doc/ResourceApi.md doc/ResourceApi.md
doc/ResourceDTO.md doc/ResourceDTO.md
doc/ResourceType.md doc/ResourceType.md
@ -41,6 +47,7 @@ lib/api.dart
lib/api/authentication_api.dart lib/api/authentication_api.dart
lib/api/configuration_api.dart lib/api/configuration_api.dart
lib/api/device_api.dart lib/api/device_api.dart
lib/api/instance_api.dart
lib/api/resource_api.dart lib/api/resource_api.dart
lib/api/section_api.dart lib/api/section_api.dart
lib/api/user_api.dart lib/api/user_api.dart
@ -52,6 +59,7 @@ lib/auth/authentication.dart
lib/auth/http_basic_auth.dart lib/auth/http_basic_auth.dart
lib/auth/http_bearer_auth.dart lib/auth/http_bearer_auth.dart
lib/auth/oauth.dart lib/auth/oauth.dart
lib/model/article_dto.dart
lib/model/configuration_dto.dart lib/model/configuration_dto.dart
lib/model/device_detail_dto.dart lib/model/device_detail_dto.dart
lib/model/device_detail_dto_all_of.dart lib/model/device_detail_dto_all_of.dart
@ -61,6 +69,8 @@ lib/model/export_configuration_dto_all_of.dart
lib/model/geo_point_dto.dart lib/model/geo_point_dto.dart
lib/model/image_dto.dart lib/model/image_dto.dart
lib/model/image_geo_point.dart lib/model/image_geo_point.dart
lib/model/instance.dart
lib/model/instance_dto.dart
lib/model/level_dto.dart lib/model/level_dto.dart
lib/model/login_dto.dart lib/model/login_dto.dart
lib/model/map_dto.dart lib/model/map_dto.dart
@ -69,6 +79,7 @@ lib/model/menu_dto.dart
lib/model/player_message_dto.dart lib/model/player_message_dto.dart
lib/model/question_dto.dart lib/model/question_dto.dart
lib/model/quizz_dto.dart lib/model/quizz_dto.dart
lib/model/quizz_dto_bad_level.dart
lib/model/resource_dto.dart lib/model/resource_dto.dart
lib/model/resource_type.dart lib/model/resource_type.dart
lib/model/response_dto.dart lib/model/response_dto.dart
@ -82,9 +93,3 @@ lib/model/user_detail_dto.dart
lib/model/video_dto.dart lib/model/video_dto.dart
lib/model/web_dto.dart lib/model/web_dto.dart
pubspec.yaml pubspec.yaml
test/export_configuration_dto_all_of_test.dart
test/export_configuration_dto_test.dart
test/level_dto_test.dart
test/question_dto_test.dart
test/quizz_dto_test.dart
test/response_dto_test.dart

View File

@ -1 +1 @@
5.1.0 unset

View File

@ -6,7 +6,7 @@
language: dart language: dart
dart: dart:
# Install a specific stable release # Install a specific stable release
- "2.2.0" - "2.12"
install: install:
- pub get - pub get

View File

@ -1,4 +1,4 @@
# managerapi # manager_api
API Manager Service API Manager Service
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
@ -8,7 +8,7 @@ This Dart package is automatically generated by the [OpenAPI Generator](https://
## Requirements ## Requirements
Dart 2.0 or later Dart 2.12 or later
## Installation & Usage ## Installation & Usage
@ -16,7 +16,7 @@ Dart 2.0 or later
If this Dart package is published to Github, add the following dependency to your pubspec.yaml If this Dart package is published to Github, add the following dependency to your pubspec.yaml
``` ```
dependencies: dependencies:
managerapi: manager_api:
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
``` ```
@ -24,8 +24,8 @@ dependencies:
To use the package in your local drive, add the following dependency to your pubspec.yaml To use the package in your local drive, add the following dependency to your pubspec.yaml
``` ```
dependencies: dependencies:
managerapi: manager_api:
path: /path/to/managerapi path: /path/to/manager_api
``` ```
## Tests ## Tests
@ -37,7 +37,7 @@ TODO
Please follow the [installation procedure](#installation--usage) and then run the following: Please follow the [installation procedure](#installation--usage) and then run the following:
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -60,7 +60,7 @@ try {
## Documentation for API Endpoints ## Documentation for API Endpoints
All URIs are relative to *http://192.168.31.140* All URIs are relative to *https://api.mymuseum.be*
Class | Method | HTTP request | Description Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
@ -79,6 +79,11 @@ Class | Method | HTTP request | Description
*DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/Device/{id}/detail | *DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/Device/{id}/detail |
*DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/Device | *DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/Device |
*DeviceApi* | [**deviceUpdateMainInfos**](doc\/DeviceApi.md#deviceupdatemaininfos) | **PUT** /api/Device/mainInfos | *DeviceApi* | [**deviceUpdateMainInfos**](doc\/DeviceApi.md#deviceupdatemaininfos) | **PUT** /api/Device/mainInfos |
*InstanceApi* | [**instanceCreateInstance**](doc\/InstanceApi.md#instancecreateinstance) | **POST** /api/Instance |
*InstanceApi* | [**instanceDeleteInstance**](doc\/InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} |
*InstanceApi* | [**instanceGet**](doc\/InstanceApi.md#instanceget) | **GET** /api/Instance |
*InstanceApi* | [**instanceGetDetail**](doc\/InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} |
*InstanceApi* | [**instanceUpdateinstance**](doc\/InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance |
*ResourceApi* | [**resourceCreate**](doc\/ResourceApi.md#resourcecreate) | **POST** /api/Resource | *ResourceApi* | [**resourceCreate**](doc\/ResourceApi.md#resourcecreate) | **POST** /api/Resource |
*ResourceApi* | [**resourceDelete**](doc\/ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} | *ResourceApi* | [**resourceDelete**](doc\/ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} |
*ResourceApi* | [**resourceGet**](doc\/ResourceApi.md#resourceget) | **GET** /api/Resource | *ResourceApi* | [**resourceGet**](doc\/ResourceApi.md#resourceget) | **GET** /api/Resource |
@ -91,6 +96,7 @@ Class | Method | HTTP request | Description
*SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | *SectionApi* | [**sectionDeleteAllForConfiguration**](doc\/SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
*SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section | *SectionApi* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section |
*SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | *SectionApi* | [**sectionGetAllSectionSubSections**](doc\/SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
*SectionApi* | [**sectionGetArticleDTO**](doc\/SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
*SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} | *SectionApi* | [**sectionGetDetail**](doc\/SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |
*SectionApi* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | *SectionApi* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} |
*SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | *SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO |
@ -111,6 +117,7 @@ Class | Method | HTTP request | Description
## Documentation For Models ## Documentation For Models
- [ArticleDTO](doc\/ArticleDTO.md)
- [ConfigurationDTO](doc\/ConfigurationDTO.md) - [ConfigurationDTO](doc\/ConfigurationDTO.md)
- [DeviceDTO](doc\/DeviceDTO.md) - [DeviceDTO](doc\/DeviceDTO.md)
- [DeviceDetailDTO](doc\/DeviceDetailDTO.md) - [DeviceDetailDTO](doc\/DeviceDetailDTO.md)
@ -120,6 +127,8 @@ Class | Method | HTTP request | Description
- [GeoPointDTO](doc\/GeoPointDTO.md) - [GeoPointDTO](doc\/GeoPointDTO.md)
- [ImageDTO](doc\/ImageDTO.md) - [ImageDTO](doc\/ImageDTO.md)
- [ImageGeoPoint](doc\/ImageGeoPoint.md) - [ImageGeoPoint](doc\/ImageGeoPoint.md)
- [Instance](doc\/Instance.md)
- [InstanceDTO](doc\/InstanceDTO.md)
- [LevelDTO](doc\/LevelDTO.md) - [LevelDTO](doc\/LevelDTO.md)
- [LoginDTO](doc\/LoginDTO.md) - [LoginDTO](doc\/LoginDTO.md)
- [MapDTO](doc\/MapDTO.md) - [MapDTO](doc\/MapDTO.md)
@ -128,6 +137,7 @@ Class | Method | HTTP request | Description
- [PlayerMessageDTO](doc\/PlayerMessageDTO.md) - [PlayerMessageDTO](doc\/PlayerMessageDTO.md)
- [QuestionDTO](doc\/QuestionDTO.md) - [QuestionDTO](doc\/QuestionDTO.md)
- [QuizzDTO](doc\/QuizzDTO.md) - [QuizzDTO](doc\/QuizzDTO.md)
- [QuizzDTOBadLevel](doc\/QuizzDTOBadLevel.md)
- [ResourceDTO](doc\/ResourceDTO.md) - [ResourceDTO](doc\/ResourceDTO.md)
- [ResourceType](doc\/ResourceType.md) - [ResourceType](doc\/ResourceType.md)
- [ResponseDTO](doc\/ResponseDTO.md) - [ResponseDTO](doc\/ResponseDTO.md)
@ -158,4 +168,3 @@ Class | Method | HTTP request | Description

View File

View File

@ -0,0 +1,19 @@
# manager_api.model.ArticleDTO
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**content** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**isContentTop** | **bool** | | [optional]
**audioIds** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**isReadAudioAuto** | **bool** | | [optional]
**images** | [**List<ImageDTO>**](ImageDTO.md) | | [optional] [default to const []]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,11 +1,11 @@
# managerapi.api.AuthenticationApi # manager_api.api.AuthenticationApi
## Load the API package ## Load the API package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *http://192.168.31.140* All URIs are relative to *https://api.mymuseum.be*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -18,9 +18,9 @@ Method | HTTP request | Description
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -31,7 +31,7 @@ final password = password_example; // String |
final clientId = clientId_example; // String | final clientId = clientId_example; // String |
final clientSecret = clientSecret_example; // String | final clientSecret = clientSecret_example; // String |
try { try {
final result = api_instance.authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret); final result = api_instance.authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret);
print(result); print(result);
} catch (e) { } catch (e) {
@ -69,16 +69,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = AuthenticationApi(); final api_instance = AuthenticationApi();
final loginDTO = LoginDTO(); // LoginDTO | final loginDTO = LoginDTO(); // LoginDTO |
try { try {
final result = api_instance.authenticationAuthenticateWithJson(loginDTO); final result = api_instance.authenticationAuthenticateWithJson(loginDTO);
print(result); print(result);
} catch (e) { } catch (e) {

View File

@ -1,11 +1,11 @@
# managerapi.api.ConfigurationApi # manager_api.api.ConfigurationApi
## Load the API package ## Load the API package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *http://192.168.31.140* All URIs are relative to *https://api.mymuseum.be*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -23,16 +23,16 @@ Method | HTTP request | Description
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi(); final api_instance = ConfigurationApi();
final configurationDTO = ConfigurationDTO(); // ConfigurationDTO | final configurationDTO = ConfigurationDTO(); // ConfigurationDTO |
try { try {
final result = api_instance.configurationCreate(configurationDTO); final result = api_instance.configurationCreate(configurationDTO);
print(result); print(result);
} catch (e) { } catch (e) {
@ -66,16 +66,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi(); final api_instance = ConfigurationApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.configurationDelete(id); final result = api_instance.configurationDelete(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -105,20 +105,20 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **configurationExport** # **configurationExport**
> ExportConfigurationDTO configurationExport(id) > MultipartFile configurationExport(id)
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi(); final api_instance = ConfigurationApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.configurationExport(id); final result = api_instance.configurationExport(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -134,7 +134,7 @@ Name | Type | Description | Notes
### Return type ### Return type
[**ExportConfigurationDTO**](ExportConfigurationDTO.md) [**MultipartFile**](MultipartFile.md)
### Authorization ### Authorization
@ -143,25 +143,26 @@ Name | Type | Description | Notes
### HTTP request headers ### HTTP request headers
- **Content-Type**: Not defined - **Content-Type**: Not defined
- **Accept**: application/json - **Accept**: application/octet-stream, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **configurationGet** # **configurationGet**
> List<ConfigurationDTO> configurationGet() > List<ConfigurationDTO> configurationGet(instanceId)
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi(); final api_instance = ConfigurationApi();
final instanceId = instanceId_example; // String |
try { try {
final result = api_instance.configurationGet(); final result = api_instance.configurationGet(instanceId);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling ConfigurationApi->configurationGet: $e\n'); print('Exception when calling ConfigurationApi->configurationGet: $e\n');
@ -169,7 +170,10 @@ try {
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instanceId** | **String**| | [optional]
### Return type ### Return type
@ -191,16 +195,16 @@ This endpoint does not need any parameter.
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi(); final api_instance = ConfigurationApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.configurationGetDetail(id); final result = api_instance.configurationGetDetail(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -234,16 +238,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi(); final api_instance = ConfigurationApi();
final exportConfigurationDTO = ExportConfigurationDTO(); // ExportConfigurationDTO | final exportConfigurationDTO = ExportConfigurationDTO(); // ExportConfigurationDTO |
try { try {
final result = api_instance.configurationImport(exportConfigurationDTO); final result = api_instance.configurationImport(exportConfigurationDTO);
print(result); print(result);
} catch (e) { } catch (e) {
@ -277,16 +281,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ConfigurationApi(); final api_instance = ConfigurationApi();
final configurationDTO = ConfigurationDTO(); // ConfigurationDTO | final configurationDTO = ConfigurationDTO(); // ConfigurationDTO |
try { try {
final result = api_instance.configurationUpdate(configurationDTO); final result = api_instance.configurationUpdate(configurationDTO);
print(result); print(result);
} catch (e) { } catch (e) {

View File

@ -1,8 +1,8 @@
# managerapi.model.ConfigurationDTO # manager_api.model.ConfigurationDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties
@ -10,10 +10,17 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional] **id** | **String** | | [optional]
**label** | **String** | | [optional] **label** | **String** | | [optional]
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**imageId** | **String** | | [optional]
**imageSource** | **String** | | [optional]
**primaryColor** | **String** | | [optional] **primaryColor** | **String** | | [optional]
**secondaryColor** | **String** | | [optional] **secondaryColor** | **String** | | [optional]
**languages** | **List<String>** | | [optional] [default to const []] **languages** | **List<String>** | | [optional] [default to const []]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**isMobile** | **bool** | | [optional]
**isTablet** | **bool** | | [optional]
**isOffline** | **bool** | | [optional]
**instanceId** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,11 +1,11 @@
# managerapi.api.DeviceApi # manager_api.api.DeviceApi
## Load the API package ## Load the API package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *http://192.168.31.140* All URIs are relative to *https://api.mymuseum.be*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -22,16 +22,16 @@ Method | HTTP request | Description
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi(); final api_instance = DeviceApi();
final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO |
try { try {
final result = api_instance.deviceCreate(deviceDetailDTO); final result = api_instance.deviceCreate(deviceDetailDTO);
print(result); print(result);
} catch (e) { } catch (e) {
@ -65,16 +65,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi(); final api_instance = DeviceApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.deviceDelete(id); final result = api_instance.deviceDelete(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -104,20 +104,21 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **deviceGet** # **deviceGet**
> List<DeviceDTO> deviceGet() > List<DeviceDTO> deviceGet(instanceId)
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi(); final api_instance = DeviceApi();
final instanceId = instanceId_example; // String |
try { try {
final result = api_instance.deviceGet(); final result = api_instance.deviceGet(instanceId);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling DeviceApi->deviceGet: $e\n'); print('Exception when calling DeviceApi->deviceGet: $e\n');
@ -125,7 +126,10 @@ try {
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instanceId** | **String**| | [optional]
### Return type ### Return type
@ -147,16 +151,16 @@ This endpoint does not need any parameter.
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi(); final api_instance = DeviceApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.deviceGetDetail(id); final result = api_instance.deviceGetDetail(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -190,16 +194,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi(); final api_instance = DeviceApi();
final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO |
try { try {
final result = api_instance.deviceUpdate(deviceDetailDTO); final result = api_instance.deviceUpdate(deviceDetailDTO);
print(result); print(result);
} catch (e) { } catch (e) {
@ -233,16 +237,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi(); final api_instance = DeviceApi();
final deviceDTO = DeviceDTO(); // DeviceDTO | final deviceDTO = DeviceDTO(); // DeviceDTO |
try { try {
final result = api_instance.deviceUpdateMainInfos(deviceDTO); final result = api_instance.deviceUpdateMainInfos(deviceDTO);
print(result); print(result);
} catch (e) { } catch (e) {

View File

@ -1,8 +1,8 @@
# managerapi.model.DeviceDTO # manager_api.model.DeviceDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties
@ -18,6 +18,7 @@ Name | Type | Description | Notes
**connected** | **bool** | | [optional] **connected** | **bool** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**dateUpdate** | [**DateTime**](DateTime.md) | | [optional] **dateUpdate** | [**DateTime**](DateTime.md) | | [optional]
**instanceId** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,8 +1,8 @@
# managerapi.model.DeviceDetailDTO # manager_api.model.DeviceDetailDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties
@ -18,6 +18,7 @@ Name | Type | Description | Notes
**connected** | **bool** | | [optional] **connected** | **bool** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**dateUpdate** | [**DateTime**](DateTime.md) | | [optional] **dateUpdate** | [**DateTime**](DateTime.md) | | [optional]
**instanceId** | **String** | | [optional]
**connectionLevel** | **String** | | [optional] **connectionLevel** | **String** | | [optional]
**lastConnectionLevel** | [**DateTime**](DateTime.md) | | [optional] **lastConnectionLevel** | [**DateTime**](DateTime.md) | | [optional]
**batteryLevel** | **String** | | [optional] **batteryLevel** | **String** | | [optional]

View File

@ -1,8 +1,8 @@
# managerapi.model.DeviceDetailDTOAllOf # manager_api.model.DeviceDetailDTOAllOf
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.ExportConfigurationDTO # manager_api.model.ExportConfigurationDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties
@ -10,10 +10,17 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional] **id** | **String** | | [optional]
**label** | **String** | | [optional] **label** | **String** | | [optional]
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**imageId** | **String** | | [optional]
**imageSource** | **String** | | [optional]
**primaryColor** | **String** | | [optional] **primaryColor** | **String** | | [optional]
**secondaryColor** | **String** | | [optional] **secondaryColor** | **String** | | [optional]
**languages** | **List<String>** | | [optional] [default to const []] **languages** | **List<String>** | | [optional] [default to const []]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**isMobile** | **bool** | | [optional]
**isTablet** | **bool** | | [optional]
**isOffline** | **bool** | | [optional]
**instanceId** | **String** | | [optional]
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []] **sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
**resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []] **resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []]

View File

@ -1,8 +1,8 @@
# managerapi.model.ExportConfigurationDTOAllOf # manager_api.model.ExportConfigurationDTOAllOf
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.GeoPointDTO # manager_api.model.GeoPointDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.ImageDTO # manager_api.model.ImageDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.ImageGeoPoint # manager_api.model.ImageGeoPoint
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -0,0 +1,17 @@
# manager_api.model.Instance
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional]
**name** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,229 @@
# manager_api.api.InstanceApi
## Load the API package
```dart
import 'package:manager_api/api.dart';
```
All URIs are relative to *https://api.mymuseum.be*
Method | HTTP request | Description
------------- | ------------- | -------------
[**instanceCreateInstance**](InstanceApi.md#instancecreateinstance) | **POST** /api/Instance |
[**instanceDeleteInstance**](InstanceApi.md#instancedeleteinstance) | **DELETE** /api/Instance/{id} |
[**instanceGet**](InstanceApi.md#instanceget) | **GET** /api/Instance |
[**instanceGetDetail**](InstanceApi.md#instancegetdetail) | **GET** /api/Instance/{id} |
[**instanceUpdateinstance**](InstanceApi.md#instanceupdateinstance) | **PUT** /api/Instance |
# **instanceCreateInstance**
> InstanceDTO instanceCreateInstance(instance)
### Example
```dart
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = InstanceApi();
final instance = Instance(); // Instance |
try {
final result = api_instance.instanceCreateInstance(instance);
print(result);
} catch (e) {
print('Exception when calling InstanceApi->instanceCreateInstance: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instance** | [**Instance**](Instance.md)| |
### Return type
[**InstanceDTO**](InstanceDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **instanceDeleteInstance**
> String instanceDeleteInstance(id)
### Example
```dart
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = InstanceApi();
final id = id_example; // String |
try {
final result = api_instance.instanceDeleteInstance(id);
print(result);
} catch (e) {
print('Exception when calling InstanceApi->instanceDeleteInstance: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
### Return type
**String**
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **instanceGet**
> List<Instance> instanceGet()
### Example
```dart
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = InstanceApi();
try {
final result = api_instance.instanceGet();
print(result);
} catch (e) {
print('Exception when calling InstanceApi->instanceGet: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List<Instance>**](Instance.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **instanceGetDetail**
> InstanceDTO instanceGetDetail(id)
### Example
```dart
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = InstanceApi();
final id = id_example; // String |
try {
final result = api_instance.instanceGetDetail(id);
print(result);
} catch (e) {
print('Exception when calling InstanceApi->instanceGetDetail: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**id** | **String**| |
### Return type
[**InstanceDTO**](InstanceDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **instanceUpdateinstance**
> InstanceDTO instanceUpdateinstance(instance)
### Example
```dart
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = InstanceApi();
final instance = Instance(); // Instance |
try {
final result = api_instance.instanceUpdateinstance(instance);
print(result);
} catch (e) {
print('Exception when calling InstanceApi->instanceUpdateinstance: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instance** | [**Instance**](Instance.md)| |
### Return type
[**InstanceDTO**](InstanceDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@ -0,0 +1,17 @@
# manager_api.model.InstanceDTO
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional]
**name** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,8 +1,8 @@
# managerapi.model.LevelDTO # manager_api.model.LevelDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.LoginDTO # manager_api.model.LoginDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.MapDTO # manager_api.model.MapDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.MapTypeApp # manager_api.model.MapTypeApp
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.MenuDTO # manager_api.model.MenuDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.PlayerMessageDTO # manager_api.model.PlayerMessageDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.QuestionDTO # manager_api.model.QuestionDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,18 +1,18 @@
# managerapi.model.QuizzDTO # manager_api.model.QuizzDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**questions** | [**List<QuestionDTO>**](QuestionDTO.md) | | [optional] [default to const []] **questions** | [**List<QuestionDTO>**](QuestionDTO.md) | | [optional] [default to const []]
**badLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] **badLevel** | [**QuizzDTOBadLevel**](QuizzDTOBadLevel.md) | | [optional]
**mediumLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] **mediumLevel** | [**QuizzDTOBadLevel**](QuizzDTOBadLevel.md) | | [optional]
**goodLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] **goodLevel** | [**QuizzDTOBadLevel**](QuizzDTOBadLevel.md) | | [optional]
**greatLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional] **greatLevel** | [**QuizzDTOBadLevel**](QuizzDTOBadLevel.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -0,0 +1,17 @@
# manager_api.model.QuizzDTOBadLevel
## Load the model package
```dart
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**resourceId** | **String** | | [optional]
**source_** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,11 +1,11 @@
# managerapi.api.ResourceApi # manager_api.api.ResourceApi
## Load the API package ## Load the API package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *http://192.168.31.140* All URIs are relative to *https://api.mymuseum.be*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -23,16 +23,16 @@ Method | HTTP request | Description
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ResourceApi(); final api_instance = ResourceApi();
final resourceDTO = ResourceDTO(); // ResourceDTO | final resourceDTO = ResourceDTO(); // ResourceDTO |
try { try {
final result = api_instance.resourceCreate(resourceDTO); final result = api_instance.resourceCreate(resourceDTO);
print(result); print(result);
} catch (e) { } catch (e) {
@ -66,16 +66,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ResourceApi(); final api_instance = ResourceApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.resourceDelete(id); final result = api_instance.resourceDelete(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -105,20 +105,22 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **resourceGet** # **resourceGet**
> List<ResourceDTO> resourceGet() > List<ResourceDTO> resourceGet(instanceId, types)
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ResourceApi(); final api_instance = ResourceApi();
final instanceId = instanceId_example; // String |
final types = []; // List<ResourceType> |
try { try {
final result = api_instance.resourceGet(); final result = api_instance.resourceGet(instanceId, types);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling ResourceApi->resourceGet: $e\n'); print('Exception when calling ResourceApi->resourceGet: $e\n');
@ -126,7 +128,11 @@ try {
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instanceId** | **String**| | [optional]
**types** | [**List<ResourceType>**](ResourceType.md)| | [optional] [default to const []]
### Return type ### Return type
@ -148,16 +154,16 @@ This endpoint does not need any parameter.
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ResourceApi(); final api_instance = ResourceApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.resourceGetDetail(id); final result = api_instance.resourceGetDetail(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -191,16 +197,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ResourceApi(); final api_instance = ResourceApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.resourceShow(id); final result = api_instance.resourceShow(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -234,16 +240,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ResourceApi(); final api_instance = ResourceApi();
final resourceDTO = ResourceDTO(); // ResourceDTO | final resourceDTO = ResourceDTO(); // ResourceDTO |
try { try {
final result = api_instance.resourceUpdate(resourceDTO); final result = api_instance.resourceUpdate(resourceDTO);
print(result); print(result);
} catch (e) { } catch (e) {
@ -273,22 +279,23 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **resourceUpload** # **resourceUpload**
> String resourceUpload(label, type) > String resourceUpload(label, type, instanceId)
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = ResourceApi(); final api_instance = ResourceApi();
final label = label_example; // String | final label = label_example; // String |
final type = type_example; // String | final type = type_example; // String |
final instanceId = instanceId_example; // String |
try { try {
final result = api_instance.resourceUpload(label, type); final result = api_instance.resourceUpload(label, type, instanceId);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling ResourceApi->resourceUpload: $e\n'); print('Exception when calling ResourceApi->resourceUpload: $e\n');
@ -301,6 +308,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**label** | **String**| | [optional] **label** | **String**| | [optional]
**type** | **String**| | [optional] **type** | **String**| | [optional]
**instanceId** | **String**| | [optional]
### Return type ### Return type

View File

@ -1,8 +1,8 @@
# managerapi.model.ResourceDTO # manager_api.model.ResourceDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties
@ -11,8 +11,9 @@ Name | Type | Description | Notes
**id** | **String** | | [optional] **id** | **String** | | [optional]
**type** | [**ResourceType**](ResourceType.md) | | [optional] **type** | [**ResourceType**](ResourceType.md) | | [optional]
**label** | **String** | | [optional] **label** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**data** | **String** | | [optional] **data** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**instanceId** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,8 +1,8 @@
# managerapi.model.ResourceType # manager_api.model.ResourceType
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.ResponseDTO # manager_api.model.ResponseDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,11 +1,11 @@
# managerapi.api.SectionApi # manager_api.api.SectionApi
## Load the API package ## Load the API package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *http://192.168.31.140* All URIs are relative to *https://api.mymuseum.be*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -14,6 +14,7 @@ Method | HTTP request | Description
[**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} | [**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
[**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section | [**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section |
[**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections | [**sectionGetAllSectionSubSections**](SectionApi.md#sectiongetallsectionsubsections) | **GET** /api/Section/{id}/subsections |
[**sectionGetArticleDTO**](SectionApi.md#sectiongetarticledto) | **GET** /api/Section/ArticleDTO |
[**sectionGetDetail**](SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} | [**sectionGetDetail**](SectionApi.md#sectiongetdetail) | **GET** /api/Section/{id} |
[**sectionGetFromConfiguration**](SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} | [**sectionGetFromConfiguration**](SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} |
[**sectionGetMapDTO**](SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO | [**sectionGetMapDTO**](SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO |
@ -32,16 +33,16 @@ Method | HTTP request | Description
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
final sectionDTO = SectionDTO(); // SectionDTO | final sectionDTO = SectionDTO(); // SectionDTO |
try { try {
final result = api_instance.sectionCreate(sectionDTO); final result = api_instance.sectionCreate(sectionDTO);
print(result); print(result);
} catch (e) { } catch (e) {
@ -75,16 +76,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.sectionDelete(id); final result = api_instance.sectionDelete(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -118,16 +119,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.sectionDeleteAllForConfiguration(id); final result = api_instance.sectionDeleteAllForConfiguration(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -157,20 +158,21 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **sectionGet** # **sectionGet**
> List<SectionDTO> sectionGet() > List<SectionDTO> sectionGet(instanceId)
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
final instanceId = instanceId_example; // String |
try { try {
final result = api_instance.sectionGet(); final result = api_instance.sectionGet(instanceId);
print(result); print(result);
} catch (e) { } catch (e) {
print('Exception when calling SectionApi->sectionGet: $e\n'); print('Exception when calling SectionApi->sectionGet: $e\n');
@ -178,7 +180,10 @@ try {
``` ```
### Parameters ### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instanceId** | **String**| | [optional]
### Return type ### Return type
@ -200,16 +205,16 @@ This endpoint does not need any parameter.
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.sectionGetAllSectionSubSections(id); final result = api_instance.sectionGetAllSectionSubSections(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -238,21 +243,60 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **sectionGetArticleDTO**
> ArticleDTO sectionGetArticleDTO()
### Example
```dart
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi();
try {
final result = api_instance.sectionGetArticleDTO();
print(result);
} catch (e) {
print('Exception when calling SectionApi->sectionGetArticleDTO: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**ArticleDTO**](ArticleDTO.md)
### Authorization
[bearer](../README.md#bearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **sectionGetDetail** # **sectionGetDetail**
> SectionDTO sectionGetDetail(id) > SectionDTO sectionGetDetail(id)
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.sectionGetDetail(id); final result = api_instance.sectionGetDetail(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -286,16 +330,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.sectionGetFromConfiguration(id); final result = api_instance.sectionGetFromConfiguration(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -329,15 +373,15 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
try { try {
final result = api_instance.sectionGetMapDTO(); final result = api_instance.sectionGetMapDTO();
print(result); print(result);
} catch (e) { } catch (e) {
@ -368,15 +412,15 @@ This endpoint does not need any parameter.
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
try { try {
final result = api_instance.sectionGetMenuDTO(); final result = api_instance.sectionGetMenuDTO();
print(result); print(result);
} catch (e) { } catch (e) {
@ -407,15 +451,15 @@ This endpoint does not need any parameter.
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
try { try {
final result = api_instance.sectionGetQuizzDTO(); final result = api_instance.sectionGetQuizzDTO();
print(result); print(result);
} catch (e) { } catch (e) {
@ -446,15 +490,15 @@ This endpoint does not need any parameter.
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
try { try {
final result = api_instance.sectionGetSliderDTO(); final result = api_instance.sectionGetSliderDTO();
print(result); print(result);
} catch (e) { } catch (e) {
@ -485,15 +529,15 @@ This endpoint does not need any parameter.
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
try { try {
final result = api_instance.sectionGetVideoDTO(); final result = api_instance.sectionGetVideoDTO();
print(result); print(result);
} catch (e) { } catch (e) {
@ -524,15 +568,15 @@ This endpoint does not need any parameter.
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
try { try {
final result = api_instance.sectionGetWebDTO(); final result = api_instance.sectionGetWebDTO();
print(result); print(result);
} catch (e) { } catch (e) {
@ -563,15 +607,15 @@ This endpoint does not need any parameter.
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
try { try {
final result = api_instance.sectionPlayerMessageDTO(); final result = api_instance.sectionPlayerMessageDTO();
print(result); print(result);
} catch (e) { } catch (e) {
@ -602,16 +646,16 @@ This endpoint does not need any parameter.
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
final sectionDTO = SectionDTO(); // SectionDTO | final sectionDTO = SectionDTO(); // SectionDTO |
try { try {
final result = api_instance.sectionUpdate(sectionDTO); final result = api_instance.sectionUpdate(sectionDTO);
print(result); print(result);
} catch (e) { } catch (e) {
@ -645,16 +689,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = SectionApi(); final api_instance = SectionApi();
final sectionDTO = [List<SectionDTO>()]; // List<SectionDTO> | final sectionDTO = [List<SectionDTO>()]; // List<SectionDTO> |
try { try {
final result = api_instance.sectionUpdateOrder(sectionDTO); final result = api_instance.sectionUpdateOrder(sectionDTO);
print(result); print(result);
} catch (e) { } catch (e) {

View File

@ -1,8 +1,8 @@
# managerapi.model.SectionDTO # manager_api.model.SectionDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties
@ -21,6 +21,12 @@ Name | Type | Description | Notes
**data** | **String** | | [optional] **data** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**order** | **int** | | [optional] **order** | **int** | | [optional]
**instanceId** | **String** | | [optional]
**latitude** | **String** | | [optional]
**longitude** | **String** | | [optional]
**meterZoneGPS** | **int** | | [optional]
**isBeacon** | **bool** | | [optional]
**beaconId** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,8 +1,8 @@
# managerapi.model.SectionType # manager_api.model.SectionType
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.SliderDTO # manager_api.model.SliderDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.TokenDTO # manager_api.model.TokenDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties
@ -14,6 +14,7 @@ Name | Type | Description | Notes
**tokenType** | **String** | | [optional] **tokenType** | **String** | | [optional]
**expiresIn** | **int** | | [optional] **expiresIn** | **int** | | [optional]
**expiration** | [**DateTime**](DateTime.md) | | [optional] **expiration** | [**DateTime**](DateTime.md) | | [optional]
**instanceId** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,8 +1,8 @@
# managerapi.model.TranslationDTO # manager_api.model.TranslationDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.User # manager_api.model.User
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties
@ -15,6 +15,7 @@ Name | Type | Description | Notes
**lastName** | **String** | | [optional] **lastName** | **String** | | [optional]
**token** | **String** | | [optional] **token** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [optional] **dateCreation** | [**DateTime**](DateTime.md) | | [optional]
**instanceId** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -1,11 +1,11 @@
# managerapi.api.UserApi # manager_api.api.UserApi
## Load the API package ## Load the API package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
All URIs are relative to *http://192.168.31.140* All URIs are relative to *https://api.mymuseum.be*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
@ -21,16 +21,16 @@ Method | HTTP request | Description
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = UserApi(); final api_instance = UserApi();
final user = User(); // User | final user = User(); // User |
try { try {
final result = api_instance.userCreateUser(user); final result = api_instance.userCreateUser(user);
print(result); print(result);
} catch (e) { } catch (e) {
@ -64,16 +64,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = UserApi(); final api_instance = UserApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.userDeleteUser(id); final result = api_instance.userDeleteUser(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -107,15 +107,15 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = UserApi(); final api_instance = UserApi();
try { try {
final result = api_instance.userGet(); final result = api_instance.userGet();
print(result); print(result);
} catch (e) { } catch (e) {
@ -146,16 +146,16 @@ This endpoint does not need any parameter.
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = UserApi(); final api_instance = UserApi();
final id = id_example; // String | final id = id_example; // String |
try { try {
final result = api_instance.userGetDetail(id); final result = api_instance.userGetDetail(id);
print(result); print(result);
} catch (e) { } catch (e) {
@ -189,16 +189,16 @@ Name | Type | Description | Notes
### Example ### Example
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer // TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN'; //defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = UserApi(); final api_instance = UserApi();
final user = User(); // User | final user = User(); // User |
try { try {
final result = api_instance.userUpdateUser(user); final result = api_instance.userUpdateUser(user);
print(result); print(result);
} catch (e) { } catch (e) {

View File

@ -1,8 +1,8 @@
# managerapi.model.UserDetailDTO # manager_api.model.UserDetailDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.VideoDTO # manager_api.model.VideoDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,8 +1,8 @@
# managerapi.model.WebDTO # manager_api.model.WebDTO
## Load the model package ## Load the model package
```dart ```dart
import 'package:managerapi/api.dart'; import 'package:manager_api/api.dart';
``` ```
## Properties ## Properties

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
# #
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" # Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1 git_user_id=$1
git_repo_id=$2 git_repo_id=$2
@ -38,14 +38,14 @@ git add .
git commit -m "$release_note" git commit -m "$release_note"
# Sets the new remote # Sets the new remote
git_remote=`git remote` git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else else
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi fi
fi fi
@ -55,4 +55,3 @@ git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository # Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https' git push origin master 2>&1 | grep -v 'To https'

View File

@ -1,10 +1,11 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
library openapi.api; library openapi.api;
@ -15,7 +16,6 @@ import 'dart:io';
import 'package:http/http.dart'; import 'package:http/http.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
part 'api_client.dart'; part 'api_client.dart';
@ -30,10 +30,12 @@ part 'auth/http_bearer_auth.dart';
part 'api/authentication_api.dart'; part 'api/authentication_api.dart';
part 'api/configuration_api.dart'; part 'api/configuration_api.dart';
part 'api/device_api.dart'; part 'api/device_api.dart';
part 'api/instance_api.dart';
part 'api/resource_api.dart'; part 'api/resource_api.dart';
part 'api/section_api.dart'; part 'api/section_api.dart';
part 'api/user_api.dart'; part 'api/user_api.dart';
part 'model/article_dto.dart';
part 'model/configuration_dto.dart'; part 'model/configuration_dto.dart';
part 'model/device_dto.dart'; part 'model/device_dto.dart';
part 'model/device_detail_dto.dart'; part 'model/device_detail_dto.dart';
@ -43,6 +45,8 @@ part 'model/export_configuration_dto_all_of.dart';
part 'model/geo_point_dto.dart'; part 'model/geo_point_dto.dart';
part 'model/image_dto.dart'; part 'model/image_dto.dart';
part 'model/image_geo_point.dart'; part 'model/image_geo_point.dart';
part 'model/instance.dart';
part 'model/instance_dto.dart';
part 'model/level_dto.dart'; part 'model/level_dto.dart';
part 'model/login_dto.dart'; part 'model/login_dto.dart';
part 'model/map_dto.dart'; part 'model/map_dto.dart';
@ -51,6 +55,7 @@ part 'model/menu_dto.dart';
part 'model/player_message_dto.dart'; part 'model/player_message_dto.dart';
part 'model/question_dto.dart'; part 'model/question_dto.dart';
part 'model/quizz_dto.dart'; part 'model/quizz_dto.dart';
part 'model/quizz_dto_bad_level.dart';
part 'model/resource_dto.dart'; part 'model/resource_dto.dart';
part 'model/resource_type.dart'; part 'model/resource_type.dart';
part 'model/response_dto.dart'; part 'model/response_dto.dart';

View File

@ -1,17 +1,18 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
class AuthenticationApi { class AuthenticationApi {
AuthenticationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; AuthenticationApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient; final ApiClient apiClient;
@ -27,77 +28,53 @@ class AuthenticationApi {
/// * [String] clientId: /// * [String] clientId:
/// ///
/// * [String] clientSecret: /// * [String] clientSecret:
Future<Response> authenticationAuthenticateWithFormWithHttpInfo({ String grantType, String username, String password, String clientId, String clientSecret }) async { Future<Response> authenticationAuthenticateWithFormWithHttpInfo({ String? grantType, String? username, String? password, String? clientId, String? clientSecret, }) async {
// Verify required params are set. // ignore: prefer_const_declarations
final path = r'/api/Authentication/Token'; final path = r'/api/Authentication/Token';
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['multipart/form-data']; const contentTypes = <String>['multipart/form-data'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if ( bool hasFields = false;
nullableContentType != null && final mp = MultipartRequest('POST', Uri.parse(path));
nullableContentType.toLowerCase().startsWith('multipart/form-data') if (grantType != null) {
) { hasFields = true;
bool hasFields = false; mp.fields[r'grant_type'] = parameterToString(grantType);
final mp = MultipartRequest(null, null); }
if (grantType != null) { if (username != null) {
hasFields = true; hasFields = true;
mp.fields[r'grant_type'] = parameterToString(grantType); mp.fields[r'username'] = parameterToString(username);
} }
if (username != null) { if (password != null) {
hasFields = true; hasFields = true;
mp.fields[r'username'] = parameterToString(username); mp.fields[r'password'] = parameterToString(password);
} }
if (password != null) { if (clientId != null) {
hasFields = true; hasFields = true;
mp.fields[r'password'] = parameterToString(password); mp.fields[r'client_id'] = parameterToString(clientId);
} }
if (clientId != null) { if (clientSecret != null) {
hasFields = true; hasFields = true;
mp.fields[r'client_id'] = parameterToString(clientId); mp.fields[r'client_secret'] = parameterToString(clientSecret);
} }
if (clientSecret != null) { if (hasFields) {
hasFields = true; postBody = mp;
mp.fields[r'client_secret'] = parameterToString(clientSecret);
}
if (hasFields) {
postBody = mp;
}
} else {
if (grantType != null) {
formParams[r'grant_type'] = parameterToString(grantType);
}
if (username != null) {
formParams[r'username'] = parameterToString(username);
}
if (password != null) {
formParams[r'password'] = parameterToString(password);
}
if (clientId != null) {
formParams[r'client_id'] = parameterToString(clientId);
}
if (clientSecret != null) {
formParams[r'client_secret'] = parameterToString(clientSecret);
}
} }
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'POST', 'POST',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
@ -112,80 +89,65 @@ class AuthenticationApi {
/// * [String] clientId: /// * [String] clientId:
/// ///
/// * [String] clientSecret: /// * [String] clientSecret:
Future<TokenDTO> authenticationAuthenticateWithForm({ String grantType, String username, String password, String clientId, String clientSecret }) async { Future<TokenDTO?> authenticationAuthenticateWithForm({ String? grantType, String? username, String? password, String? clientId, String? clientSecret, }) async {
final response = await authenticationAuthenticateWithFormWithHttpInfo( grantType: grantType, username: username, password: password, clientId: clientId, clientSecret: clientSecret ); final response = await authenticationAuthenticateWithFormWithHttpInfo( grantType: grantType, username: username, password: password, clientId: clientId, clientSecret: clientSecret, );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'TokenDTO') as TokenDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TokenDTO',) as TokenDTO;
}
return Future<TokenDTO>.value(null); }
return null;
} }
/// Performs an HTTP 'POST /api/Authentication/Authenticate' operation and returns the [Response]. /// Performs an HTTP 'POST /api/Authentication/Authenticate' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [LoginDTO] loginDTO (required): /// * [LoginDTO] loginDTO (required):
Future<Response> authenticationAuthenticateWithJsonWithHttpInfo(LoginDTO loginDTO) async { Future<Response> authenticationAuthenticateWithJsonWithHttpInfo(LoginDTO loginDTO,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (loginDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: loginDTO');
}
final path = r'/api/Authentication/Authenticate'; final path = r'/api/Authentication/Authenticate';
Object postBody = loginDTO; // ignore: prefer_final_locals
Object? postBody = loginDTO;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['application/json']; const contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'POST', 'POST',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [LoginDTO] loginDTO (required): /// * [LoginDTO] loginDTO (required):
Future<TokenDTO> authenticationAuthenticateWithJson(LoginDTO loginDTO) async { Future<TokenDTO?> authenticationAuthenticateWithJson(LoginDTO loginDTO,) async {
final response = await authenticationAuthenticateWithJsonWithHttpInfo(loginDTO); final response = await authenticationAuthenticateWithJsonWithHttpInfo(loginDTO,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'TokenDTO') as TokenDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TokenDTO',) as TokenDTO;
}
return Future<TokenDTO>.value(null); }
return null;
} }
} }

View File

@ -1,17 +1,18 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
class ConfigurationApi { class ConfigurationApi {
ConfigurationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; ConfigurationApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient; final ApiClient apiClient;
@ -19,434 +20,338 @@ class ConfigurationApi {
/// Parameters: /// Parameters:
/// ///
/// * [ConfigurationDTO] configurationDTO (required): /// * [ConfigurationDTO] configurationDTO (required):
Future<Response> configurationCreateWithHttpInfo(ConfigurationDTO configurationDTO) async { Future<Response> configurationCreateWithHttpInfo(ConfigurationDTO configurationDTO,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (configurationDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: configurationDTO');
}
final path = r'/api/Configuration'; final path = r'/api/Configuration';
Object postBody = configurationDTO; // ignore: prefer_final_locals
Object? postBody = configurationDTO;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['application/json']; const contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'POST', 'POST',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [ConfigurationDTO] configurationDTO (required): /// * [ConfigurationDTO] configurationDTO (required):
Future<ConfigurationDTO> configurationCreate(ConfigurationDTO configurationDTO) async { Future<ConfigurationDTO?> configurationCreate(ConfigurationDTO configurationDTO,) async {
final response = await configurationCreateWithHttpInfo(configurationDTO); final response = await configurationCreateWithHttpInfo(configurationDTO,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ConfigurationDTO',) as ConfigurationDTO;
}
return Future<ConfigurationDTO>.value(null); }
return null;
} }
/// Performs an HTTP 'DELETE /api/Configuration/{id}' operation and returns the [Response]. /// Performs an HTTP 'DELETE /api/Configuration/{id}' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> configurationDeleteWithHttpInfo(String id) async { Future<Response> configurationDeleteWithHttpInfo(String id,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Configuration/{id}' final path = r'/api/Configuration/{id}'
.replaceAll('{' + 'id' + '}', id.toString()); .replaceAll('{id}', id);
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; const contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'DELETE', 'DELETE',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<String> configurationDelete(String id) async { Future<String?> configurationDelete(String id,) async {
final response = await configurationDeleteWithHttpInfo(id); final response = await configurationDeleteWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
}
return Future<String>.value(null); }
return null;
} }
/// Performs an HTTP 'GET /api/Configuration/{id}/export' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Configuration/{id}/export' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> configurationExportWithHttpInfo(String id) async { Future<Response> configurationExportWithHttpInfo(String id,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Configuration/{id}/export' final path = r'/api/Configuration/{id}/export'
.replaceAll('{' + 'id' + '}', id.toString()); .replaceAll('{id}', id);
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; const contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'GET', 'GET',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<ExportConfigurationDTO> configurationExport(String id) async { Future<MultipartFile?> configurationExport(String id,) async {
final response = await configurationExportWithHttpInfo(id); final response = await configurationExportWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ExportConfigurationDTO') as ExportConfigurationDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
}
return Future<ExportConfigurationDTO>.value(null); }
return null;
} }
/// Performs an HTTP 'GET /api/Configuration' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Configuration' operation and returns the [Response].
Future<Response> configurationGetWithHttpInfo() async { /// Parameters:
///
/// * [String] instanceId:
Future<Response> configurationGetWithHttpInfo({ String? instanceId, }) async {
// ignore: prefer_const_declarations
final path = r'/api/Configuration'; final path = r'/api/Configuration';
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; if (instanceId != null) {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; queryParams.addAll(_queryParams('', 'instanceId', instanceId));
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
} }
return await apiClient.invokeAPI( const contentTypes = <String>[];
return apiClient.invokeAPI(
path, path,
'GET', 'GET',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
Future<List<ConfigurationDTO>> configurationGet() async { /// Parameters:
final response = await configurationGetWithHttpInfo(); ///
/// * [String] instanceId:
Future<List<ConfigurationDTO>?> configurationGet({ String? instanceId, }) async {
final response = await configurationGetWithHttpInfo( instanceId: instanceId, );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<ConfigurationDTO>') as List) final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<ConfigurationDTO>') as List)
.cast<ConfigurationDTO>() .cast<ConfigurationDTO>()
.toList(growable: false); .toList();
} }
return Future<List<ConfigurationDTO>>.value(null); return null;
} }
/// Performs an HTTP 'GET /api/Configuration/{id}' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Configuration/{id}' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> configurationGetDetailWithHttpInfo(String id) async { Future<Response> configurationGetDetailWithHttpInfo(String id,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Configuration/{id}' final path = r'/api/Configuration/{id}'
.replaceAll('{' + 'id' + '}', id.toString()); .replaceAll('{id}', id);
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; const contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'GET', 'GET',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<ConfigurationDTO> configurationGetDetail(String id) async { Future<ConfigurationDTO?> configurationGetDetail(String id,) async {
final response = await configurationGetDetailWithHttpInfo(id); final response = await configurationGetDetailWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ConfigurationDTO',) as ConfigurationDTO;
}
return Future<ConfigurationDTO>.value(null); }
return null;
} }
/// Performs an HTTP 'POST /api/Configuration/import' operation and returns the [Response]. /// Performs an HTTP 'POST /api/Configuration/import' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [ExportConfigurationDTO] exportConfigurationDTO (required): /// * [ExportConfigurationDTO] exportConfigurationDTO (required):
Future<Response> configurationImportWithHttpInfo(ExportConfigurationDTO exportConfigurationDTO) async { Future<Response> configurationImportWithHttpInfo(ExportConfigurationDTO exportConfigurationDTO,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (exportConfigurationDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: exportConfigurationDTO');
}
final path = r'/api/Configuration/import'; final path = r'/api/Configuration/import';
Object postBody = exportConfigurationDTO; // ignore: prefer_final_locals
Object? postBody = exportConfigurationDTO;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['application/json']; const contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'POST', 'POST',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [ExportConfigurationDTO] exportConfigurationDTO (required): /// * [ExportConfigurationDTO] exportConfigurationDTO (required):
Future<String> configurationImport(ExportConfigurationDTO exportConfigurationDTO) async { Future<String?> configurationImport(ExportConfigurationDTO exportConfigurationDTO,) async {
final response = await configurationImportWithHttpInfo(exportConfigurationDTO); final response = await configurationImportWithHttpInfo(exportConfigurationDTO,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
}
return Future<String>.value(null); }
return null;
} }
/// Performs an HTTP 'PUT /api/Configuration' operation and returns the [Response]. /// Performs an HTTP 'PUT /api/Configuration' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [ConfigurationDTO] configurationDTO (required): /// * [ConfigurationDTO] configurationDTO (required):
Future<Response> configurationUpdateWithHttpInfo(ConfigurationDTO configurationDTO) async { Future<Response> configurationUpdateWithHttpInfo(ConfigurationDTO configurationDTO,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (configurationDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: configurationDTO');
}
final path = r'/api/Configuration'; final path = r'/api/Configuration';
Object postBody = configurationDTO; // ignore: prefer_final_locals
Object? postBody = configurationDTO;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['application/json']; const contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'PUT', 'PUT',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [ConfigurationDTO] configurationDTO (required): /// * [ConfigurationDTO] configurationDTO (required):
Future<ConfigurationDTO> configurationUpdate(ConfigurationDTO configurationDTO) async { Future<ConfigurationDTO?> configurationUpdate(ConfigurationDTO configurationDTO,) async {
final response = await configurationUpdateWithHttpInfo(configurationDTO); final response = await configurationUpdateWithHttpInfo(configurationDTO,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ConfigurationDTO',) as ConfigurationDTO;
}
return Future<ConfigurationDTO>.value(null); }
return null;
} }
} }

View File

@ -1,17 +1,18 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
class DeviceApi { class DeviceApi {
DeviceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; DeviceApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient; final ApiClient apiClient;
@ -19,370 +20,290 @@ class DeviceApi {
/// Parameters: /// Parameters:
/// ///
/// * [DeviceDetailDTO] deviceDetailDTO (required): /// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<Response> deviceCreateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async { Future<Response> deviceCreateWithHttpInfo(DeviceDetailDTO deviceDetailDTO,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (deviceDetailDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO');
}
final path = r'/api/Device'; final path = r'/api/Device';
Object postBody = deviceDetailDTO; // ignore: prefer_final_locals
Object? postBody = deviceDetailDTO;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['application/json']; const contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'POST', 'POST',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [DeviceDetailDTO] deviceDetailDTO (required): /// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<DeviceDetailDTO> deviceCreate(DeviceDetailDTO deviceDetailDTO) async { Future<DeviceDetailDTO?> deviceCreate(DeviceDetailDTO deviceDetailDTO,) async {
final response = await deviceCreateWithHttpInfo(deviceDetailDTO); final response = await deviceCreateWithHttpInfo(deviceDetailDTO,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceDetailDTO',) as DeviceDetailDTO;
}
return Future<DeviceDetailDTO>.value(null); }
return null;
} }
/// Performs an HTTP 'DELETE /api/Device/{id}' operation and returns the [Response]. /// Performs an HTTP 'DELETE /api/Device/{id}' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> deviceDeleteWithHttpInfo(String id) async { Future<Response> deviceDeleteWithHttpInfo(String id,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Device/{id}' final path = r'/api/Device/{id}'
.replaceAll('{' + 'id' + '}', id.toString()); .replaceAll('{id}', id);
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; const contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'DELETE', 'DELETE',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<String> deviceDelete(String id) async { Future<String?> deviceDelete(String id,) async {
final response = await deviceDeleteWithHttpInfo(id); final response = await deviceDeleteWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
}
return Future<String>.value(null); }
return null;
} }
/// Performs an HTTP 'GET /api/Device' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Device' operation and returns the [Response].
Future<Response> deviceGetWithHttpInfo() async { /// Parameters:
///
/// * [String] instanceId:
Future<Response> deviceGetWithHttpInfo({ String? instanceId, }) async {
// ignore: prefer_const_declarations
final path = r'/api/Device'; final path = r'/api/Device';
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; if (instanceId != null) {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; queryParams.addAll(_queryParams('', 'instanceId', instanceId));
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
} }
return await apiClient.invokeAPI( const contentTypes = <String>[];
return apiClient.invokeAPI(
path, path,
'GET', 'GET',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
Future<List<DeviceDTO>> deviceGet() async { /// Parameters:
final response = await deviceGetWithHttpInfo(); ///
/// * [String] instanceId:
Future<List<DeviceDTO>?> deviceGet({ String? instanceId, }) async {
final response = await deviceGetWithHttpInfo( instanceId: instanceId, );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<DeviceDTO>') as List) final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<DeviceDTO>') as List)
.cast<DeviceDTO>() .cast<DeviceDTO>()
.toList(growable: false); .toList();
} }
return Future<List<DeviceDTO>>.value(null); return null;
} }
/// Performs an HTTP 'GET /api/Device/{id}/detail' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Device/{id}/detail' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> deviceGetDetailWithHttpInfo(String id) async { Future<Response> deviceGetDetailWithHttpInfo(String id,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Device/{id}/detail' final path = r'/api/Device/{id}/detail'
.replaceAll('{' + 'id' + '}', id.toString()); .replaceAll('{id}', id);
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; const contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'GET', 'GET',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<DeviceDetailDTO> deviceGetDetail(String id) async { Future<DeviceDetailDTO?> deviceGetDetail(String id,) async {
final response = await deviceGetDetailWithHttpInfo(id); final response = await deviceGetDetailWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceDetailDTO',) as DeviceDetailDTO;
}
return Future<DeviceDetailDTO>.value(null); }
return null;
} }
/// Performs an HTTP 'PUT /api/Device' operation and returns the [Response]. /// Performs an HTTP 'PUT /api/Device' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [DeviceDetailDTO] deviceDetailDTO (required): /// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<Response> deviceUpdateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async { Future<Response> deviceUpdateWithHttpInfo(DeviceDetailDTO deviceDetailDTO,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (deviceDetailDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO');
}
final path = r'/api/Device'; final path = r'/api/Device';
Object postBody = deviceDetailDTO; // ignore: prefer_final_locals
Object? postBody = deviceDetailDTO;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['application/json']; const contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'PUT', 'PUT',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [DeviceDetailDTO] deviceDetailDTO (required): /// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<DeviceDetailDTO> deviceUpdate(DeviceDetailDTO deviceDetailDTO) async { Future<DeviceDetailDTO?> deviceUpdate(DeviceDetailDTO deviceDetailDTO,) async {
final response = await deviceUpdateWithHttpInfo(deviceDetailDTO); final response = await deviceUpdateWithHttpInfo(deviceDetailDTO,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceDetailDTO',) as DeviceDetailDTO;
}
return Future<DeviceDetailDTO>.value(null); }
return null;
} }
/// Performs an HTTP 'PUT /api/Device/mainInfos' operation and returns the [Response]. /// Performs an HTTP 'PUT /api/Device/mainInfos' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [DeviceDTO] deviceDTO (required): /// * [DeviceDTO] deviceDTO (required):
Future<Response> deviceUpdateMainInfosWithHttpInfo(DeviceDTO deviceDTO) async { Future<Response> deviceUpdateMainInfosWithHttpInfo(DeviceDTO deviceDTO,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (deviceDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDTO');
}
final path = r'/api/Device/mainInfos'; final path = r'/api/Device/mainInfos';
Object postBody = deviceDTO; // ignore: prefer_final_locals
Object? postBody = deviceDTO;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['application/json']; const contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'PUT', 'PUT',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [DeviceDTO] deviceDTO (required): /// * [DeviceDTO] deviceDTO (required):
Future<DeviceDTO> deviceUpdateMainInfos(DeviceDTO deviceDTO) async { Future<DeviceDTO?> deviceUpdateMainInfos(DeviceDTO deviceDTO,) async {
final response = await deviceUpdateMainInfosWithHttpInfo(deviceDTO); final response = await deviceUpdateMainInfosWithHttpInfo(deviceDTO,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDTO') as DeviceDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceDTO',) as DeviceDTO;
}
return Future<DeviceDTO>.value(null); }
return null;
} }
} }

View File

@ -0,0 +1,252 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class InstanceApi {
InstanceApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Performs an HTTP 'POST /api/Instance' operation and returns the [Response].
/// Parameters:
///
/// * [Instance] instance (required):
Future<Response> instanceCreateInstanceWithHttpInfo(Instance instance,) async {
// ignore: prefer_const_declarations
final path = r'/api/Instance';
// ignore: prefer_final_locals
Object? postBody = instance;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [Instance] instance (required):
Future<InstanceDTO?> instanceCreateInstance(Instance instance,) async {
final response = await instanceCreateInstanceWithHttpInfo(instance,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InstanceDTO',) as InstanceDTO;
}
return null;
}
/// Performs an HTTP 'DELETE /api/Instance/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> instanceDeleteInstanceWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final path = r'/api/Instance/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<String?> instanceDeleteInstance(String id,) async {
final response = await instanceDeleteInstanceWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
}
return null;
}
/// Performs an HTTP 'GET /api/Instance' operation and returns the [Response].
Future<Response> instanceGetWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/api/Instance';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<List<Instance>?> instanceGet() async {
final response = await instanceGetWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<Instance>') as List)
.cast<Instance>()
.toList();
}
return null;
}
/// Performs an HTTP 'GET /api/Instance/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> instanceGetDetailWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final path = r'/api/Instance/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<InstanceDTO?> instanceGetDetail(String id,) async {
final response = await instanceGetDetailWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InstanceDTO',) as InstanceDTO;
}
return null;
}
/// Performs an HTTP 'PUT /api/Instance' operation and returns the [Response].
/// Parameters:
///
/// * [Instance] instance (required):
Future<Response> instanceUpdateinstanceWithHttpInfo(Instance instance,) async {
// ignore: prefer_const_declarations
final path = r'/api/Instance';
// ignore: prefer_final_locals
Object? postBody = instance;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [Instance] instance (required):
Future<InstanceDTO?> instanceUpdateinstance(Instance instance,) async {
final response = await instanceUpdateinstanceWithHttpInfo(instance,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InstanceDTO',) as InstanceDTO;
}
return null;
}
}

View File

@ -1,17 +1,18 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
class ResourceApi { class ResourceApi {
ResourceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; ResourceApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient; final ApiClient apiClient;
@ -19,372 +20,299 @@ class ResourceApi {
/// Parameters: /// Parameters:
/// ///
/// * [ResourceDTO] resourceDTO (required): /// * [ResourceDTO] resourceDTO (required):
Future<Response> resourceCreateWithHttpInfo(ResourceDTO resourceDTO) async { Future<Response> resourceCreateWithHttpInfo(ResourceDTO resourceDTO,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (resourceDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO');
}
final path = r'/api/Resource'; final path = r'/api/Resource';
Object postBody = resourceDTO; // ignore: prefer_final_locals
Object? postBody = resourceDTO;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['application/json']; const contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'POST', 'POST',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [ResourceDTO] resourceDTO (required): /// * [ResourceDTO] resourceDTO (required):
Future<ResourceDTO> resourceCreate(ResourceDTO resourceDTO) async { Future<ResourceDTO?> resourceCreate(ResourceDTO resourceDTO,) async {
final response = await resourceCreateWithHttpInfo(resourceDTO); final response = await resourceCreateWithHttpInfo(resourceDTO,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ResourceDTO',) as ResourceDTO;
}
return Future<ResourceDTO>.value(null); }
return null;
} }
/// Performs an HTTP 'DELETE /api/Resource/{id}' operation and returns the [Response]. /// Performs an HTTP 'DELETE /api/Resource/{id}' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> resourceDeleteWithHttpInfo(String id) async { Future<Response> resourceDeleteWithHttpInfo(String id,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Resource/{id}' final path = r'/api/Resource/{id}'
.replaceAll('{' + 'id' + '}', id.toString()); .replaceAll('{id}', id);
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; const contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'DELETE', 'DELETE',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<String> resourceDelete(String id) async { Future<String?> resourceDelete(String id,) async {
final response = await resourceDeleteWithHttpInfo(id); final response = await resourceDeleteWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
}
return Future<String>.value(null); }
return null;
} }
/// Performs an HTTP 'GET /api/Resource' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Resource' operation and returns the [Response].
Future<Response> resourceGetWithHttpInfo() async { /// Parameters:
///
/// * [String] instanceId:
///
/// * [List<ResourceType>] types:
Future<Response> resourceGetWithHttpInfo({ String? instanceId, List<ResourceType>? types, }) async {
// ignore: prefer_const_declarations
final path = r'/api/Resource'; final path = r'/api/Resource';
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; if (instanceId != null) {
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null; queryParams.addAll(_queryParams('', 'instanceId', instanceId));
final authNames = <String>['bearer']; }
if (types != null) {
if ( queryParams.addAll(_queryParams('multi', 'types', types));
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
} }
return await apiClient.invokeAPI( const contentTypes = <String>[];
return apiClient.invokeAPI(
path, path,
'GET', 'GET',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
Future<List<ResourceDTO>> resourceGet() async { /// Parameters:
final response = await resourceGetWithHttpInfo(); ///
/// * [String] instanceId:
///
/// * [List<ResourceType>] types:
Future<List<ResourceDTO>?> resourceGet({ String? instanceId, List<ResourceType>? types, }) async {
final response = await resourceGetWithHttpInfo( instanceId: instanceId, types: types, );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<ResourceDTO>') as List) final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<ResourceDTO>') as List)
.cast<ResourceDTO>() .cast<ResourceDTO>()
.toList(growable: false); .toList();
} }
return Future<List<ResourceDTO>>.value(null); return null;
} }
/// Performs an HTTP 'GET /api/Resource/{id}/detail' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Resource/{id}/detail' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> resourceGetDetailWithHttpInfo(String id) async { Future<Response> resourceGetDetailWithHttpInfo(String id,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Resource/{id}/detail' final path = r'/api/Resource/{id}/detail'
.replaceAll('{' + 'id' + '}', id.toString()); .replaceAll('{id}', id);
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; const contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'GET', 'GET',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<ResourceDTO> resourceGetDetail(String id) async { Future<ResourceDTO?> resourceGetDetail(String id,) async {
final response = await resourceGetDetailWithHttpInfo(id); final response = await resourceGetDetailWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ResourceDTO',) as ResourceDTO;
}
return Future<ResourceDTO>.value(null); }
return null;
} }
/// Performs an HTTP 'GET /api/Resource/{id}' operation and returns the [Response]. /// Performs an HTTP 'GET /api/Resource/{id}' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> resourceShowWithHttpInfo(String id) async { Future<Response> resourceShowWithHttpInfo(String id,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/Resource/{id}' final path = r'/api/Resource/{id}'
.replaceAll('{' + 'id' + '}', id.toString()); .replaceAll('{id}', id);
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; const contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'GET', 'GET',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<MultipartFile> resourceShow(String id) async { Future<MultipartFile?> resourceShow(String id,) async {
final response = await resourceShowWithHttpInfo(id); final response = await resourceShowWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
}
return Future<MultipartFile>.value(null); }
return null;
} }
/// Performs an HTTP 'PUT /api/Resource' operation and returns the [Response]. /// Performs an HTTP 'PUT /api/Resource' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [ResourceDTO] resourceDTO (required): /// * [ResourceDTO] resourceDTO (required):
Future<Response> resourceUpdateWithHttpInfo(ResourceDTO resourceDTO) async { Future<Response> resourceUpdateWithHttpInfo(ResourceDTO resourceDTO,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (resourceDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO');
}
final path = r'/api/Resource'; final path = r'/api/Resource';
Object postBody = resourceDTO; // ignore: prefer_final_locals
Object? postBody = resourceDTO;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['application/json']; const contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'PUT', 'PUT',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [ResourceDTO] resourceDTO (required): /// * [ResourceDTO] resourceDTO (required):
Future<ResourceDTO> resourceUpdate(ResourceDTO resourceDTO) async { Future<ResourceDTO?> resourceUpdate(ResourceDTO resourceDTO,) async {
final response = await resourceUpdateWithHttpInfo(resourceDTO); final response = await resourceUpdateWithHttpInfo(resourceDTO,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ResourceDTO',) as ResourceDTO;
}
return Future<ResourceDTO>.value(null); }
return null;
} }
/// Performs an HTTP 'POST /api/Resource/upload' operation and returns the [Response]. /// Performs an HTTP 'POST /api/Resource/upload' operation and returns the [Response].
@ -393,56 +321,47 @@ class ResourceApi {
/// * [String] label: /// * [String] label:
/// ///
/// * [String] type: /// * [String] type:
Future<Response> resourceUploadWithHttpInfo({ String label, String type }) async { ///
// Verify required params are set. /// * [String] instanceId:
Future<Response> resourceUploadWithHttpInfo({ String? label, String? type, String? instanceId, }) async {
// ignore: prefer_const_declarations
final path = r'/api/Resource/upload'; final path = r'/api/Resource/upload';
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['multipart/form-data']; const contentTypes = <String>['multipart/form-data'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if ( bool hasFields = false;
nullableContentType != null && final mp = MultipartRequest('POST', Uri.parse(path));
nullableContentType.toLowerCase().startsWith('multipart/form-data') if (label != null) {
) { hasFields = true;
bool hasFields = false; mp.fields[r'label'] = parameterToString(label);
final mp = MultipartRequest(null, null); }
if (label != null) { if (type != null) {
hasFields = true; hasFields = true;
mp.fields[r'label'] = parameterToString(label); mp.fields[r'type'] = parameterToString(type);
} }
if (type != null) { if (instanceId != null) {
hasFields = true; hasFields = true;
mp.fields[r'type'] = parameterToString(type); mp.fields[r'instanceId'] = parameterToString(instanceId);
} }
if (hasFields) { if (hasFields) {
postBody = mp; postBody = mp;
}
} else {
if (label != null) {
formParams[r'label'] = parameterToString(label);
}
if (type != null) {
formParams[r'type'] = parameterToString(type);
}
} }
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'POST', 'POST',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
@ -451,17 +370,20 @@ class ResourceApi {
/// * [String] label: /// * [String] label:
/// ///
/// * [String] type: /// * [String] type:
Future<String> resourceUpload({ String label, String type }) async { ///
final response = await resourceUploadWithHttpInfo( label: label, type: type ); /// * [String] instanceId:
Future<String?> resourceUpload({ String? label, String? type, String? instanceId, }) async {
final response = await resourceUploadWithHttpInfo( label: label, type: type, instanceId: instanceId, );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
}
return Future<String>.value(null); }
return null;
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,18 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
class UserApi { class UserApi {
UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient; UserApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient; final ApiClient apiClient;
@ -19,307 +20,233 @@ class UserApi {
/// Parameters: /// Parameters:
/// ///
/// * [User] user (required): /// * [User] user (required):
Future<Response> userCreateUserWithHttpInfo(User user) async { Future<Response> userCreateUserWithHttpInfo(User user,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
}
final path = r'/api/User'; final path = r'/api/User';
Object postBody = user; // ignore: prefer_final_locals
Object? postBody = user;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['application/json']; const contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'POST', 'POST',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [User] user (required): /// * [User] user (required):
Future<UserDetailDTO> userCreateUser(User user) async { Future<UserDetailDTO?> userCreateUser(User user,) async {
final response = await userCreateUserWithHttpInfo(user); final response = await userCreateUserWithHttpInfo(user,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserDetailDTO',) as UserDetailDTO;
}
return Future<UserDetailDTO>.value(null); }
return null;
} }
/// Performs an HTTP 'DELETE /api/User/{id}' operation and returns the [Response]. /// Performs an HTTP 'DELETE /api/User/{id}' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> userDeleteUserWithHttpInfo(String id) async { Future<Response> userDeleteUserWithHttpInfo(String id,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/User/{id}' final path = r'/api/User/{id}'
.replaceAll('{' + 'id' + '}', id.toString()); .replaceAll('{id}', id);
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; const contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'DELETE', 'DELETE',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<String> userDeleteUser(String id) async { Future<String?> userDeleteUser(String id,) async {
final response = await userDeleteUserWithHttpInfo(id); final response = await userDeleteUserWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
}
return Future<String>.value(null); }
return null;
} }
/// Performs an HTTP 'GET /api/User' operation and returns the [Response]. /// Performs an HTTP 'GET /api/User' operation and returns the [Response].
Future<Response> userGetWithHttpInfo() async { Future<Response> userGetWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/api/User'; final path = r'/api/User';
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; const contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'GET', 'GET',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
Future<List<User>> userGet() async { Future<List<User>?> userGet() async {
final response = await userGetWithHttpInfo(); final response = await userGetWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<User>') as List) final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<User>') as List)
.cast<User>() .cast<User>()
.toList(growable: false); .toList();
} }
return Future<List<User>>.value(null); return null;
} }
/// Performs an HTTP 'GET /api/User/{id}' operation and returns the [Response]. /// Performs an HTTP 'GET /api/User/{id}' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<Response> userGetDetailWithHttpInfo(String id) async { Future<Response> userGetDetailWithHttpInfo(String id,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
final path = r'/api/User/{id}' final path = r'/api/User/{id}'
.replaceAll('{' + 'id' + '}', id.toString()); .replaceAll('{id}', id);
Object postBody; // ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>[]; const contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'GET', 'GET',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [String] id (required): /// * [String] id (required):
Future<UserDetailDTO> userGetDetail(String id) async { Future<UserDetailDTO?> userGetDetail(String id,) async {
final response = await userGetDetailWithHttpInfo(id); final response = await userGetDetailWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserDetailDTO',) as UserDetailDTO;
}
return Future<UserDetailDTO>.value(null); }
return null;
} }
/// Performs an HTTP 'PUT /api/User' operation and returns the [Response]. /// Performs an HTTP 'PUT /api/User' operation and returns the [Response].
/// Parameters: /// Parameters:
/// ///
/// * [User] user (required): /// * [User] user (required):
Future<Response> userUpdateUserWithHttpInfo(User user) async { Future<Response> userUpdateUserWithHttpInfo(User user,) async {
// Verify required params are set. // ignore: prefer_const_declarations
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
}
final path = r'/api/User'; final path = r'/api/User';
Object postBody = user; // ignore: prefer_final_locals
Object? postBody = user;
final queryParams = <QueryParam>[]; final queryParams = <QueryParam>[];
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
final contentTypes = <String>['application/json']; const contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (hasFields) {
postBody = mp;
}
} else {
}
return await apiClient.invokeAPI( return apiClient.invokeAPI(
path, path,
'PUT', 'PUT',
queryParams, queryParams,
postBody, postBody,
headerParams, headerParams,
formParams, formParams,
nullableContentType, contentTypes.isEmpty ? null : contentTypes.first,
authNames,
); );
} }
/// Parameters: /// Parameters:
/// ///
/// * [User] user (required): /// * [User] user (required):
Future<UserDetailDTO> userUpdateUser(User user) async { Future<UserDetailDTO?> userUpdateUser(User user,) async {
final response = await userUpdateUserWithHttpInfo(user); final response = await userUpdateUserWithHttpInfo(user,);
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }
// When a remote server returns no body with a status of 204, we shall not decode it. // When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input" // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string. // FormatException when trying to decode an empty string.
if (response.body != null && response.statusCode != HttpStatus.noContent) { if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO; return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserDetailDTO',) as UserDetailDTO;
}
return Future<UserDetailDTO>.value(null); }
return null;
} }
} }

View File

@ -1,19 +1,17 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
class ApiClient { class ApiClient {
ApiClient({this.basePath = 'http://192.168.31.140'}) { ApiClient({this.basePath = 'https://api.mymuseum.be', this.authentication});
// Setup authentications (key: authentication name, value: authentication).
_authentications[r'bearer'] = OAuth();
}
final String basePath; final String basePath;
@ -25,17 +23,12 @@ class ApiClient {
Client get client => _client; Client get client => _client;
/// Requests to use a new HTTP [Client] in this class. /// Requests to use a new HTTP [Client] in this class.
///
/// If the [newClient] is null, an [ArgumentError] is thrown.
set client(Client newClient) { set client(Client newClient) {
if (newClient == null) {
throw ArgumentError('New client instance cannot be null.');
}
_client = newClient; _client = newClient;
} }
final _defaultHeaderMap = <String, String>{}; final _defaultHeaderMap = <String, String>{};
final _authentications = <String, Authentication>{}; final Authentication? authentication;
void addDefaultHeader(String key, String value) { void addDefaultHeader(String key, String value) {
_defaultHeaderMap[key] = value; _defaultHeaderMap[key] = value;
@ -43,59 +36,42 @@ class ApiClient {
Map<String,String> get defaultHeaderMap => _defaultHeaderMap; Map<String,String> get defaultHeaderMap => _defaultHeaderMap;
/// returns an unmodifiable view of the authentications, since none should be added // We don't use a Map<String, String> for queryParams.
/// nor deleted
Map<String, Authentication> get authentications =>
Map.unmodifiable(_authentications);
T getAuthentication<T extends Authentication>(String name) {
final authentication = _authentications[name];
return authentication is T ? authentication : null;
}
// We dont use a Map<String, String> for queryParams.
// If collectionFormat is 'multi', a key might appear multiple times. // If collectionFormat is 'multi', a key might appear multiple times.
Future<Response> invokeAPI( Future<Response> invokeAPI(
String path, String path,
String method, String method,
Iterable<QueryParam> queryParams, List<QueryParam> queryParams,
Object body, Object? body,
Map<String, String> headerParams, Map<String, String> headerParams,
Map<String, String> formParams, Map<String, String> formParams,
String nullableContentType, String? contentType,
List<String> authNames,
) async { ) async {
_updateParamsForAuth(authNames, queryParams, headerParams); _updateParamsForAuth(queryParams, headerParams);
headerParams.addAll(_defaultHeaderMap); headerParams.addAll(_defaultHeaderMap);
if (contentType != null) {
final urlEncodedQueryParams = queryParams headerParams['Content-Type'] = contentType;
.where((param) => param.value != null)
.map((param) => '$param');
final queryString = urlEncodedQueryParams.isNotEmpty
? '?${urlEncodedQueryParams.join('&')}'
: '';
final url = '$basePath$path$queryString';
if (nullableContentType != null) {
headerParams['Content-Type'] = nullableContentType;
} }
final urlEncodedQueryParams = queryParams.map((param) => '$param');
final queryString = urlEncodedQueryParams.isNotEmpty ? '?${urlEncodedQueryParams.join('&')}' : '';
final uri = Uri.parse('$basePath$path$queryString');
try { try {
// Special case for uploading a single file which isnt a 'multipart/form-data'. // Special case for uploading a single file which isn't a 'multipart/form-data'.
if ( if (
body is MultipartFile && (nullableContentType == null || body is MultipartFile && (contentType == null ||
!nullableContentType.toLowerCase().startsWith('multipart/form-data')) !contentType.toLowerCase().startsWith('multipart/form-data'))
) { ) {
final request = StreamedRequest(method, Uri.parse(url)); final request = StreamedRequest(method, uri);
request.headers.addAll(headerParams); request.headers.addAll(headerParams);
request.contentLength = body.length; request.contentLength = body.length;
body.finalize().listen( body.finalize().listen(
request.sink.add, request.sink.add,
onDone: request.sink.close, onDone: request.sink.close,
onError: (error, trace) => request.sink.close(), // ignore: avoid_types_on_closure_parameters
onError: (Object error, StackTrace trace) => request.sink.close(),
cancelOnError: true, cancelOnError: true,
); );
final response = await _client.send(request); final response = await _client.send(request);
@ -103,7 +79,7 @@ class ApiClient {
} }
if (body is MultipartRequest) { if (body is MultipartRequest) {
final request = MultipartRequest(method, Uri.parse(url)); final request = MultipartRequest(method, uri);
request.fields.addAll(body.fields); request.fields.addAll(body.fields);
request.files.addAll(body.files); request.files.addAll(body.files);
request.headers.addAll(body.headers); request.headers.addAll(body.headers);
@ -112,50 +88,110 @@ class ApiClient {
return Response.fromStream(response); return Response.fromStream(response);
} }
final msgBody = nullableContentType == 'application/x-www-form-urlencoded' final msgBody = contentType == 'application/x-www-form-urlencoded'
? formParams ? formParams
: serialize(body); : await serializeAsync(body);
final nullableHeaderParams = headerParams.isEmpty ? null : headerParams; final nullableHeaderParams = headerParams.isEmpty ? null : headerParams;
switch(method) { switch(method) {
case 'POST': return await _client.post(url, headers: nullableHeaderParams, body: msgBody,); case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,);
case 'PUT': return await _client.put(url, headers: nullableHeaderParams, body: msgBody,); case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,);
case 'DELETE': return await _client.delete(url, headers: nullableHeaderParams,); case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,);
case 'PATCH': return await _client.patch(url, headers: nullableHeaderParams, body: msgBody,); case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,);
case 'HEAD': return await _client.head(url, headers: nullableHeaderParams,); case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,);
case 'GET': return await _client.get(url, headers: nullableHeaderParams,); case 'GET': return await _client.get(uri, headers: nullableHeaderParams,);
} }
} on SocketException catch (e, trace) { } on SocketException catch (error, trace) {
throw ApiException.withInner(HttpStatus.badRequest, 'Socket operation failed: $method $path', e, trace,); throw ApiException.withInner(
} on TlsException catch (e, trace) { HttpStatus.badRequest,
throw ApiException.withInner(HttpStatus.badRequest, 'TLS/SSL communication failed: $method $path', e, trace,); 'Socket operation failed: $method $path',
} on IOException catch (e, trace) { error,
throw ApiException.withInner(HttpStatus.badRequest, 'I/O operation failed: $method $path', e, trace,); trace,
} on ClientException catch (e, trace) { );
throw ApiException.withInner(HttpStatus.badRequest, 'HTTP connection failed: $method $path', e, trace,); } on TlsException catch (error, trace) {
} on Exception catch (e, trace) { throw ApiException.withInner(
throw ApiException.withInner(HttpStatus.badRequest, 'Exception occurred: $method $path', e, trace,); HttpStatus.badRequest,
'TLS/SSL communication failed: $method $path',
error,
trace,
);
} on IOException catch (error, trace) {
throw ApiException.withInner(
HttpStatus.badRequest,
'I/O operation failed: $method $path',
error,
trace,
);
} on ClientException catch (error, trace) {
throw ApiException.withInner(
HttpStatus.badRequest,
'HTTP connection failed: $method $path',
error,
trace,
);
} on Exception catch (error, trace) {
throw ApiException.withInner(
HttpStatus.badRequest,
'Exception occurred: $method $path',
error,
trace,
);
} }
throw ApiException(HttpStatus.badRequest, 'Invalid HTTP operation: $method $path',); throw ApiException(
HttpStatus.badRequest,
'Invalid HTTP operation: $method $path',
);
} }
dynamic _deserialize(dynamic value, String targetType, {bool growable}) { Future<dynamic> deserializeAsync(String json, String targetType, {bool growable = false,}) async =>
// ignore: deprecated_member_use_from_same_package
deserialize(json, targetType, growable: growable);
@Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.')
dynamic deserialize(String json, String targetType, {bool growable = false,}) {
// Remove all spaces. Necessary for regular expressions as well.
targetType = targetType.replaceAll(' ', ''); // ignore: parameter_assignments
// If the expected target type is String, nothing to do...
return targetType == 'String'
? json
: _deserialize(jsonDecode(json), targetType, growable: growable);
}
// ignore: deprecated_member_use_from_same_package
Future<String> serializeAsync(Object? value) async => serialize(value);
@Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.')
String serialize(Object? value) => value == null ? '' : json.encode(value);
/// Update query and header parameters based on authentication settings.
void _updateParamsForAuth(
List<QueryParam> queryParams,
Map<String, String> headerParams,
) {
if (authentication != null) {
authentication!.applyToParams(queryParams, headerParams);
}
}
static dynamic _deserialize(dynamic value, String targetType, {bool growable = false}) {
try { try {
switch (targetType) { switch (targetType) {
case 'String': case 'String':
return '$value'; return value is String ? value : value.toString();
case 'int': case 'int':
return value is int ? value : int.parse('$value'); return value is int ? value : int.parse('$value');
case 'double':
return value is double ? value : double.parse('$value');
case 'bool': case 'bool':
if (value is bool) { if (value is bool) {
return value; return value;
} }
final valueString = '$value'.toLowerCase(); final valueString = '$value'.toLowerCase();
return valueString == 'true' || valueString == '1'; return valueString == 'true' || valueString == '1';
break; case 'ArticleDTO':
case 'double': return ArticleDTO.fromJson(value);
return value is double ? value : double.parse('$value');
case 'ConfigurationDTO': case 'ConfigurationDTO':
return ConfigurationDTO.fromJson(value); return ConfigurationDTO.fromJson(value);
case 'DeviceDTO': case 'DeviceDTO':
@ -174,6 +210,10 @@ class ApiClient {
return ImageDTO.fromJson(value); return ImageDTO.fromJson(value);
case 'ImageGeoPoint': case 'ImageGeoPoint':
return ImageGeoPoint.fromJson(value); return ImageGeoPoint.fromJson(value);
case 'Instance':
return Instance.fromJson(value);
case 'InstanceDTO':
return InstanceDTO.fromJson(value);
case 'LevelDTO': case 'LevelDTO':
return LevelDTO.fromJson(value); return LevelDTO.fromJson(value);
case 'LoginDTO': case 'LoginDTO':
@ -182,7 +222,6 @@ class ApiClient {
return MapDTO.fromJson(value); return MapDTO.fromJson(value);
case 'MapTypeApp': case 'MapTypeApp':
return MapTypeAppTypeTransformer().decode(value); return MapTypeAppTypeTransformer().decode(value);
case 'MenuDTO': case 'MenuDTO':
return MenuDTO.fromJson(value); return MenuDTO.fromJson(value);
case 'PlayerMessageDTO': case 'PlayerMessageDTO':
@ -191,18 +230,18 @@ class ApiClient {
return QuestionDTO.fromJson(value); return QuestionDTO.fromJson(value);
case 'QuizzDTO': case 'QuizzDTO':
return QuizzDTO.fromJson(value); return QuizzDTO.fromJson(value);
case 'QuizzDTOBadLevel':
return QuizzDTOBadLevel.fromJson(value);
case 'ResourceDTO': case 'ResourceDTO':
return ResourceDTO.fromJson(value); return ResourceDTO.fromJson(value);
case 'ResourceType': case 'ResourceType':
return ResourceTypeTypeTransformer().decode(value); return ResourceTypeTypeTransformer().decode(value);
case 'ResponseDTO': case 'ResponseDTO':
return ResponseDTO.fromJson(value); return ResponseDTO.fromJson(value);
case 'SectionDTO': case 'SectionDTO':
return SectionDTO.fromJson(value); return SectionDTO.fromJson(value);
case 'SectionType': case 'SectionType':
return SectionTypeTypeTransformer().decode(value); return SectionTypeTypeTransformer().decode(value);
case 'SliderDTO': case 'SliderDTO':
return SliderDTO.fromJson(value); return SliderDTO.fromJson(value);
case 'TokenDTO': case 'TokenDTO':
@ -218,58 +257,63 @@ class ApiClient {
case 'WebDTO': case 'WebDTO':
return WebDTO.fromJson(value); return WebDTO.fromJson(value);
default: default:
Match match; dynamic match;
if (value is List && (match = _regList.firstMatch(targetType)) != null) { if (value is List && (match = _regList.firstMatch(targetType)?.group(1)) != null) {
final newTargetType = match[1];
return value return value
.map((v) => _deserialize(v, newTargetType, growable: growable)) .map<dynamic>((dynamic v) => _deserialize(v, match, growable: growable,))
.toList(growable: true == growable); .toList(growable: growable);
} }
if (value is Set && (match = _regSet.firstMatch(targetType)) != null) { if (value is Set && (match = _regSet.firstMatch(targetType)?.group(1)) != null) {
final newTargetType = match[1];
return value return value
.map((v) => _deserialize(v, newTargetType, growable: growable)) .map<dynamic>((dynamic v) => _deserialize(v, match, growable: growable,))
.toSet(); .toSet();
} }
if (value is Map && (match = _regMap.firstMatch(targetType)) != null) { if (value is Map && (match = _regMap.firstMatch(targetType)?.group(1)) != null) {
final newTargetType = match[1]; return Map<String, dynamic>.fromIterables(
return Map.fromIterables( value.keys.cast<String>(),
value.keys, value.values.map<dynamic>((dynamic v) => _deserialize(v, match, growable: growable,)),
value.values.map((v) => _deserialize(v, newTargetType, growable: growable)),
); );
} }
break;
} }
} on Exception catch (e, stack) { } on Exception catch (error, trace) {
throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', e, stack,); throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', error, trace,);
} }
throw ApiException(HttpStatus.internalServerError, 'Could not find a suitable class for deserialization',); throw ApiException(HttpStatus.internalServerError, 'Could not find a suitable class for deserialization',);
} }
dynamic deserialize(String json, String targetType, {bool growable}) {
// Remove all spaces. Necessary for reg expressions as well.
targetType = targetType.replaceAll(' ', '');
return targetType == 'String'
? json
: _deserialize(jsonDecode(json), targetType, growable: true == growable);
}
String serialize(Object obj) => obj == null ? '' : json.encode(obj);
/// Update query and header parameters based on authentication settings.
/// @param authNames The authentications to apply
void _updateParamsForAuth(
List<String> authNames,
List<QueryParam> queryParams,
Map<String, String> headerParams,
) {
authNames.forEach((authName) {
final auth = _authentications[authName];
if (auth == null) {
throw ArgumentError('Authentication undefined: $authName');
}
auth.applyToParams(queryParams, headerParams);
});
}
} }
/// Primarily intended for use in an isolate.
class DeserializationMessage {
const DeserializationMessage({
required this.json,
required this.targetType,
this.growable = false,
});
/// The JSON value to deserialize.
final String json;
/// Target type to deserialize to.
final String targetType;
/// Whether to make deserialized lists or maps growable.
final bool growable;
}
/// Primarily intended for use in an isolate.
Future<dynamic> deserializeAsync(DeserializationMessage message) async {
// Remove all spaces. Necessary for regular expressions as well.
final targetType = message.targetType.replaceAll(' ', '');
// If the expected target type is String, nothing to do...
return targetType == 'String'
? message.json
: ApiClient._deserialize(
jsonDecode(message.json),
targetType,
growable: message.growable,
);
}
/// Primarily intended for use in an isolate.
Future<String> serializeAsync(Object? value) async => value == null ? '' : json.encode(value);

View File

@ -1,10 +1,11 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
@ -15,10 +16,11 @@ class ApiException implements Exception {
ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace); ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace);
int code = 0; int code = 0;
String message; String? message;
Exception innerException; Exception? innerException;
StackTrace stackTrace; StackTrace? stackTrace;
@override
String toString() { String toString() {
if (message == null) { if (message == null) {
return 'ApiException'; return 'ApiException';

View File

@ -1,10 +1,11 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
@ -20,31 +21,27 @@ class QueryParam {
} }
// Ported from the Java version. // Ported from the Java version.
Iterable<QueryParam> _convertParametersForCollectionFormat( Iterable<QueryParam> _queryParams(String collectionFormat, String name, dynamic value,) {
String collectionFormat, // Assertions to run in debug mode only.
String name, assert(name.isNotEmpty, 'Parameter cannot be an empty string.');
dynamic value,
) {
final params = <QueryParam>[]; final params = <QueryParam>[];
// preconditions if (value is List) {
if (name != null && !name.isEmpty && value != null) { if (collectionFormat == 'multi') {
if (value is List) { return value.map((dynamic v) => QueryParam(name, parameterToString(v)),);
// get the collection format, default: csv
collectionFormat = (collectionFormat == null || collectionFormat.isEmpty)
? 'csv'
: collectionFormat;
if (collectionFormat == 'multi') {
return value.map((v) => QueryParam(name, parameterToString(v)));
}
final delimiter = _delimiters[collectionFormat] ?? ',';
params.add(QueryParam(name, value.map((v) => parameterToString(v)).join(delimiter)));
} else {
params.add(QueryParam(name, parameterToString(value)));
} }
// Default collection format is 'csv'.
if (collectionFormat.isEmpty) {
collectionFormat = 'csv'; // ignore: parameter_assignments
}
final delimiter = _delimiters[collectionFormat] ?? ',';
params.add(QueryParam(name, value.map<dynamic>(parameterToString).join(delimiter),));
} else if (value != null) {
params.add(QueryParam(name, parameterToString(value)));
} }
return params; return params;
@ -72,9 +69,42 @@ String parameterToString(dynamic value) {
/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json' /// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json'
/// content type. Otherwise, returns the decoded body as decoded by dart:http package. /// content type. Otherwise, returns the decoded body as decoded by dart:http package.
String _decodeBodyBytes(Response response) { Future<String> _decodeBodyBytes(Response response) async {
final contentType = response.headers['content-type']; final contentType = response.headers['content-type'];
return contentType != null && contentType.toLowerCase().startsWith('application/json') return contentType != null && contentType.toLowerCase().startsWith('application/json')
? response.bodyBytes == null ? null : utf8.decode(response.bodyBytes) ? response.bodyBytes.isEmpty ? '' : utf8.decode(response.bodyBytes)
: response.body; : response.body;
} }
/// Returns a valid [T] value found at the specified Map [key], null otherwise.
T? mapValueOfType<T>(dynamic map, String key) {
final dynamic value = map is Map ? map[key] : null;
return value is T ? value : null;
}
/// Returns a valid Map<K, V> found at the specified Map [key], null otherwise.
Map<K, V>? mapCastOfType<K, V>(dynamic map, String key) {
final dynamic value = map is Map ? map[key] : null;
return value is Map ? value.cast<K, V>() : null;
}
/// Returns a valid [DateTime] found at the specified Map [key], null otherwise.
DateTime? mapDateTime(dynamic map, String key, [String? pattern]) {
final dynamic value = map is Map ? map[key] : null;
if (value != null) {
int? millis;
if (value is int) {
millis = value;
} else if (value is String) {
if (pattern == _dateEpochMarker) {
millis = int.tryParse(value);
} else {
return DateTime.tryParse(value);
}
}
if (millis != null) {
return DateTime.fromMillisecondsSinceEpoch(millis, isUtc: true);
}
}
return null;
}

View File

@ -1,10 +1,11 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
@ -15,21 +16,25 @@ class ApiKeyAuth implements Authentication {
final String location; final String location;
final String paramName; final String paramName;
String apiKeyPrefix; String apiKeyPrefix = '';
String apiKey; String apiKey = '';
@override @override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) { void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
final value = apiKeyPrefix == null ? apiKey : '$apiKeyPrefix $apiKey'; final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey';
if (location == 'query' && value != null) { if (paramValue.isNotEmpty) {
queryParams.add(QueryParam(paramName, value)); if (location == 'query') {
} else if (location == 'header' && value != null) { queryParams.add(QueryParam(paramName, paramValue));
headerParams[paramName] = value; } else if (location == 'header') {
} else if (location == 'cookie' && value != null) { headerParams[paramName] = paramValue;
headerParams.update('Cookie', (String existingCookie) { } else if (location == 'cookie') {
return '$existingCookie; $paramName=$value'; headerParams.update(
}, ifAbsent: () => '$paramName=$value'); 'Cookie',
(existingCookie) => '$existingCookie; $paramName=$paramValue',
ifAbsent: () => '$paramName=$paramValue',
);
}
} }
} }
} }

View File

@ -1,14 +1,16 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
// ignore: one_member_abstracts
abstract class Authentication { abstract class Authentication {
/// Apply authentication settings to header and query params. /// Apply authentication settings to header and query params.
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams); void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams);

View File

@ -1,21 +1,26 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
class HttpBasicAuth implements Authentication { class HttpBasicAuth implements Authentication {
HttpBasicAuth({this.username = '', this.password = ''});
String username; String username;
String password; String password;
@override @override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) { void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
final credentials = (username ?? '') + ':' + (password ?? ''); if (username.isNotEmpty && password.isNotEmpty) {
headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}'; final credentials = '$username:$password';
headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}';
}
} }
} }

View File

@ -1,10 +1,11 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
@ -20,19 +21,29 @@ class HttpBearerAuth implements Authentication {
set accessToken(dynamic accessToken) { set accessToken(dynamic accessToken) {
if (accessToken is! String && accessToken is! HttpBearerAuthProvider) { if (accessToken is! String && accessToken is! HttpBearerAuthProvider) {
throw ArgumentError('Type of Bearer accessToken should be a String or a String Function().'); throw ArgumentError('accessToken value must be either a String or a String Function().');
} }
this._accessToken = accessToken; _accessToken = accessToken;
} }
@override @override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) { void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
if (_accessToken == null) {
return;
}
String accessToken;
if (_accessToken is String) { if (_accessToken is String) {
headerParams['Authorization'] = 'Bearer $_accessToken'; accessToken = _accessToken;
} else if (_accessToken is HttpBearerAuthProvider) { } else if (_accessToken is HttpBearerAuthProvider) {
headerParams['Authorization'] = 'Bearer ${_accessToken()}'; accessToken = _accessToken!();
} else { } else {
throw ArgumentError('Type of Bearer accessToken should be a String or a String Function().'); return;
}
if (accessToken.isNotEmpty) {
headerParams['Authorization'] = 'Bearer $accessToken';
} }
} }
} }

View File

@ -1,22 +1,23 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
class OAuth implements Authentication { class OAuth implements Authentication {
OAuth({this.accessToken}); OAuth({this.accessToken = ''});
String accessToken; String accessToken;
@override @override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) { void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
if (accessToken != null) { if (accessToken.isNotEmpty) {
headerParams['Authorization'] = 'Bearer $accessToken'; headerParams['Authorization'] = 'Bearer $accessToken';
} }
} }

View File

@ -0,0 +1,160 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ArticleDTO {
/// Returns a new [ArticleDTO] instance.
ArticleDTO({
this.content = const [],
this.isContentTop,
this.audioIds = const [],
this.isReadAudioAuto,
this.images = const [],
});
List<TranslationDTO>? content;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isContentTop;
List<TranslationDTO>? audioIds;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isReadAudioAuto;
List<ImageDTO>? images;
@override
bool operator ==(Object other) => identical(this, other) || other is ArticleDTO &&
other.content == content &&
other.isContentTop == isContentTop &&
other.audioIds == audioIds &&
other.isReadAudioAuto == isReadAudioAuto &&
other.images == images;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(content == null ? 0 : content!.hashCode) +
(isContentTop == null ? 0 : isContentTop!.hashCode) +
(audioIds == null ? 0 : audioIds!.hashCode) +
(isReadAudioAuto == null ? 0 : isReadAudioAuto!.hashCode) +
(images == null ? 0 : images!.hashCode);
@override
String toString() => 'ArticleDTO[content=$content, isContentTop=$isContentTop, audioIds=$audioIds, isReadAudioAuto=$isReadAudioAuto, images=$images]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
if (content != null) {
_json[r'content'] = content;
}
if (isContentTop != null) {
_json[r'isContentTop'] = isContentTop;
}
if (audioIds != null) {
_json[r'audioIds'] = audioIds;
}
if (isReadAudioAuto != null) {
_json[r'isReadAudioAuto'] = isReadAudioAuto;
}
if (images != null) {
_json[r'images'] = images;
}
return _json;
}
/// Returns a new [ArticleDTO] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ArticleDTO? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "ArticleDTO[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "ArticleDTO[$key]" has a null value in JSON.');
});
return true;
}());
return ArticleDTO(
content: TranslationDTO.listFromJson(json[r'content']) ?? const [],
isContentTop: mapValueOfType<bool>(json, r'isContentTop'),
audioIds: TranslationDTO.listFromJson(json[r'audioIds']) ?? const [],
isReadAudioAuto: mapValueOfType<bool>(json, r'isReadAudioAuto'),
images: ImageDTO.listFromJson(json[r'images']) ?? const [],
);
}
return null;
}
static List<ArticleDTO>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <ArticleDTO>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ArticleDTO.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ArticleDTO> mapFromJson(dynamic json) {
final map = <String, ArticleDTO>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ArticleDTO.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ArticleDTO-objects as value to a dart map
static Map<String, List<ArticleDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ArticleDTO>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ArticleDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}

View File

@ -1,10 +1,11 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
@ -14,107 +15,232 @@ class ConfigurationDTO {
ConfigurationDTO({ ConfigurationDTO({
this.id, this.id,
this.label, this.label,
this.title = const [],
this.imageId,
this.imageSource,
this.primaryColor, this.primaryColor,
this.secondaryColor, this.secondaryColor,
this.languages, this.languages = const [],
this.dateCreation, this.dateCreation,
this.isMobile,
this.isTablet,
this.isOffline,
this.instanceId,
}); });
String id; String? id;
String label; String? label;
String primaryColor; List<TranslationDTO>? title;
String secondaryColor; String? imageId;
List<String> languages; String? imageSource;
DateTime dateCreation; String? primaryColor;
String? secondaryColor;
List<String>? languages;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
DateTime? dateCreation;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isMobile;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isTablet;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? isOffline;
String? instanceId;
@override @override
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO && bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
other.id == id && other.id == id &&
other.label == label && other.label == label &&
other.title == title &&
other.imageId == imageId &&
other.imageSource == imageSource &&
other.primaryColor == primaryColor && other.primaryColor == primaryColor &&
other.secondaryColor == secondaryColor && other.secondaryColor == secondaryColor &&
other.languages == languages && other.languages == languages &&
other.dateCreation == dateCreation; other.dateCreation == dateCreation &&
other.isMobile == isMobile &&
other.isTablet == isTablet &&
other.isOffline == isOffline &&
other.instanceId == instanceId;
@override @override
int get hashCode => int get hashCode =>
(id == null ? 0 : id.hashCode) + // ignore: unnecessary_parenthesis
(label == null ? 0 : label.hashCode) + (id == null ? 0 : id!.hashCode) +
(primaryColor == null ? 0 : primaryColor.hashCode) + (label == null ? 0 : label!.hashCode) +
(secondaryColor == null ? 0 : secondaryColor.hashCode) + (title == null ? 0 : title!.hashCode) +
(languages == null ? 0 : languages.hashCode) + (imageId == null ? 0 : imageId!.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode); (imageSource == null ? 0 : imageSource!.hashCode) +
(primaryColor == null ? 0 : primaryColor!.hashCode) +
(secondaryColor == null ? 0 : secondaryColor!.hashCode) +
(languages == null ? 0 : languages!.hashCode) +
(dateCreation == null ? 0 : dateCreation!.hashCode) +
(isMobile == null ? 0 : isMobile!.hashCode) +
(isTablet == null ? 0 : isTablet!.hashCode) +
(isOffline == null ? 0 : isOffline!.hashCode) +
(instanceId == null ? 0 : instanceId!.hashCode);
@override @override
String toString() => 'ConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation]'; String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final _json = <String, dynamic>{};
if (id != null) { if (id != null) {
json[r'id'] = id; _json[r'id'] = id;
} }
if (label != null) { if (label != null) {
json[r'label'] = label; _json[r'label'] = label;
}
if (title != null) {
_json[r'title'] = title;
}
if (imageId != null) {
_json[r'imageId'] = imageId;
}
if (imageSource != null) {
_json[r'imageSource'] = imageSource;
} }
if (primaryColor != null) { if (primaryColor != null) {
json[r'primaryColor'] = primaryColor; _json[r'primaryColor'] = primaryColor;
} }
if (secondaryColor != null) { if (secondaryColor != null) {
json[r'secondaryColor'] = secondaryColor; _json[r'secondaryColor'] = secondaryColor;
} }
if (languages != null) { if (languages != null) {
json[r'languages'] = languages; _json[r'languages'] = languages;
} }
if (dateCreation != null) { if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
} }
return json; if (isMobile != null) {
_json[r'isMobile'] = isMobile;
}
if (isTablet != null) {
_json[r'isTablet'] = isTablet;
}
if (isOffline != null) {
_json[r'isOffline'] = isOffline;
}
if (instanceId != null) {
_json[r'instanceId'] = instanceId;
}
return _json;
} }
/// Returns a new [ConfigurationDTO] instance and imports its values from /// Returns a new [ConfigurationDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null. /// [value] if it's a [Map], null otherwise.
static ConfigurationDTO fromJson(Map<String, dynamic> json) => json == null // ignore: prefer_constructors_over_static_methods
? null static ConfigurationDTO? fromJson(dynamic value) {
: ConfigurationDTO( if (value is Map) {
id: json[r'id'], final json = value.cast<String, dynamic>();
label: json[r'label'],
primaryColor: json[r'primaryColor'],
secondaryColor: json[r'secondaryColor'],
languages: json[r'languages'] == null
? null
: (json[r'languages'] as List).cast<String>(),
dateCreation: json[r'dateCreation'] == null
? null
: DateTime.parse(json[r'dateCreation']),
);
static List<ConfigurationDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) => // Ensure that the map contains the required keys.
json == null || json.isEmpty // Note 1: the values aren't checked for validity beyond being non-null.
? true == emptyIsNull ? null : <ConfigurationDTO>[] // Note 2: this code is stripped in release mode!
: json.map((v) => ConfigurationDTO.fromJson(v)).toList(growable: true == growable); assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "ConfigurationDTO[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "ConfigurationDTO[$key]" has a null value in JSON.');
});
return true;
}());
static Map<String, ConfigurationDTO> mapFromJson(Map<String, dynamic> json) { return ConfigurationDTO(
id: mapValueOfType<String>(json, r'id'),
label: mapValueOfType<String>(json, r'label'),
title: TranslationDTO.listFromJson(json[r'title']) ?? const [],
imageId: mapValueOfType<String>(json, r'imageId'),
imageSource: mapValueOfType<String>(json, r'imageSource'),
primaryColor: mapValueOfType<String>(json, r'primaryColor'),
secondaryColor: mapValueOfType<String>(json, r'secondaryColor'),
languages: json[r'languages'] is List
? (json[r'languages'] as List).cast<String>()
: const [],
dateCreation: mapDateTime(json, r'dateCreation', ''),
isMobile: mapValueOfType<bool>(json, r'isMobile'),
isTablet: mapValueOfType<bool>(json, r'isTablet'),
isOffline: mapValueOfType<bool>(json, r'isOffline'),
instanceId: mapValueOfType<String>(json, r'instanceId'),
);
}
return null;
}
static List<ConfigurationDTO>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <ConfigurationDTO>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ConfigurationDTO.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ConfigurationDTO> mapFromJson(dynamic json) {
final map = <String, ConfigurationDTO>{}; final map = <String, ConfigurationDTO>{};
if (json != null && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ConfigurationDTO.fromJson(v)); json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ConfigurationDTO.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
} }
return map; return map;
} }
// maps a json object with a list of ConfigurationDTO-objects as value to a dart map // maps a json object with a list of ConfigurationDTO-objects as value to a dart map
static Map<String, List<ConfigurationDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) { static Map<String, List<ConfigurationDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ConfigurationDTO>>{}; final map = <String, List<ConfigurationDTO>>{};
if (json != null && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json.forEach((String key, dynamic v) { json = json.cast<String, dynamic>(); // ignore: parameter_assignments
map[key] = ConfigurationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); for (final entry in json.entries) {
}); final value = ConfigurationDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
} }
return map; return map;
} }
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
} }

View File

@ -1,10 +1,11 @@
// //
// AUTO-GENERATED FILE, DO NOT MODIFY! // AUTO-GENERATED FILE, DO NOT MODIFY!
// //
// @dart=2.0 // @dart=2.12
// ignore_for_file: unused_element, unused_import // ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first // ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
part of openapi.api; part of openapi.api;
@ -22,39 +23,72 @@ class DeviceDetailDTO {
this.connected, this.connected,
this.dateCreation, this.dateCreation,
this.dateUpdate, this.dateUpdate,
this.instanceId,
this.connectionLevel, this.connectionLevel,
this.lastConnectionLevel, this.lastConnectionLevel,
this.batteryLevel, this.batteryLevel,
this.lastBatteryLevel, this.lastBatteryLevel,
}); });
String id; String? id;
String identifier; String? identifier;
String name; String? name;
String ipAddressWLAN; String? ipAddressWLAN;
String ipAddressETH; String? ipAddressETH;
String configurationId; String? configurationId;
String configuration; String? configuration;
bool connected; ///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
bool? connected;
DateTime dateCreation; ///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
DateTime? dateCreation;
DateTime dateUpdate; ///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
DateTime? dateUpdate;
String connectionLevel; String? instanceId;
DateTime lastConnectionLevel; String? connectionLevel;
String batteryLevel; ///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
DateTime? lastConnectionLevel;
DateTime lastBatteryLevel; String? batteryLevel;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
DateTime? lastBatteryLevel;
@override @override
bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTO && bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTO &&
@ -68,6 +102,7 @@ class DeviceDetailDTO {
other.connected == connected && other.connected == connected &&
other.dateCreation == dateCreation && other.dateCreation == dateCreation &&
other.dateUpdate == dateUpdate && other.dateUpdate == dateUpdate &&
other.instanceId == instanceId &&
other.connectionLevel == connectionLevel && other.connectionLevel == connectionLevel &&
other.lastConnectionLevel == lastConnectionLevel && other.lastConnectionLevel == lastConnectionLevel &&
other.batteryLevel == batteryLevel && other.batteryLevel == batteryLevel &&
@ -75,122 +110,159 @@ class DeviceDetailDTO {
@override @override
int get hashCode => int get hashCode =>
(id == null ? 0 : id.hashCode) + // ignore: unnecessary_parenthesis
(identifier == null ? 0 : identifier.hashCode) + (id == null ? 0 : id!.hashCode) +
(name == null ? 0 : name.hashCode) + (identifier == null ? 0 : identifier!.hashCode) +
(ipAddressWLAN == null ? 0 : ipAddressWLAN.hashCode) + (name == null ? 0 : name!.hashCode) +
(ipAddressETH == null ? 0 : ipAddressETH.hashCode) + (ipAddressWLAN == null ? 0 : ipAddressWLAN!.hashCode) +
(configurationId == null ? 0 : configurationId.hashCode) + (ipAddressETH == null ? 0 : ipAddressETH!.hashCode) +
(configuration == null ? 0 : configuration.hashCode) + (configurationId == null ? 0 : configurationId!.hashCode) +
(connected == null ? 0 : connected.hashCode) + (configuration == null ? 0 : configuration!.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode) + (connected == null ? 0 : connected!.hashCode) +
(dateUpdate == null ? 0 : dateUpdate.hashCode) + (dateCreation == null ? 0 : dateCreation!.hashCode) +
(connectionLevel == null ? 0 : connectionLevel.hashCode) + (dateUpdate == null ? 0 : dateUpdate!.hashCode) +
(lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) + (instanceId == null ? 0 : instanceId!.hashCode) +
(batteryLevel == null ? 0 : batteryLevel.hashCode) + (connectionLevel == null ? 0 : connectionLevel!.hashCode) +
(lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode); (lastConnectionLevel == null ? 0 : lastConnectionLevel!.hashCode) +
(batteryLevel == null ? 0 : batteryLevel!.hashCode) +
(lastBatteryLevel == null ? 0 : lastBatteryLevel!.hashCode);
@override @override
String toString() => 'DeviceDetailDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]'; String toString() => 'DeviceDetailDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, instanceId=$instanceId, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]';
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final json = <String, dynamic>{}; final _json = <String, dynamic>{};
if (id != null) { if (id != null) {
json[r'id'] = id; _json[r'id'] = id;
} }
if (identifier != null) { if (identifier != null) {
json[r'identifier'] = identifier; _json[r'identifier'] = identifier;
} }
if (name != null) { if (name != null) {
json[r'name'] = name; _json[r'name'] = name;
} }
if (ipAddressWLAN != null) { if (ipAddressWLAN != null) {
json[r'ipAddressWLAN'] = ipAddressWLAN; _json[r'ipAddressWLAN'] = ipAddressWLAN;
} }
if (ipAddressETH != null) { if (ipAddressETH != null) {
json[r'ipAddressETH'] = ipAddressETH; _json[r'ipAddressETH'] = ipAddressETH;
} }
if (configurationId != null) { if (configurationId != null) {
json[r'configurationId'] = configurationId; _json[r'configurationId'] = configurationId;
} }
if (configuration != null) { if (configuration != null) {
json[r'configuration'] = configuration; _json[r'configuration'] = configuration;
} }
if (connected != null) { if (connected != null) {
json[r'connected'] = connected; _json[r'connected'] = connected;
} }
if (dateCreation != null) { if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String(); _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
} }
if (dateUpdate != null) { if (dateUpdate != null) {
json[r'dateUpdate'] = dateUpdate.toUtc().toIso8601String(); _json[r'dateUpdate'] = dateUpdate!.toUtc().toIso8601String();
}
if (instanceId != null) {
_json[r'instanceId'] = instanceId;
} }
if (connectionLevel != null) { if (connectionLevel != null) {
json[r'connectionLevel'] = connectionLevel; _json[r'connectionLevel'] = connectionLevel;
} }
if (lastConnectionLevel != null) { if (lastConnectionLevel != null) {
json[r'lastConnectionLevel'] = lastConnectionLevel.toUtc().toIso8601String(); _json[r'lastConnectionLevel'] = lastConnectionLevel!.toUtc().toIso8601String();
} }
if (batteryLevel != null) { if (batteryLevel != null) {
json[r'batteryLevel'] = batteryLevel; _json[r'batteryLevel'] = batteryLevel;
} }
if (lastBatteryLevel != null) { if (lastBatteryLevel != null) {
json[r'lastBatteryLevel'] = lastBatteryLevel.toUtc().toIso8601String(); _json[r'lastBatteryLevel'] = lastBatteryLevel!.toUtc().toIso8601String();
} }
return json; return _json;
} }
/// Returns a new [DeviceDetailDTO] instance and imports its values from /// Returns a new [DeviceDetailDTO] instance and imports its values from
/// [json] if it's non-null, null if [json] is null. /// [value] if it's a [Map], null otherwise.
static DeviceDetailDTO fromJson(Map<String, dynamic> json) => json == null // ignore: prefer_constructors_over_static_methods
? null static DeviceDetailDTO? fromJson(dynamic value) {
: DeviceDetailDTO( if (value is Map) {
id: json[r'id'], final json = value.cast<String, dynamic>();
identifier: json[r'identifier'],
name: json[r'name'],
ipAddressWLAN: json[r'ipAddressWLAN'],
ipAddressETH: json[r'ipAddressETH'],
configurationId: json[r'configurationId'],
configuration: json[r'configuration'],
connected: json[r'connected'],
dateCreation: json[r'dateCreation'] == null
? null
: DateTime.parse(json[r'dateCreation']),
dateUpdate: json[r'dateUpdate'] == null
? null
: DateTime.parse(json[r'dateUpdate']),
connectionLevel: json[r'connectionLevel'],
lastConnectionLevel: json[r'lastConnectionLevel'] == null
? null
: DateTime.parse(json[r'lastConnectionLevel']),
batteryLevel: json[r'batteryLevel'],
lastBatteryLevel: json[r'lastBatteryLevel'] == null
? null
: DateTime.parse(json[r'lastBatteryLevel']),
);
static List<DeviceDetailDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) => // Ensure that the map contains the required keys.
json == null || json.isEmpty // Note 1: the values aren't checked for validity beyond being non-null.
? true == emptyIsNull ? null : <DeviceDetailDTO>[] // Note 2: this code is stripped in release mode!
: json.map((v) => DeviceDetailDTO.fromJson(v)).toList(growable: true == growable); assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "DeviceDetailDTO[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "DeviceDetailDTO[$key]" has a null value in JSON.');
});
return true;
}());
static Map<String, DeviceDetailDTO> mapFromJson(Map<String, dynamic> json) { return DeviceDetailDTO(
id: mapValueOfType<String>(json, r'id'),
identifier: mapValueOfType<String>(json, r'identifier'),
name: mapValueOfType<String>(json, r'name'),
ipAddressWLAN: mapValueOfType<String>(json, r'ipAddressWLAN'),
ipAddressETH: mapValueOfType<String>(json, r'ipAddressETH'),
configurationId: mapValueOfType<String>(json, r'configurationId'),
configuration: mapValueOfType<String>(json, r'configuration'),
connected: mapValueOfType<bool>(json, r'connected'),
dateCreation: mapDateTime(json, r'dateCreation', ''),
dateUpdate: mapDateTime(json, r'dateUpdate', ''),
instanceId: mapValueOfType<String>(json, r'instanceId'),
connectionLevel: mapValueOfType<String>(json, r'connectionLevel'),
lastConnectionLevel: mapDateTime(json, r'lastConnectionLevel', ''),
batteryLevel: mapValueOfType<String>(json, r'batteryLevel'),
lastBatteryLevel: mapDateTime(json, r'lastBatteryLevel', ''),
);
}
return null;
}
static List<DeviceDetailDTO>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <DeviceDetailDTO>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = DeviceDetailDTO.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, DeviceDetailDTO> mapFromJson(dynamic json) {
final map = <String, DeviceDetailDTO>{}; final map = <String, DeviceDetailDTO>{};
if (json != null && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = DeviceDetailDTO.fromJson(v)); json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = DeviceDetailDTO.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
} }
return map; return map;
} }
// maps a json object with a list of DeviceDetailDTO-objects as value to a dart map // maps a json object with a list of DeviceDetailDTO-objects as value to a dart map
static Map<String, List<DeviceDetailDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) { static Map<String, List<DeviceDetailDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<DeviceDetailDTO>>{}; final map = <String, List<DeviceDetailDTO>>{};
if (json != null && json.isNotEmpty) { if (json is Map && json.isNotEmpty) {
json.forEach((String key, dynamic v) { json = json.cast<String, dynamic>(); // ignore: parameter_assignments
map[key] = DeviceDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable); for (final entry in json.entries) {
}); final value = DeviceDetailDTO.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
} }
return map; return map;
} }
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
} }

Some files were not shown because too many files have changed in this diff Show More