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';
class RoundedButton extends StatelessWidget {
final String text;
final Function press;
final IconData icon;
final Color color, textColor;
final double fontSize;
final double vertical;
final double horizontal;
final String? text;
final Function? press;
final IconData? icon;
final Color? color, textColor;
final double? fontSize;
final double? vertical;
final double? horizontal;
const RoundedButton({
Key key,
Key? key,
this.text,
this.press,
this.icon,
@ -27,8 +27,8 @@ class RoundedButton extends StatelessWidget {
//Size size = MediaQuery.of(context).size;
return TextButton(
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))),
backgroundColor: MaterialStateColor.resolveWith((states) => color),
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!),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0),
@ -37,7 +37,7 @@ class RoundedButton extends StatelessWidget {
),
onPressed: () => {
press()
press!()
},
child: getValue(icon)
);
@ -50,7 +50,7 @@ class RoundedButton extends StatelessWidget {
children: [
Center(
child: Text(
text,
text!,
style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400),
),
),
@ -60,13 +60,13 @@ class RoundedButton extends StatelessWidget {
Icon(
icon,
color: textColor,
size: fontSize + 8,
size: fontSize! + 8,
)
],
);
} else {
return Text(
text,
text!,
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';
class Loading extends StatelessWidget {
Loading({Key key}) : super(key: key);
Loading({Key? key}) : super(key: key);
@override
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';
class RoundedInputField extends StatelessWidget {
final String hintText;
final IconData icon;
final ValueChanged<String> onChanged;
final String initialValue;
final Color color, textColor, iconColor;
final int maxLength;
final String? hintText;
final IconData? icon;
final ValueChanged<String>? onChanged;
final String? initialValue;
final Color? color, textColor, iconColor;
final int? maxLength;
const RoundedInputField({
Key key,
Key? key,
this.hintText,
this.initialValue,
this.icon,

View File

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

View File

@ -1,6 +1,6 @@
import 'dart:convert';
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
import 'package:tablet_app/Models/tabletContext.dart';
@ -20,11 +20,11 @@ class DatabaseHelper {
DatabaseHelper._privateConstructor();
static final DatabaseHelper instance = DatabaseHelper._privateConstructor();
static Database _database;
static Database? _database;
Future<Database> get database async {
if (_database != null) return _database;
if (_database != null) return _database!;
_database = await _initDatabase();
return _database;
return _database!;
}
_initDatabase() async {
@ -76,13 +76,13 @@ class DatabaseHelper {
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;
return await db.rawQuery("DELETE FROM $table");
}
Future<TabletAppContext> getData() async {
TabletAppContext tabletAppContext;
TabletAppContext tabletAppContext = TabletAppContext();
await DatabaseHelper.instance.queryAllRows().then((value) {
value.forEach((element) {

View File

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

View File

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

View File

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

View File

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

View File

@ -1,9 +1,9 @@
class Section {
int id;
String title;
String description;
String image;
int category;
int? id;
String? title;
String? description;
String? image;
int? 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:managerapi/api.dart';
import 'package:manager_api/api.dart';
import 'package:mqtt_client/mqtt_server_client.dart';
import 'package:tablet_app/client.dart';
import 'dart:convert';
class TabletAppContext with ChangeNotifier{
Client clientAPI;
MqttServerClient clientMQTT;
String id;
String host;
ConfigurationDTO configuration;
String language;
String deviceId;
Client? clientAPI;
MqttServerClient? clientMQTT;
String? id;
String? host;
ConfigurationDTO? configuration;
String? language;
String? deviceId;
TabletAppContext({this.id, this.deviceId, this.host, this.configuration, this.language});
@ -21,7 +21,7 @@ class TabletAppContext with ChangeNotifier{
'id': id,
'deviceId': deviceId,
'host': host,
'configuration': configuration == null ? null : jsonEncode(configuration.toJson()),
'configuration': configuration == null ? null : jsonEncode(configuration!.toJson()),
'language': language
};
}

View File

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

View File

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

View File

@ -13,20 +13,20 @@ class LanguageSelection extends StatefulWidget {
}
class _LanguageSelection extends State<LanguageSelection> with TickerProviderStateMixin {
List<String> languagesEnable;
List<String>? languagesEnable;
Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution
double flagSize = 60;
String selectedLanguage;
double elementMinimizedSize;
String? selectedLanguage;
double? elementMinimizedSize;
bool minimized = false;
double _leftLanguage;
double _topLanguage;
double _rightLanguage;
double _bottomLanguage;
double? _leftLanguage;
double? _topLanguage;
double? _rightLanguage;
double? _bottomLanguage;
AnimationController _controller;
AnimationController? _controller;
@override
void initState() {
@ -39,14 +39,14 @@ class _LanguageSelection extends State<LanguageSelection> with TickerProviderSta
_controller = AnimationController(
value: 12, vsync: this, duration: Duration(seconds: 1));
_controller.animateBack(0);
_controller!.animateBack(0);
super.initState();
}
@override
void dispose() {
_controller.dispose();
_controller!.dispose();
super.dispose();
}
@ -55,7 +55,7 @@ class _LanguageSelection extends State<LanguageSelection> with TickerProviderSta
final appContext = Provider.of<AppContext>(context);
Size size = MediaQuery.of(context).size;
selectedLanguage = (appContext.getContext() as TabletAppContext).language;
languagesEnable = (appContext.getContext() as TabletAppContext).configuration.languages;
languagesEnable = (appContext.getContext() as TabletAppContext).configuration!.languages;
return Stack(
children: [
@ -71,7 +71,7 @@ class _LanguageSelection extends State<LanguageSelection> with TickerProviderSta
child: Container(
height: size.height *0.07,//size.height *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(
children: [
if(minimized) ... [
for(var language in languagesEnable.where((element) => element.toUpperCase() != selectedLanguage ))
for(var language in languagesEnable!.where((element) => element.toUpperCase() != selectedLanguage ))
InkWell(
onTap: () {
setState(() {
@ -121,9 +121,9 @@ class _LanguageSelection extends State<LanguageSelection> with TickerProviderSta
minimizedAnimation(Size size) {
minimized = !minimized;
if (minimized) {
_controller.animateBack(15.0);
_controller!.animateBack(15.0);
} else {
_controller.animateBack(0.0);
_controller!.animateBack(0.0);
}
setState(() {
_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/rendering.dart';
import 'package:flutter/services.dart';
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
import 'package:provider/provider.dart';
import 'package:tablet_app/Components/loading.dart';
import 'package:tablet_app/Helpers/MQTTHelper.dart';
@ -30,7 +30,7 @@ class MainViewWidget extends StatefulWidget {
class _MainViewWidget extends State<MainViewWidget> {
Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution
SectionDTO sectionSelected;
SectionDTO? sectionSelected;
int rowCount = 4;
@ -45,7 +45,7 @@ class _MainViewWidget extends State<MainViewWidget> {
if(sectionSelected != null) {
var elementToShow;
switch (sectionSelected.type) {
switch (sectionSelected!.type) {
case SectionType.map : // MAP
elementToShow = ChangeNotifierProvider<MapContext>(
create: (_) =>
@ -54,7 +54,7 @@ class _MainViewWidget extends State<MainViewWidget> {
longitude: null,
title: '',
description: '')),
child: MapViewWidget(section: sectionSelected) /*FutureBuilder(
child: MapViewWidget(section: sectionSelected!) /*FutureBuilder(
future: _url,
builder: (BuildContext context, AsyncSnapshot snapshot) => snapshot.hasData
? WebViewWidget(url: snapshot.data,)
@ -62,7 +62,7 @@ class _MainViewWidget extends State<MainViewWidget> {
);
break;
case SectionType.web : // WEB
elementToShow = WebViewWidget(section: sectionSelected);
elementToShow = WebView(section: sectionSelected);
break;
case SectionType.video : // Video
elementToShow = VideoViewWidget(section: sectionSelected);
@ -71,7 +71,7 @@ class _MainViewWidget extends State<MainViewWidget> {
elementToShow = SliderViewWidget(section: sectionSelected);
break;
case SectionType.menu :
elementToShow = MenuViewWidget(section: sectionSelected);
elementToShow = MenuViewWidget(section: sectionSelected!);
break;
case SectionType.quizz :
elementToShow = QuizzViewWidget(section: sectionSelected);
@ -100,7 +100,7 @@ class _MainViewWidget extends State<MainViewWidget> {
child: Container(
/*width: 125,
height: 125,*/
decoration: boxDecoration(sectionSelected, true),
decoration: boxDecoration(sectionSelected!, true),
),
),
),
@ -117,7 +117,7 @@ class _MainViewWidget extends State<MainViewWidget> {
child: Align(
alignment: Alignment.centerLeft,
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),
maxLines: 1,
),
@ -127,7 +127,7 @@ class _MainViewWidget extends State<MainViewWidget> {
child: Align(
alignment: Alignment.centerLeft,
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),
maxLines: 2,
),
@ -140,11 +140,11 @@ class _MainViewWidget extends State<MainViewWidget> {
),
),
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(
width: size.width,
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,
shape: BoxShape.rectangle,
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();
try {
List<SectionDTO> sections = await tabletAppContext.clientAPI.sectionApi.sectionGetFromConfiguration(tabletAppContext.configuration.id);
sections.sort((a, b) => a.order.compareTo(b.order));
List<SectionDTO>? sections = await tabletAppContext.clientAPI!.sectionApi!.sectionGetFromConfiguration(tabletAppContext.configuration!.id!);
sections!.sort((a, b) => a.order!.compareTo(b.order!));
return sections;
} catch (e) {
print(e);
@ -301,7 +301,7 @@ boxDecoration(SectionDTO section, bool isSelected) {
fit: !isSelected? BoxFit.cover : BoxFit.contain,
colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop) : null,
image: new NetworkImage(
section.imageSource,
section.imageSource!,
),
): null,
boxShadow: [

View File

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

View File

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

View File

@ -16,7 +16,7 @@ class MarkerViewWidget extends StatefulWidget {
class _MarkerInfoWidget extends State<MarkerViewWidget> {
Size sizeScreen = new Size(1080.0, 1920.0); // Tablet resolution
CarouselController sliderController;
CarouselController? sliderController;
int currentIndex = 1;
@override
@ -205,7 +205,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
child: InkWell(
onTap: () {
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(
Icons.chevron_right,
@ -221,7 +221,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
child: InkWell(
onTap: () {
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(
Icons.chevron_left,

View File

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

View File

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

View File

@ -4,7 +4,7 @@ import 'package:carousel_slider/carousel_slider.dart';
import 'package:confetti/confetti.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
import 'package:provider/provider.dart';
import 'package:tablet_app/Components/Buttons/rounded_button.dart';
import 'package:tablet_app/Models/ResponseSubDTO.dart';
@ -16,8 +16,8 @@ import 'drawStrawberry.dart';
class QuizzViewWidget extends StatefulWidget {
final SectionDTO section;
GlobalKey<ScaffoldState> key;
final SectionDTO? section;
GlobalKey<ScaffoldState>? key;
QuizzViewWidget({this.section, this.key});
@override
@ -25,10 +25,10 @@ class QuizzViewWidget extends StatefulWidget {
}
class _QuizzViewWidget extends State<QuizzViewWidget> {
ConfettiController _controllerCenter;
QuizzDTO quizzDTO;
ConfettiController? _controllerCenter;
QuizzDTO quizzDTO = QuizzDTO();
List<QuestionSubDTO> _questionsSubDTO = <QuestionSubDTO>[];
CarouselController sliderController;
CarouselController? sliderController;
int currentIndex = 1;
bool showResult = false;
bool showResponses = false;
@ -41,12 +41,12 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
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));
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions);
quizzDTO.questions!.sort((a, b) => a.order!.compareTo(b.order!));
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions!);
_controllerCenter.play();
_controllerCenter!.play();
}
@ -54,8 +54,8 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
void dispose() {
sliderController = null;
currentIndex = 1;
_controllerCenter.dispose();
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions);
_controllerCenter!.dispose();
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions!);
super.dispose();
}
@ -68,12 +68,12 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
{
var goodResponses = 0;
_questionsSubDTO.forEach((question) {
if(question.chosen == question.responsesSubDTO.indexWhere((response) => response.isGood))
if(question.chosen == question.responsesSubDTO!.indexWhere((response) => response.isGood!))
goodResponses +=1;
});
log("goodResponses =" + goodResponses.toString());
var levelToShow;
var test = goodResponses/quizzDTO.questions.length;
var test = goodResponses/quizzDTO.questions!.length;
if(0 == test || test < 0.25)
levelToShow = quizzDTO.badLevel;
@ -93,7 +93,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
width: 5,
height: 5,
child: ConfettiWidget(
confettiController: _controllerCenter,
confettiController: _controllerCenter!,
blastDirectionality: BlastDirectionality.explosive,
shouldLoop: false, // start again as soon as the animation is finished
colors: const [
@ -150,7 +150,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
),
),
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(
child: Padding(
@ -229,7 +229,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
showResult = false;
showResponses = false;
currentIndex = 1;
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions);
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO.questions!);
});
},
fontSize: 30,
@ -299,7 +299,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
fit: BoxFit.contain,
opacity: 0.35,
image: new NetworkImage(
i.source_,
i.source_!,
),
): null,
boxShadow: [
@ -343,7 +343,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
child: SingleChildScrollView(
child: Padding(
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,
crossAxisSpacing: 150,
),
itemCount: i.responsesSubDTO.length,
itemCount: i.responsesSubDTO!.length,
itemBuilder: (BuildContext ctx, index) {
return InkWell(
onTap: () {
@ -381,9 +381,9 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
if(currentIndex == _questionsSubDTO.length && i.chosen == index)
{
showResult = true;
_controllerCenter.play();
_controllerCenter!.play();
} 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),
child: Container(
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(
color: i.chosen == index ? kTestSecondColor : kBackgroundLight,
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(
top: MediaQuery.of(context).size.height * 0.35,
right: 60,
child: InkWell(
onTap: () {
if(_questionsSubDTO[currentIndex-1].chosen != null && quizzDTO.questions.length > 0) {
sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
if(_questionsSubDTO[currentIndex-1].chosen != null && quizzDTO.questions!.length > 0) {
sliderController!.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
/*Fluttertoast.showToast(
msg: "Vous n'avez pas répondu à cette question",
toastLength: Toast.LENGTH_SHORT,
@ -456,7 +456,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
child: InkWell(
onTap: () {
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(
Icons.chevron_left,
@ -472,7 +472,7 @@ class _QuizzViewWidget extends State<QuizzViewWidget> {
alignment: Alignment.bottomCenter,
child: InkWell(
child: Text(
currentIndex.toString()+'/'+quizzDTO.questions.length.toString(),
currentIndex.toString()+'/'+quizzDTO.questions!.length.toString(),
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:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
import 'package:provider/provider.dart';
import 'package:tablet_app/Models/ResponseSubDTO.dart';
import 'package:tablet_app/app_context.dart';
@ -12,7 +12,7 @@ import 'package:tablet_app/constants.dart';
class ShowReponsesWidget extends StatefulWidget {
List<QuestionSubDTO> questionsSubDTO;
List<QuestionSubDTO>? questionsSubDTO;
ShowReponsesWidget({this.questionsSubDTO});
@override
@ -21,14 +21,14 @@ class ShowReponsesWidget extends StatefulWidget {
class _ShowReponsesWidget extends State<ShowReponsesWidget> {
List<QuestionSubDTO> _questionsSubDTO = <QuestionSubDTO>[];
CarouselController sliderController;
CarouselController? sliderController;
int currentIndex = 1;
@override
void initState() {
super.initState();
sliderController = CarouselController();
_questionsSubDTO = widget.questionsSubDTO;
_questionsSubDTO = widget.questionsSubDTO!;
}
@override
@ -78,7 +78,7 @@ class _ShowReponsesWidget extends State<ShowReponsesWidget> {
fit: BoxFit.contain,
opacity: 0.35,
image: new NetworkImage(
i.source_,
i.source_!,
),
): null,
boxShadow: [
@ -122,7 +122,7 @@ class _ShowReponsesWidget extends State<ShowReponsesWidget> {
child: SingleChildScrollView(
child: Padding(
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,
crossAxisSpacing: 5,
),
itemCount: i.responsesSubDTO.length,
itemCount: i.responsesSubDTO!.length,
itemBuilder: (BuildContext ctx, index) {
return Padding(
padding: const EdgeInsets.all(5.0),
child: Container(
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(
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,
borderRadius: BorderRadius.circular(10.0),
boxShadow: [
@ -183,14 +183,14 @@ class _ShowReponsesWidget extends State<ShowReponsesWidget> {
);
}).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(
top: size.height * 0.35,
right: 60,
child: InkWell(
onTap: () {
if(_questionsSubDTO[currentIndex-1].chosen != null && widget.questionsSubDTO.length > 0) {
sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
if(_questionsSubDTO[currentIndex-1].chosen != null && widget.questionsSubDTO!.length > 0) {
sliderController!.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
/*Fluttertoast.showToast(
msg: "Vous n'avez pas répondu à cette question",
toastLength: Toast.LENGTH_SHORT,
@ -216,7 +216,7 @@ class _ShowReponsesWidget extends State<ShowReponsesWidget> {
child: InkWell(
onTap: () {
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(
Icons.chevron_left,
@ -232,7 +232,7 @@ class _ShowReponsesWidget extends State<ShowReponsesWidget> {
alignment: Alignment.bottomCenter,
child: InkWell(
child: Text(
currentIndex.toString()+'/'+ widget.questionsSubDTO.length.toString(),
currentIndex.toString()+'/'+ widget.questionsSubDTO!.length.toString(),
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:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
import 'package:provider/provider.dart';
import 'package:tablet_app/app_context.dart';
import 'package:tablet_app/constants.dart';
import 'package:photo_view/photo_view.dart';
class SliderViewWidget extends StatefulWidget {
final SectionDTO section;
final SectionDTO? section;
SliderViewWidget({this.section});
@override
@ -17,16 +17,16 @@ class SliderViewWidget extends StatefulWidget {
}
class _SliderViewWidget extends State<SliderViewWidget> {
SliderDTO sliderDTO;
CarouselController sliderController;
SliderDTO sliderDTO = SliderDTO();
CarouselController? sliderController;
int currentIndex = 1;
@override
void initState() {
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();
}
@ -48,7 +48,7 @@ class _SliderViewWidget extends State<SliderViewWidget> {
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
if(sliderDTO.images != null && sliderDTO.images.length > 0)
if(sliderDTO.images != null && sliderDTO.images!.length > 0)
CarouselSlider(
carouselController: sliderController,
options: CarouselOptions(
@ -61,7 +61,7 @@ class _SliderViewWidget extends State<SliderViewWidget> {
enlargeCenterPage: true,
reverse: false,
),
items: sliderDTO.images.map<Widget>((i) {
items: sliderDTO.images!.map<Widget>((i) {
return Builder(
builder: (BuildContext context) {
return Container(
@ -112,7 +112,7 @@ class _SliderViewWidget extends State<SliderViewWidget> {
child: ClipRect(
child: PhotoView(
imageProvider: new NetworkImage(
i.source_,
i.source_!,
),
minScale: PhotoViewComputedScale.contained * 0.8,
maxScale: PhotoViewComputedScale.contained * 3.0,
@ -131,7 +131,7 @@ class _SliderViewWidget extends State<SliderViewWidget> {
right: 0,
child: Padding(
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: Padding(
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(
top: MediaQuery.of(context).size.height * 0.35,
right: 60,
child: InkWell(
onTap: () {
if (sliderDTO.images.length > 0)
sliderController.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
if (sliderDTO.images!.length > 0)
sliderController!.nextPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
},
child: Icon(
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(
top: MediaQuery.of(context).size.height * 0.35,
left: 60,
child: InkWell(
onTap: () {
if (sliderDTO.images.length > 0)
sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
if (sliderDTO.images!.length > 0)
sliderController!.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
},
child: Icon(
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: 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(
alignment: widget.section.parentId == null ? Alignment.bottomCenter : Alignment.bottomLeft,
alignment: widget.section!.parentId == null ? Alignment.bottomCenter : Alignment.bottomLeft,
child: InkWell(
onTap: () {
sliderController.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
sliderController!.previousPage(duration: new Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
},
child: Text(
currentIndex.toString()+'/'+sliderDTO.images.length.toString(),
currentIndex.toString()+'/'+sliderDTO.images!.length.toString(),
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),))
// Description
/*Container(

View File

@ -1,12 +1,12 @@
import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
import 'package:tablet_app/constants.dart';
import 'package:youtube_player_flutter/youtube_player_flutter.dart';
class VideoViewWidget extends StatefulWidget {
final SectionDTO section;
final SectionDTO? section;
VideoViewWidget({this.section});
@override
@ -14,21 +14,21 @@ class VideoViewWidget extends StatefulWidget {
}
class _VideoViewWidget extends State<VideoViewWidget> {
YoutubePlayer _videoView;
VideoDTO videoDTO;
YoutubePlayer? _videoView;
VideoDTO? videoDTO;
@override
void initState() {
print(widget.section.data);
videoDTO = VideoDTO.fromJson(jsonDecode(widget.section.data));
print(widget.section!.data);
videoDTO = VideoDTO.fromJson(jsonDecode(widget.section!.data!));
print(videoDTO);
String videoId;
if (videoDTO.source_ != null && videoDTO.source_.length > 0 ) {
videoId = YoutubePlayer.convertUrlToId(videoDTO.source_);
String? videoId;
if (videoDTO!.source_ != null && videoDTO!.source_!.length > 0 ) {
videoId = YoutubePlayer.convertUrlToId(videoDTO!.source_!);
YoutubePlayerController _controller = YoutubePlayerController(
initialVideoId: videoId,
initialVideoId: videoId!,
flags: YoutubePlayerFlags(
autoPlay: true,
controlsVisibleAtStart: false,
@ -59,5 +59,7 @@ class _VideoViewWidget extends State<VideoViewWidget> {
}
@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 'package:flutter/material.dart';
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
import 'package:webview_flutter/webview_flutter.dart';
class WebViewWidget extends StatefulWidget {
final SectionDTO section;
WebViewWidget({this.section});
class WebView extends StatefulWidget {
final SectionDTO? section;
WebView({this.section});
@override
_WebViewWidget createState() => _WebViewWidget();
}
class _WebViewWidget extends State<WebViewWidget> {
WebView _webView;
WebDTO webDTO;
class _WebViewWidget extends State<WebView> {
//WebView _webView;
WebDTO webDTO = WebDTO();
WebViewController? controller;
@override
void initState() {
print(widget.section.data);
webDTO = WebDTO.fromJson(jsonDecode(widget.section.data));
print(widget.section!.data);
webDTO = WebDTO.fromJson(jsonDecode(widget.section!.data!))!;
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();
_webView = WebView(
/*_webView = WebView(
initialUrl: webDTO.source_, //"https://my.matterport.com/show/?m=k8bvdezfHbT"
javascriptMode: JavascriptMode.unrestricted,
navigationDelegate: (NavigationRequest request) {
@ -35,15 +59,15 @@ class _WebViewWidget extends State<WebViewWidget> {
print('allowing navigation to $request');
return NavigationDecision.navigate;
}
);
);*/
}
@override
void dispose() {
_webView = null;
//_webView = null;
super.dispose();
}
@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';
class WaveClipper extends CustomClipper<Path> {
bool minimized;
double height;
double width;
double move = 0;
bool? minimized;
double? height;
double? width;
double? move = 0;
WaveClipper({
this.move,
@ -36,7 +36,7 @@ class WaveClipper extends CustomClipper<Path> {
Path path = Path()
..lineTo(0, size.width)
..lineTo(size.width, size.height)
..lineTo(size.width*move, 0)
..lineTo(size.width*move!, 0)
..close();
//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 {
TabletAppContext _tabletContext;
Client clientAPI;
Client? clientAPI;
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';
class Client {
ApiClient _apiClient;
ApiClient get apiApi => _apiClient;
ApiClient? _apiClient;
ApiClient? get apiApi => _apiClient;
AuthenticationApi _authenticationApi;
AuthenticationApi get authenticationApi => _authenticationApi;
AuthenticationApi? _authenticationApi;
AuthenticationApi? get authenticationApi => _authenticationApi;
UserApi _userApi;
UserApi get userApi => _userApi;
UserApi? _userApi;
UserApi? get userApi => _userApi;
ConfigurationApi _configurationApi;
ConfigurationApi get configurationApi => _configurationApi;
ConfigurationApi? _configurationApi;
ConfigurationApi? get configurationApi => _configurationApi;
SectionApi _sectionApi;
SectionApi get sectionApi => _sectionApi;
SectionApi? _sectionApi;
SectionApi? get sectionApi => _sectionApi;
ResourceApi _resourceApi;
ResourceApi get resourceApi => _resourceApi;
ResourceApi? _resourceApi;
ResourceApi? get resourceApi => _resourceApi;
DeviceApi _deviceApi;
DeviceApi get deviceApi => _deviceApi;
DeviceApi? _deviceApi;
DeviceApi? get deviceApi => _deviceApi;
Client(String path) {
_apiClient = ApiClient(

View File

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

View File

@ -6,6 +6,10 @@
#include "generated_plugin_registrant.h"
#include <url_launcher_linux/url_launcher_plugin.h>
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
url_launcher_linux
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST

View File

@ -6,7 +6,9 @@ import FlutterMacOS
import Foundation
import sqflite
import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
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
.buildlog
.dart_tool/
.packages
.project
.pub/
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/
# Don't commit pubspec lock file
# (Library packages only! Remove pattern if developing an application package)
pubspec.lock
# IntelliJ
*.iml
*.ipr
*.iws
.idea/
# Mac
.DS_Store

View File

@ -1,6 +1,8 @@
.gitignore
.travis.yml
README.md
analysis_options.yaml
doc/ArticleDTO.md
doc/AuthenticationApi.md
doc/ConfigurationApi.md
doc/ConfigurationDTO.md
@ -13,6 +15,9 @@ doc/ExportConfigurationDTOAllOf.md
doc/GeoPointDTO.md
doc/ImageDTO.md
doc/ImageGeoPoint.md
doc/Instance.md
doc/InstanceApi.md
doc/InstanceDTO.md
doc/LevelDTO.md
doc/LoginDTO.md
doc/MapDTO.md
@ -21,6 +26,7 @@ doc/MenuDTO.md
doc/PlayerMessageDTO.md
doc/QuestionDTO.md
doc/QuizzDTO.md
doc/QuizzDTOBadLevel.md
doc/ResourceApi.md
doc/ResourceDTO.md
doc/ResourceType.md
@ -41,6 +47,7 @@ lib/api.dart
lib/api/authentication_api.dart
lib/api/configuration_api.dart
lib/api/device_api.dart
lib/api/instance_api.dart
lib/api/resource_api.dart
lib/api/section_api.dart
lib/api/user_api.dart
@ -52,6 +59,7 @@ lib/auth/authentication.dart
lib/auth/http_basic_auth.dart
lib/auth/http_bearer_auth.dart
lib/auth/oauth.dart
lib/model/article_dto.dart
lib/model/configuration_dto.dart
lib/model/device_detail_dto.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/image_dto.dart
lib/model/image_geo_point.dart
lib/model/instance.dart
lib/model/instance_dto.dart
lib/model/level_dto.dart
lib/model/login_dto.dart
lib/model/map_dto.dart
@ -69,6 +79,7 @@ lib/model/menu_dto.dart
lib/model/player_message_dto.dart
lib/model/question_dto.dart
lib/model/quizz_dto.dart
lib/model/quizz_dto_bad_level.dart
lib/model/resource_dto.dart
lib/model/resource_type.dart
lib/model/response_dto.dart
@ -82,9 +93,3 @@ lib/model/user_detail_dto.dart
lib/model/video_dto.dart
lib/model/web_dto.dart
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
dart:
# Install a specific stable release
- "2.2.0"
- "2.12"
install:
- pub get

View File

@ -1,4 +1,4 @@
# managerapi
# manager_api
API Manager Service
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
Dart 2.0 or later
Dart 2.12 or later
## 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
```
dependencies:
managerapi:
manager_api:
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
```
dependencies:
managerapi:
path: /path/to/managerapi
manager_api:
path: /path/to/manager_api
```
## Tests
@ -37,7 +37,7 @@ TODO
Please follow the [installation procedure](#installation--usage) and then run the following:
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -60,7 +60,7 @@ try {
## 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
------------ | ------------- | ------------- | -------------
@ -79,6 +79,11 @@ Class | Method | HTTP request | Description
*DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/Device/{id}/detail |
*DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/Device |
*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* | [**resourceDelete**](doc\/ResourceApi.md#resourcedelete) | **DELETE** /api/Resource/{id} |
*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* | [**sectionGet**](doc\/SectionApi.md#sectionget) | **GET** /api/Section |
*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* | [**sectionGetFromConfiguration**](doc\/SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} |
*SectionApi* | [**sectionGetMapDTO**](doc\/SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO |
@ -111,6 +117,7 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [ArticleDTO](doc\/ArticleDTO.md)
- [ConfigurationDTO](doc\/ConfigurationDTO.md)
- [DeviceDTO](doc\/DeviceDTO.md)
- [DeviceDetailDTO](doc\/DeviceDetailDTO.md)
@ -120,6 +127,8 @@ Class | Method | HTTP request | Description
- [GeoPointDTO](doc\/GeoPointDTO.md)
- [ImageDTO](doc\/ImageDTO.md)
- [ImageGeoPoint](doc\/ImageGeoPoint.md)
- [Instance](doc\/Instance.md)
- [InstanceDTO](doc\/InstanceDTO.md)
- [LevelDTO](doc\/LevelDTO.md)
- [LoginDTO](doc\/LoginDTO.md)
- [MapDTO](doc\/MapDTO.md)
@ -128,6 +137,7 @@ Class | Method | HTTP request | Description
- [PlayerMessageDTO](doc\/PlayerMessageDTO.md)
- [QuestionDTO](doc\/QuestionDTO.md)
- [QuizzDTO](doc\/QuizzDTO.md)
- [QuizzDTOBadLevel](doc\/QuizzDTOBadLevel.md)
- [ResourceDTO](doc\/ResourceDTO.md)
- [ResourceType](doc\/ResourceType.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
```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
------------- | ------------- | -------------
@ -20,7 +20,7 @@ Method | HTTP request | Description
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -71,7 +71,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';

View File

@ -1,11 +1,11 @@
# managerapi.api.ConfigurationApi
# manager_api.api.ConfigurationApi
## Load the API package
```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
------------- | ------------- | -------------
@ -25,7 +25,7 @@ Method | HTTP request | Description
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -68,7 +68,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -105,13 +105,13 @@ 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)
# **configurationExport**
> ExportConfigurationDTO configurationExport(id)
> MultipartFile configurationExport(id)
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -134,7 +134,7 @@ Name | Type | Description | Notes
### Return type
[**ExportConfigurationDTO**](ExportConfigurationDTO.md)
[**MultipartFile**](MultipartFile.md)
### Authorization
@ -143,25 +143,26 @@ Name | Type | Description | Notes
### HTTP request headers
- **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)
# **configurationGet**
> List<ConfigurationDTO> configurationGet()
> List<ConfigurationDTO> configurationGet(instanceId)
### Example
```dart
import 'package:managerapi/api.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 = ConfigurationApi();
final instanceId = instanceId_example; // String |
try {
final result = api_instance.configurationGet();
final result = api_instance.configurationGet(instanceId);
print(result);
} catch (e) {
print('Exception when calling ConfigurationApi->configurationGet: $e\n');
@ -169,7 +170,10 @@ try {
```
### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instanceId** | **String**| | [optional]
### Return type
@ -193,7 +197,7 @@ This endpoint does not need any parameter.
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -236,7 +240,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -279,7 +283,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';

View File

@ -1,8 +1,8 @@
# managerapi.model.ConfigurationDTO
# manager_api.model.ConfigurationDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
```
## Properties
@ -10,10 +10,17 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional]
**label** | **String** | | [optional]
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**imageId** | **String** | | [optional]
**imageSource** | **String** | | [optional]
**primaryColor** | **String** | | [optional]
**secondaryColor** | **String** | | [optional]
**languages** | **List<String>** | | [optional] [default to const []]
**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)

View File

@ -1,11 +1,11 @@
# managerapi.api.DeviceApi
# manager_api.api.DeviceApi
## Load the API package
```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
------------- | ------------- | -------------
@ -24,7 +24,7 @@ Method | HTTP request | Description
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -67,7 +67,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -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)
# **deviceGet**
> List<DeviceDTO> deviceGet()
> List<DeviceDTO> deviceGet(instanceId)
### Example
```dart
import 'package:managerapi/api.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 = DeviceApi();
final instanceId = instanceId_example; // String |
try {
final result = api_instance.deviceGet();
final result = api_instance.deviceGet(instanceId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceGet: $e\n');
@ -125,7 +126,10 @@ try {
```
### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instanceId** | **String**| | [optional]
### Return type
@ -149,7 +153,7 @@ This endpoint does not need any parameter.
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -192,7 +196,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -235,7 +239,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';

View File

@ -1,8 +1,8 @@
# managerapi.model.DeviceDTO
# manager_api.model.DeviceDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
```
## Properties
@ -18,6 +18,7 @@ Name | Type | Description | Notes
**connected** | **bool** | | [optional]
**dateCreation** | [**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)

View File

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

View File

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

View File

@ -1,8 +1,8 @@
# managerapi.model.ExportConfigurationDTO
# manager_api.model.ExportConfigurationDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
```
## Properties
@ -10,10 +10,17 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional]
**label** | **String** | | [optional]
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**imageId** | **String** | | [optional]
**imageSource** | **String** | | [optional]
**primaryColor** | **String** | | [optional]
**secondaryColor** | **String** | | [optional]
**languages** | **List<String>** | | [optional] [default to const []]
**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 []]
**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
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
```
## Properties

View File

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

View File

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

View File

@ -1,8 +1,8 @@
# managerapi.model.ImageGeoPoint
# manager_api.model.ImageGeoPoint
## Load the model package
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
```
## 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
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
```
## Properties

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,18 +1,18 @@
# managerapi.model.QuizzDTO
# manager_api.model.QuizzDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**questions** | [**List<QuestionDTO>**](QuestionDTO.md) | | [optional] [default to const []]
**badLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional]
**mediumLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional]
**goodLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional]
**greatLevel** | [**OneOfLevelDTO**](OneOfLevelDTO.md) | | [optional]
**badLevel** | [**QuizzDTOBadLevel**](QuizzDTOBadLevel.md) | | [optional]
**mediumLevel** | [**QuizzDTOBadLevel**](QuizzDTOBadLevel.md) | | [optional]
**goodLevel** | [**QuizzDTOBadLevel**](QuizzDTOBadLevel.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)

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
```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
------------- | ------------- | -------------
@ -25,7 +25,7 @@ Method | HTTP request | Description
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -68,7 +68,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -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)
# **resourceGet**
> List<ResourceDTO> resourceGet()
> List<ResourceDTO> resourceGet(instanceId, types)
### Example
```dart
import 'package:managerapi/api.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 = ResourceApi();
final instanceId = instanceId_example; // String |
final types = []; // List<ResourceType> |
try {
final result = api_instance.resourceGet();
final result = api_instance.resourceGet(instanceId, types);
print(result);
} catch (e) {
print('Exception when calling ResourceApi->resourceGet: $e\n');
@ -126,7 +128,11 @@ try {
```
### 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
@ -150,7 +156,7 @@ This endpoint does not need any parameter.
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -193,7 +199,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -236,7 +242,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -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)
# **resourceUpload**
> String resourceUpload(label, type)
> String resourceUpload(label, type, instanceId)
### Example
```dart
import 'package:managerapi/api.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 = ResourceApi();
final label = label_example; // String |
final type = type_example; // String |
final instanceId = instanceId_example; // String |
try {
final result = api_instance.resourceUpload(label, type);
final result = api_instance.resourceUpload(label, type, instanceId);
print(result);
} catch (e) {
print('Exception when calling ResourceApi->resourceUpload: $e\n');
@ -301,6 +308,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**label** | **String**| | [optional]
**type** | **String**| | [optional]
**instanceId** | **String**| | [optional]
### Return type

View File

@ -1,8 +1,8 @@
# managerapi.model.ResourceDTO
# manager_api.model.ResourceDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
```
## Properties
@ -11,8 +11,9 @@ Name | Type | Description | Notes
**id** | **String** | | [optional]
**type** | [**ResourceType**](ResourceType.md) | | [optional]
**label** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [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)

View File

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

View File

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

View File

@ -1,11 +1,11 @@
# managerapi.api.SectionApi
# manager_api.api.SectionApi
## Load the API package
```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
------------- | ------------- | -------------
@ -14,6 +14,7 @@ Method | HTTP request | Description
[**sectionDeleteAllForConfiguration**](SectionApi.md#sectiondeleteallforconfiguration) | **DELETE** /api/Section/configuration/{id} |
[**sectionGet**](SectionApi.md#sectionget) | **GET** /api/Section |
[**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} |
[**sectionGetFromConfiguration**](SectionApi.md#sectiongetfromconfiguration) | **GET** /api/Section/configuration/{id} |
[**sectionGetMapDTO**](SectionApi.md#sectiongetmapdto) | **GET** /api/Section/MapDTO |
@ -34,7 +35,7 @@ Method | HTTP request | Description
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -77,7 +78,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -120,7 +121,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -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)
# **sectionGet**
> List<SectionDTO> sectionGet()
> List<SectionDTO> sectionGet(instanceId)
### Example
```dart
import 'package:managerapi/api.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();
final instanceId = instanceId_example; // String |
try {
final result = api_instance.sectionGet();
final result = api_instance.sectionGet(instanceId);
print(result);
} catch (e) {
print('Exception when calling SectionApi->sectionGet: $e\n');
@ -178,7 +180,10 @@ try {
```
### Parameters
This endpoint does not need any parameter.
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**instanceId** | **String**| | [optional]
### Return type
@ -202,7 +207,7 @@ This endpoint does not need any parameter.
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -238,6 +243,45 @@ 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)
# **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**
> SectionDTO sectionGetDetail(id)
@ -245,7 +289,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -288,7 +332,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -331,7 +375,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -370,7 +414,7 @@ This endpoint does not need any parameter.
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -409,7 +453,7 @@ This endpoint does not need any parameter.
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -448,7 +492,7 @@ This endpoint does not need any parameter.
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -487,7 +531,7 @@ This endpoint does not need any parameter.
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -526,7 +570,7 @@ This endpoint does not need any parameter.
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -565,7 +609,7 @@ This endpoint does not need any parameter.
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -604,7 +648,7 @@ This endpoint does not need any parameter.
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -647,7 +691,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';

View File

@ -1,8 +1,8 @@
# managerapi.model.SectionDTO
# manager_api.model.SectionDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
```
## Properties
@ -21,6 +21,12 @@ Name | Type | Description | Notes
**data** | **String** | | [optional]
**dateCreation** | [**DateTime**](DateTime.md) | | [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)

View File

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

View File

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

View File

@ -1,8 +1,8 @@
# managerapi.model.TokenDTO
# manager_api.model.TokenDTO
## Load the model package
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
```
## Properties
@ -14,6 +14,7 @@ Name | Type | Description | Notes
**tokenType** | **String** | | [optional]
**expiresIn** | **int** | | [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)

View File

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

View File

@ -1,8 +1,8 @@
# managerapi.model.User
# manager_api.model.User
## Load the model package
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
```
## Properties
@ -15,6 +15,7 @@ Name | Type | Description | Notes
**lastName** | **String** | | [optional]
**token** | **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)

View File

@ -1,11 +1,11 @@
# managerapi.api.UserApi
# manager_api.api.UserApi
## Load the API package
```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
------------- | ------------- | -------------
@ -23,7 +23,7 @@ Method | HTTP request | Description
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -66,7 +66,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -109,7 +109,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -148,7 +148,7 @@ This endpoint does not need any parameter.
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
@ -191,7 +191,7 @@ Name | Type | Description | Notes
### Example
```dart
import 'package:managerapi/api.dart';
import 'package:manager_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';

View File

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

View File

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

View File

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

View File

@ -1,7 +1,7 @@
#!/bin/sh
# 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_repo_id=$2
@ -38,14 +38,14 @@ git add .
git commit -m "$release_note"
# Sets the new remote
git_remote=`git remote`
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
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
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
@ -55,4 +55,3 @@ git pull origin master
# 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"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -1,10 +1,11 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// @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
library openapi.api;
@ -15,7 +16,6 @@ import 'dart:io';
import 'package:http/http.dart';
import 'package:intl/intl.dart';
import 'package:meta/meta.dart';
part 'api_client.dart';
@ -30,10 +30,12 @@ part 'auth/http_bearer_auth.dart';
part 'api/authentication_api.dart';
part 'api/configuration_api.dart';
part 'api/device_api.dart';
part 'api/instance_api.dart';
part 'api/resource_api.dart';
part 'api/section_api.dart';
part 'api/user_api.dart';
part 'model/article_dto.dart';
part 'model/configuration_dto.dart';
part 'model/device_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/image_dto.dart';
part 'model/image_geo_point.dart';
part 'model/instance.dart';
part 'model/instance_dto.dart';
part 'model/level_dto.dart';
part 'model/login_dto.dart';
part 'model/map_dto.dart';
@ -51,6 +55,7 @@ part 'model/menu_dto.dart';
part 'model/player_message_dto.dart';
part 'model/question_dto.dart';
part 'model/quizz_dto.dart';
part 'model/quizz_dto_bad_level.dart';
part 'model/resource_dto.dart';
part 'model/resource_type.dart';
part 'model/response_dto.dart';

View File

@ -1,17 +1,18 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// @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 AuthenticationApi {
AuthenticationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
AuthenticationApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
@ -27,77 +28,53 @@ class AuthenticationApi {
/// * [String] clientId:
///
/// * [String] clientSecret:
Future<Response> authenticationAuthenticateWithFormWithHttpInfo({ String grantType, String username, String password, String clientId, String clientSecret }) async {
// Verify required params are set.
Future<Response> authenticationAuthenticateWithFormWithHttpInfo({ String? grantType, String? username, String? password, String? clientId, String? clientSecret, }) async {
// ignore: prefer_const_declarations
final path = r'/api/Authentication/Token';
Object postBody;
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['multipart/form-data'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['multipart/form-data'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (grantType != null) {
hasFields = true;
mp.fields[r'grant_type'] = parameterToString(grantType);
}
if (username != null) {
hasFields = true;
mp.fields[r'username'] = parameterToString(username);
}
if (password != null) {
hasFields = true;
mp.fields[r'password'] = parameterToString(password);
}
if (clientId != null) {
hasFields = true;
mp.fields[r'client_id'] = parameterToString(clientId);
}
if (clientSecret != null) {
hasFields = true;
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);
}
bool hasFields = false;
final mp = MultipartRequest('POST', Uri.parse(path));
if (grantType != null) {
hasFields = true;
mp.fields[r'grant_type'] = parameterToString(grantType);
}
if (username != null) {
hasFields = true;
mp.fields[r'username'] = parameterToString(username);
}
if (password != null) {
hasFields = true;
mp.fields[r'password'] = parameterToString(password);
}
if (clientId != null) {
hasFields = true;
mp.fields[r'client_id'] = parameterToString(clientId);
}
if (clientSecret != null) {
hasFields = true;
mp.fields[r'client_secret'] = parameterToString(clientSecret);
}
if (hasFields) {
postBody = mp;
}
return await apiClient.invokeAPI(
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
@ -112,80 +89,65 @@ class AuthenticationApi {
/// * [String] clientId:
///
/// * [String] clientSecret:
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 );
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, );
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'TokenDTO') as TokenDTO;
}
return Future<TokenDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TokenDTO',) as TokenDTO;
}
return null;
}
/// Performs an HTTP 'POST /api/Authentication/Authenticate' operation and returns the [Response].
/// Parameters:
///
/// * [LoginDTO] loginDTO (required):
Future<Response> authenticationAuthenticateWithJsonWithHttpInfo(LoginDTO loginDTO) async {
// Verify required params are set.
if (loginDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: loginDTO');
}
Future<Response> authenticationAuthenticateWithJsonWithHttpInfo(LoginDTO loginDTO,) async {
// ignore: prefer_const_declarations
final path = r'/api/Authentication/Authenticate';
Object postBody = loginDTO;
// ignore: prefer_final_locals
Object? postBody = loginDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['application/json'];
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,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [LoginDTO] loginDTO (required):
Future<TokenDTO> authenticationAuthenticateWithJson(LoginDTO loginDTO) async {
final response = await authenticationAuthenticateWithJsonWithHttpInfo(loginDTO);
Future<TokenDTO?> authenticationAuthenticateWithJson(LoginDTO loginDTO,) async {
final response = await authenticationAuthenticateWithJsonWithHttpInfo(loginDTO,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'TokenDTO') as TokenDTO;
}
return Future<TokenDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TokenDTO',) as TokenDTO;
}
return null;
}
}

View File

@ -1,17 +1,18 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// @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 ConfigurationApi {
ConfigurationApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
ConfigurationApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
@ -19,434 +20,338 @@ class ConfigurationApi {
/// Parameters:
///
/// * [ConfigurationDTO] configurationDTO (required):
Future<Response> configurationCreateWithHttpInfo(ConfigurationDTO configurationDTO) async {
// Verify required params are set.
if (configurationDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: configurationDTO');
}
Future<Response> configurationCreateWithHttpInfo(ConfigurationDTO configurationDTO,) async {
// ignore: prefer_const_declarations
final path = r'/api/Configuration';
Object postBody = configurationDTO;
// ignore: prefer_final_locals
Object? postBody = configurationDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['application/json'];
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,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [ConfigurationDTO] configurationDTO (required):
Future<ConfigurationDTO> configurationCreate(ConfigurationDTO configurationDTO) async {
final response = await configurationCreateWithHttpInfo(configurationDTO);
Future<ConfigurationDTO?> configurationCreate(ConfigurationDTO configurationDTO,) async {
final response = await configurationCreateWithHttpInfo(configurationDTO,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO;
}
return Future<ConfigurationDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ConfigurationDTO',) as ConfigurationDTO;
}
return null;
}
/// Performs an HTTP 'DELETE /api/Configuration/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> configurationDeleteWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
Future<Response> configurationDeleteWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
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 headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>[];
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,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<String> configurationDelete(String id) async {
final response = await configurationDeleteWithHttpInfo(id);
Future<String?> configurationDelete(String id,) async {
final response = await configurationDeleteWithHttpInfo(id,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
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/Configuration/{id}/export' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> configurationExportWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
Future<Response> configurationExportWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
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 headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>[];
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,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<ExportConfigurationDTO> configurationExport(String id) async {
final response = await configurationExportWithHttpInfo(id);
Future<MultipartFile?> configurationExport(String id,) async {
final response = await configurationExportWithHttpInfo(id,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ExportConfigurationDTO') as ExportConfigurationDTO;
}
return Future<ExportConfigurationDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
}
return null;
}
/// 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';
Object postBody;
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final 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 {
if (instanceId != null) {
queryParams.addAll(_queryParams('', 'instanceId', instanceId));
}
return await apiClient.invokeAPI(
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<List<ConfigurationDTO>> configurationGet() async {
final response = await configurationGetWithHttpInfo();
/// Parameters:
///
/// * [String] instanceId:
Future<List<ConfigurationDTO>?> configurationGet({ String? instanceId, }) async {
final response = await configurationGetWithHttpInfo( instanceId: instanceId, );
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<ConfigurationDTO>') as List)
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<ConfigurationDTO>') as List)
.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].
/// Parameters:
///
/// * [String] id (required):
Future<Response> configurationGetDetailWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
Future<Response> configurationGetDetailWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
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 headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>[];
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,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<ConfigurationDTO> configurationGetDetail(String id) async {
final response = await configurationGetDetailWithHttpInfo(id);
Future<ConfigurationDTO?> configurationGetDetail(String id,) async {
final response = await configurationGetDetailWithHttpInfo(id,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO;
}
return Future<ConfigurationDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ConfigurationDTO',) as ConfigurationDTO;
}
return null;
}
/// Performs an HTTP 'POST /api/Configuration/import' operation and returns the [Response].
/// Parameters:
///
/// * [ExportConfigurationDTO] exportConfigurationDTO (required):
Future<Response> configurationImportWithHttpInfo(ExportConfigurationDTO exportConfigurationDTO) async {
// Verify required params are set.
if (exportConfigurationDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: exportConfigurationDTO');
}
Future<Response> configurationImportWithHttpInfo(ExportConfigurationDTO exportConfigurationDTO,) async {
// ignore: prefer_const_declarations
final path = r'/api/Configuration/import';
Object postBody = exportConfigurationDTO;
// ignore: prefer_final_locals
Object? postBody = exportConfigurationDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['application/json'];
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,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [ExportConfigurationDTO] exportConfigurationDTO (required):
Future<String> configurationImport(ExportConfigurationDTO exportConfigurationDTO) async {
final response = await configurationImportWithHttpInfo(exportConfigurationDTO);
Future<String?> configurationImport(ExportConfigurationDTO exportConfigurationDTO,) async {
final response = await configurationImportWithHttpInfo(exportConfigurationDTO,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
}
return null;
}
/// Performs an HTTP 'PUT /api/Configuration' operation and returns the [Response].
/// Parameters:
///
/// * [ConfigurationDTO] configurationDTO (required):
Future<Response> configurationUpdateWithHttpInfo(ConfigurationDTO configurationDTO) async {
// Verify required params are set.
if (configurationDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: configurationDTO');
}
Future<Response> configurationUpdateWithHttpInfo(ConfigurationDTO configurationDTO,) async {
// ignore: prefer_const_declarations
final path = r'/api/Configuration';
Object postBody = configurationDTO;
// ignore: prefer_final_locals
Object? postBody = configurationDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['application/json'];
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,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [ConfigurationDTO] configurationDTO (required):
Future<ConfigurationDTO> configurationUpdate(ConfigurationDTO configurationDTO) async {
final response = await configurationUpdateWithHttpInfo(configurationDTO);
Future<ConfigurationDTO?> configurationUpdate(ConfigurationDTO configurationDTO,) async {
final response = await configurationUpdateWithHttpInfo(configurationDTO,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ConfigurationDTO') as ConfigurationDTO;
}
return Future<ConfigurationDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ConfigurationDTO',) as ConfigurationDTO;
}
return null;
}
}

View File

@ -1,17 +1,18 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// @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 DeviceApi {
DeviceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
DeviceApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
@ -19,370 +20,290 @@ class DeviceApi {
/// Parameters:
///
/// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<Response> deviceCreateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async {
// Verify required params are set.
if (deviceDetailDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO');
}
Future<Response> deviceCreateWithHttpInfo(DeviceDetailDTO deviceDetailDTO,) async {
// ignore: prefer_const_declarations
final path = r'/api/Device';
Object postBody = deviceDetailDTO;
// ignore: prefer_final_locals
Object? postBody = deviceDetailDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['application/json'];
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,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<DeviceDetailDTO> deviceCreate(DeviceDetailDTO deviceDetailDTO) async {
final response = await deviceCreateWithHttpInfo(deviceDetailDTO);
Future<DeviceDetailDTO?> deviceCreate(DeviceDetailDTO deviceDetailDTO,) async {
final response = await deviceCreateWithHttpInfo(deviceDetailDTO,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO;
}
return Future<DeviceDetailDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceDetailDTO',) as DeviceDetailDTO;
}
return null;
}
/// Performs an HTTP 'DELETE /api/Device/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> deviceDeleteWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
Future<Response> deviceDeleteWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
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 headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>[];
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,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<String> deviceDelete(String id) async {
final response = await deviceDeleteWithHttpInfo(id);
Future<String?> deviceDelete(String id,) async {
final response = await deviceDeleteWithHttpInfo(id,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
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/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';
Object postBody;
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final 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 {
if (instanceId != null) {
queryParams.addAll(_queryParams('', 'instanceId', instanceId));
}
return await apiClient.invokeAPI(
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<List<DeviceDTO>> deviceGet() async {
final response = await deviceGetWithHttpInfo();
/// Parameters:
///
/// * [String] instanceId:
Future<List<DeviceDTO>?> deviceGet({ String? instanceId, }) async {
final response = await deviceGetWithHttpInfo( instanceId: instanceId, );
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<DeviceDTO>') as List)
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<DeviceDTO>') as List)
.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].
/// Parameters:
///
/// * [String] id (required):
Future<Response> deviceGetDetailWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
Future<Response> deviceGetDetailWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
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 headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>[];
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,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<DeviceDetailDTO> deviceGetDetail(String id) async {
final response = await deviceGetDetailWithHttpInfo(id);
Future<DeviceDetailDTO?> deviceGetDetail(String id,) async {
final response = await deviceGetDetailWithHttpInfo(id,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO;
}
return Future<DeviceDetailDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceDetailDTO',) as DeviceDetailDTO;
}
return null;
}
/// Performs an HTTP 'PUT /api/Device' operation and returns the [Response].
/// Parameters:
///
/// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<Response> deviceUpdateWithHttpInfo(DeviceDetailDTO deviceDetailDTO) async {
// Verify required params are set.
if (deviceDetailDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDetailDTO');
}
Future<Response> deviceUpdateWithHttpInfo(DeviceDetailDTO deviceDetailDTO,) async {
// ignore: prefer_const_declarations
final path = r'/api/Device';
Object postBody = deviceDetailDTO;
// ignore: prefer_final_locals
Object? postBody = deviceDetailDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['application/json'];
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,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [DeviceDetailDTO] deviceDetailDTO (required):
Future<DeviceDetailDTO> deviceUpdate(DeviceDetailDTO deviceDetailDTO) async {
final response = await deviceUpdateWithHttpInfo(deviceDetailDTO);
Future<DeviceDetailDTO?> deviceUpdate(DeviceDetailDTO deviceDetailDTO,) async {
final response = await deviceUpdateWithHttpInfo(deviceDetailDTO,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDetailDTO') as DeviceDetailDTO;
}
return Future<DeviceDetailDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceDetailDTO',) as DeviceDetailDTO;
}
return null;
}
/// Performs an HTTP 'PUT /api/Device/mainInfos' operation and returns the [Response].
/// Parameters:
///
/// * [DeviceDTO] deviceDTO (required):
Future<Response> deviceUpdateMainInfosWithHttpInfo(DeviceDTO deviceDTO) async {
// Verify required params are set.
if (deviceDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: deviceDTO');
}
Future<Response> deviceUpdateMainInfosWithHttpInfo(DeviceDTO deviceDTO,) async {
// ignore: prefer_const_declarations
final path = r'/api/Device/mainInfos';
Object postBody = deviceDTO;
// ignore: prefer_final_locals
Object? postBody = deviceDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['application/json'];
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,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [DeviceDTO] deviceDTO (required):
Future<DeviceDTO> deviceUpdateMainInfos(DeviceDTO deviceDTO) async {
final response = await deviceUpdateMainInfosWithHttpInfo(deviceDTO);
Future<DeviceDTO?> deviceUpdateMainInfos(DeviceDTO deviceDTO,) async {
final response = await deviceUpdateMainInfosWithHttpInfo(deviceDTO,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'DeviceDTO') as DeviceDTO;
}
return Future<DeviceDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DeviceDTO',) as DeviceDTO;
}
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!
//
// @dart=2.0
// @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 ResourceApi {
ResourceApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
ResourceApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
@ -19,372 +20,299 @@ class ResourceApi {
/// Parameters:
///
/// * [ResourceDTO] resourceDTO (required):
Future<Response> resourceCreateWithHttpInfo(ResourceDTO resourceDTO) async {
// Verify required params are set.
if (resourceDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO');
}
Future<Response> resourceCreateWithHttpInfo(ResourceDTO resourceDTO,) async {
// ignore: prefer_const_declarations
final path = r'/api/Resource';
Object postBody = resourceDTO;
// ignore: prefer_final_locals
Object? postBody = resourceDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['application/json'];
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,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [ResourceDTO] resourceDTO (required):
Future<ResourceDTO> resourceCreate(ResourceDTO resourceDTO) async {
final response = await resourceCreateWithHttpInfo(resourceDTO);
Future<ResourceDTO?> resourceCreate(ResourceDTO resourceDTO,) async {
final response = await resourceCreateWithHttpInfo(resourceDTO,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO;
}
return Future<ResourceDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ResourceDTO',) as ResourceDTO;
}
return null;
}
/// Performs an HTTP 'DELETE /api/Resource/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> resourceDeleteWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
Future<Response> resourceDeleteWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
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 headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>[];
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,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<String> resourceDelete(String id) async {
final response = await resourceDeleteWithHttpInfo(id);
Future<String?> resourceDelete(String id,) async {
final response = await resourceDeleteWithHttpInfo(id,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
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/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';
Object postBody;
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final 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 {
if (instanceId != null) {
queryParams.addAll(_queryParams('', 'instanceId', instanceId));
}
if (types != null) {
queryParams.addAll(_queryParams('multi', 'types', types));
}
return await apiClient.invokeAPI(
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<List<ResourceDTO>> resourceGet() async {
final response = await resourceGetWithHttpInfo();
/// Parameters:
///
/// * [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) {
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<ResourceDTO>') as List)
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<ResourceDTO>') as List)
.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].
/// Parameters:
///
/// * [String] id (required):
Future<Response> resourceGetDetailWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
Future<Response> resourceGetDetailWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
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 headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>[];
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,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<ResourceDTO> resourceGetDetail(String id) async {
final response = await resourceGetDetailWithHttpInfo(id);
Future<ResourceDTO?> resourceGetDetail(String id,) async {
final response = await resourceGetDetailWithHttpInfo(id,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO;
}
return Future<ResourceDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ResourceDTO',) as ResourceDTO;
}
return null;
}
/// Performs an HTTP 'GET /api/Resource/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> resourceShowWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
Future<Response> resourceShowWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
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 headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>[];
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,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<MultipartFile> resourceShow(String id) async {
final response = await resourceShowWithHttpInfo(id);
Future<MultipartFile?> resourceShow(String id,) async {
final response = await resourceShowWithHttpInfo(id,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'MultipartFile') as MultipartFile;
}
return Future<MultipartFile>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
}
return null;
}
/// Performs an HTTP 'PUT /api/Resource' operation and returns the [Response].
/// Parameters:
///
/// * [ResourceDTO] resourceDTO (required):
Future<Response> resourceUpdateWithHttpInfo(ResourceDTO resourceDTO) async {
// Verify required params are set.
if (resourceDTO == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: resourceDTO');
}
Future<Response> resourceUpdateWithHttpInfo(ResourceDTO resourceDTO,) async {
// ignore: prefer_const_declarations
final path = r'/api/Resource';
Object postBody = resourceDTO;
// ignore: prefer_final_locals
Object? postBody = resourceDTO;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['application/json'];
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,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [ResourceDTO] resourceDTO (required):
Future<ResourceDTO> resourceUpdate(ResourceDTO resourceDTO) async {
final response = await resourceUpdateWithHttpInfo(resourceDTO);
Future<ResourceDTO?> resourceUpdate(ResourceDTO resourceDTO,) async {
final response = await resourceUpdateWithHttpInfo(resourceDTO,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'ResourceDTO') as ResourceDTO;
}
return Future<ResourceDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ResourceDTO',) as ResourceDTO;
}
return null;
}
/// Performs an HTTP 'POST /api/Resource/upload' operation and returns the [Response].
@ -393,56 +321,47 @@ class ResourceApi {
/// * [String] label:
///
/// * [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';
Object postBody;
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['multipart/form-data'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['multipart/form-data'];
if (
nullableContentType != null &&
nullableContentType.toLowerCase().startsWith('multipart/form-data')
) {
bool hasFields = false;
final mp = MultipartRequest(null, null);
if (label != null) {
hasFields = true;
mp.fields[r'label'] = parameterToString(label);
}
if (type != null) {
hasFields = true;
mp.fields[r'type'] = parameterToString(type);
}
if (hasFields) {
postBody = mp;
}
} else {
if (label != null) {
formParams[r'label'] = parameterToString(label);
}
if (type != null) {
formParams[r'type'] = parameterToString(type);
}
bool hasFields = false;
final mp = MultipartRequest('POST', Uri.parse(path));
if (label != null) {
hasFields = true;
mp.fields[r'label'] = parameterToString(label);
}
if (type != null) {
hasFields = true;
mp.fields[r'type'] = parameterToString(type);
}
if (instanceId != null) {
hasFields = true;
mp.fields[r'instanceId'] = parameterToString(instanceId);
}
if (hasFields) {
postBody = mp;
}
return await apiClient.invokeAPI(
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
@ -451,17 +370,20 @@ class ResourceApi {
/// * [String] label:
///
/// * [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) {
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'String',) as String;
}
return null;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,17 +1,18 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// @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 UserApi {
UserApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
UserApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
@ -19,307 +20,233 @@ class UserApi {
/// Parameters:
///
/// * [User] user (required):
Future<Response> userCreateUserWithHttpInfo(User user) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
}
Future<Response> userCreateUserWithHttpInfo(User user,) async {
// ignore: prefer_const_declarations
final path = r'/api/User';
Object postBody = user;
// ignore: prefer_final_locals
Object? postBody = user;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['application/json'];
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,
'POST',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [User] user (required):
Future<UserDetailDTO> userCreateUser(User user) async {
final response = await userCreateUserWithHttpInfo(user);
Future<UserDetailDTO?> userCreateUser(User user,) async {
final response = await userCreateUserWithHttpInfo(user,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO;
}
return Future<UserDetailDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserDetailDTO',) as UserDetailDTO;
}
return null;
}
/// Performs an HTTP 'DELETE /api/User/{id}' operation and returns the [Response].
/// Parameters:
///
/// * [String] id (required):
Future<Response> userDeleteUserWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
Future<Response> userDeleteUserWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
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 headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>[];
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,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<String> userDeleteUser(String id) async {
final response = await userDeleteUserWithHttpInfo(id);
Future<String?> userDeleteUser(String id,) async {
final response = await userDeleteUserWithHttpInfo(id,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'String') as String;
}
return Future<String>.value(null);
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/User' operation and returns the [Response].
Future<Response> userGetWithHttpInfo() async {
// ignore: prefer_const_declarations
final path = r'/api/User';
Object postBody;
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>[];
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,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
Future<List<User>> userGet() async {
Future<List<User>?> userGet() async {
final response = await userGetWithHttpInfo();
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return (apiClient.deserialize(_decodeBodyBytes(response), 'List<User>') as List)
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<User>') as List)
.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].
/// Parameters:
///
/// * [String] id (required):
Future<Response> userGetDetailWithHttpInfo(String id) async {
// Verify required params are set.
if (id == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: id');
}
Future<Response> userGetDetailWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
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 headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>[];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>[];
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,
'GET',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [String] id (required):
Future<UserDetailDTO> userGetDetail(String id) async {
final response = await userGetDetailWithHttpInfo(id);
Future<UserDetailDTO?> userGetDetail(String id,) async {
final response = await userGetDetailWithHttpInfo(id,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO;
}
return Future<UserDetailDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserDetailDTO',) as UserDetailDTO;
}
return null;
}
/// Performs an HTTP 'PUT /api/User' operation and returns the [Response].
/// Parameters:
///
/// * [User] user (required):
Future<Response> userUpdateUserWithHttpInfo(User user) async {
// Verify required params are set.
if (user == null) {
throw ApiException(HttpStatus.badRequest, 'Missing required param: user');
}
Future<Response> userUpdateUserWithHttpInfo(User user,) async {
// ignore: prefer_const_declarations
final path = r'/api/User';
Object postBody = user;
// ignore: prefer_final_locals
Object? postBody = user;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
final contentTypes = <String>['application/json'];
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
final authNames = <String>['bearer'];
const contentTypes = <String>['application/json'];
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,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
nullableContentType,
authNames,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [User] user (required):
Future<UserDetailDTO> userUpdateUser(User user) async {
final response = await userUpdateUserWithHttpInfo(user);
Future<UserDetailDTO?> userUpdateUser(User user,) async {
final response = await userUpdateUserWithHttpInfo(user,);
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.
// 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 != null && response.statusCode != HttpStatus.noContent) {
return apiClient.deserialize(_decodeBodyBytes(response), 'UserDetailDTO') as UserDetailDTO;
}
return Future<UserDetailDTO>.value(null);
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserDetailDTO',) as UserDetailDTO;
}
return null;
}
}

View File

@ -1,19 +1,17 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// @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 ApiClient {
ApiClient({this.basePath = 'http://192.168.31.140'}) {
// Setup authentications (key: authentication name, value: authentication).
_authentications[r'bearer'] = OAuth();
}
ApiClient({this.basePath = 'https://api.mymuseum.be', this.authentication});
final String basePath;
@ -25,17 +23,12 @@ class ApiClient {
Client get client => _client;
/// Requests to use a new HTTP [Client] in this class.
///
/// If the [newClient] is null, an [ArgumentError] is thrown.
set client(Client newClient) {
if (newClient == null) {
throw ArgumentError('New client instance cannot be null.');
}
_client = newClient;
}
final _defaultHeaderMap = <String, String>{};
final _authentications = <String, Authentication>{};
final Authentication? authentication;
void addDefaultHeader(String key, String value) {
_defaultHeaderMap[key] = value;
@ -43,59 +36,42 @@ class ApiClient {
Map<String,String> get defaultHeaderMap => _defaultHeaderMap;
/// returns an unmodifiable view of the authentications, since none should be added
/// 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.
// We don't use a Map<String, String> for queryParams.
// If collectionFormat is 'multi', a key might appear multiple times.
Future<Response> invokeAPI(
String path,
String method,
Iterable<QueryParam> queryParams,
Object body,
List<QueryParam> queryParams,
Object? body,
Map<String, String> headerParams,
Map<String, String> formParams,
String nullableContentType,
List<String> authNames,
String? contentType,
) async {
_updateParamsForAuth(authNames, queryParams, headerParams);
_updateParamsForAuth(queryParams, headerParams);
headerParams.addAll(_defaultHeaderMap);
final urlEncodedQueryParams = queryParams
.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;
if (contentType != null) {
headerParams['Content-Type'] = contentType;
}
final urlEncodedQueryParams = queryParams.map((param) => '$param');
final queryString = urlEncodedQueryParams.isNotEmpty ? '?${urlEncodedQueryParams.join('&')}' : '';
final uri = Uri.parse('$basePath$path$queryString');
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 (
body is MultipartFile && (nullableContentType == null ||
!nullableContentType.toLowerCase().startsWith('multipart/form-data'))
body is MultipartFile && (contentType == null ||
!contentType.toLowerCase().startsWith('multipart/form-data'))
) {
final request = StreamedRequest(method, Uri.parse(url));
final request = StreamedRequest(method, uri);
request.headers.addAll(headerParams);
request.contentLength = body.length;
body.finalize().listen(
request.sink.add,
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,
);
final response = await _client.send(request);
@ -103,7 +79,7 @@ class ApiClient {
}
if (body is MultipartRequest) {
final request = MultipartRequest(method, Uri.parse(url));
final request = MultipartRequest(method, uri);
request.fields.addAll(body.fields);
request.files.addAll(body.files);
request.headers.addAll(body.headers);
@ -112,50 +88,110 @@ class ApiClient {
return Response.fromStream(response);
}
final msgBody = nullableContentType == 'application/x-www-form-urlencoded'
final msgBody = contentType == 'application/x-www-form-urlencoded'
? formParams
: serialize(body);
: await serializeAsync(body);
final nullableHeaderParams = headerParams.isEmpty ? null : headerParams;
switch(method) {
case 'POST': return await _client.post(url, headers: nullableHeaderParams, body: msgBody,);
case 'PUT': return await _client.put(url, headers: nullableHeaderParams, body: msgBody,);
case 'DELETE': return await _client.delete(url, headers: nullableHeaderParams,);
case 'PATCH': return await _client.patch(url, headers: nullableHeaderParams, body: msgBody,);
case 'HEAD': return await _client.head(url, headers: nullableHeaderParams,);
case 'GET': return await _client.get(url, headers: nullableHeaderParams,);
case 'POST': return await _client.post(uri, headers: nullableHeaderParams, body: msgBody,);
case 'PUT': return await _client.put(uri, headers: nullableHeaderParams, body: msgBody,);
case 'DELETE': return await _client.delete(uri, headers: nullableHeaderParams, body: msgBody,);
case 'PATCH': return await _client.patch(uri, headers: nullableHeaderParams, body: msgBody,);
case 'HEAD': return await _client.head(uri, headers: nullableHeaderParams,);
case 'GET': return await _client.get(uri, headers: nullableHeaderParams,);
}
} on SocketException catch (e, trace) {
throw ApiException.withInner(HttpStatus.badRequest, 'Socket operation failed: $method $path', e, trace,);
} on TlsException catch (e, trace) {
throw ApiException.withInner(HttpStatus.badRequest, 'TLS/SSL communication failed: $method $path', e, trace,);
} on IOException catch (e, trace) {
throw ApiException.withInner(HttpStatus.badRequest, 'I/O operation failed: $method $path', e, trace,);
} on ClientException catch (e, trace) {
throw ApiException.withInner(HttpStatus.badRequest, 'HTTP connection failed: $method $path', e, trace,);
} on Exception catch (e, trace) {
throw ApiException.withInner(HttpStatus.badRequest, 'Exception occurred: $method $path', e, trace,);
} on SocketException catch (error, trace) {
throw ApiException.withInner(
HttpStatus.badRequest,
'Socket operation failed: $method $path',
error,
trace,
);
} on TlsException catch (error, trace) {
throw ApiException.withInner(
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 {
switch (targetType) {
case 'String':
return '$value';
return value is String ? value : value.toString();
case 'int':
return value is int ? value : int.parse('$value');
case 'double':
return value is double ? value : double.parse('$value');
case 'bool':
if (value is bool) {
return value;
}
final valueString = '$value'.toLowerCase();
return valueString == 'true' || valueString == '1';
break;
case 'double':
return value is double ? value : double.parse('$value');
case 'ArticleDTO':
return ArticleDTO.fromJson(value);
case 'ConfigurationDTO':
return ConfigurationDTO.fromJson(value);
case 'DeviceDTO':
@ -174,6 +210,10 @@ class ApiClient {
return ImageDTO.fromJson(value);
case 'ImageGeoPoint':
return ImageGeoPoint.fromJson(value);
case 'Instance':
return Instance.fromJson(value);
case 'InstanceDTO':
return InstanceDTO.fromJson(value);
case 'LevelDTO':
return LevelDTO.fromJson(value);
case 'LoginDTO':
@ -182,7 +222,6 @@ class ApiClient {
return MapDTO.fromJson(value);
case 'MapTypeApp':
return MapTypeAppTypeTransformer().decode(value);
case 'MenuDTO':
return MenuDTO.fromJson(value);
case 'PlayerMessageDTO':
@ -191,18 +230,18 @@ class ApiClient {
return QuestionDTO.fromJson(value);
case 'QuizzDTO':
return QuizzDTO.fromJson(value);
case 'QuizzDTOBadLevel':
return QuizzDTOBadLevel.fromJson(value);
case 'ResourceDTO':
return ResourceDTO.fromJson(value);
case 'ResourceType':
return ResourceTypeTypeTransformer().decode(value);
case 'ResponseDTO':
return ResponseDTO.fromJson(value);
case 'SectionDTO':
return SectionDTO.fromJson(value);
case 'SectionType':
return SectionTypeTypeTransformer().decode(value);
case 'SliderDTO':
return SliderDTO.fromJson(value);
case 'TokenDTO':
@ -218,58 +257,63 @@ class ApiClient {
case 'WebDTO':
return WebDTO.fromJson(value);
default:
Match match;
if (value is List && (match = _regList.firstMatch(targetType)) != null) {
final newTargetType = match[1];
dynamic match;
if (value is List && (match = _regList.firstMatch(targetType)?.group(1)) != null) {
return value
.map((v) => _deserialize(v, newTargetType, growable: growable))
.toList(growable: true == growable);
.map<dynamic>((dynamic v) => _deserialize(v, match, growable: growable,))
.toList(growable: growable);
}
if (value is Set && (match = _regSet.firstMatch(targetType)) != null) {
final newTargetType = match[1];
if (value is Set && (match = _regSet.firstMatch(targetType)?.group(1)) != null) {
return value
.map((v) => _deserialize(v, newTargetType, growable: growable))
.map<dynamic>((dynamic v) => _deserialize(v, match, growable: growable,))
.toSet();
}
if (value is Map && (match = _regMap.firstMatch(targetType)) != null) {
final newTargetType = match[1];
return Map.fromIterables(
value.keys,
value.values.map((v) => _deserialize(v, newTargetType, growable: growable)),
if (value is Map && (match = _regMap.firstMatch(targetType)?.group(1)) != null) {
return Map<String, dynamic>.fromIterables(
value.keys.cast<String>(),
value.values.map<dynamic>((dynamic v) => _deserialize(v, match, growable: growable,)),
);
}
break;
}
} on Exception catch (e, stack) {
throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', e, stack,);
} on Exception catch (error, trace) {
throw ApiException.withInner(HttpStatus.internalServerError, 'Exception during deserialization.', error, trace,);
}
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!
//
// @dart=2.0
// @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;
@ -15,10 +16,11 @@ class ApiException implements Exception {
ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace);
int code = 0;
String message;
Exception innerException;
StackTrace stackTrace;
String? message;
Exception? innerException;
StackTrace? stackTrace;
@override
String toString() {
if (message == null) {
return 'ApiException';

View File

@ -1,10 +1,11 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// @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;
@ -20,31 +21,27 @@ class QueryParam {
}
// Ported from the Java version.
Iterable<QueryParam> _convertParametersForCollectionFormat(
String collectionFormat,
String name,
dynamic value,
) {
Iterable<QueryParam> _queryParams(String collectionFormat, String name, dynamic value,) {
// Assertions to run in debug mode only.
assert(name.isNotEmpty, 'Parameter cannot be an empty string.');
final params = <QueryParam>[];
// preconditions
if (name != null && !name.isEmpty && value != null) {
if (value is List) {
// 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)));
if (value is List) {
if (collectionFormat == 'multi') {
return value.map((dynamic v) => QueryParam(name, parameterToString(v)),);
}
// 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;
@ -72,9 +69,42 @@ String parameterToString(dynamic value) {
/// 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.
String _decodeBodyBytes(Response response) {
Future<String> _decodeBodyBytes(Response response) async {
final contentType = response.headers['content-type'];
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;
}
/// 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!
//
// @dart=2.0
// @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;
@ -15,21 +16,25 @@ class ApiKeyAuth implements Authentication {
final String location;
final String paramName;
String apiKeyPrefix;
String apiKey;
String apiKeyPrefix = '';
String apiKey = '';
@override
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) {
queryParams.add(QueryParam(paramName, value));
} else if (location == 'header' && value != null) {
headerParams[paramName] = value;
} else if (location == 'cookie' && value != null) {
headerParams.update('Cookie', (String existingCookie) {
return '$existingCookie; $paramName=$value';
}, ifAbsent: () => '$paramName=$value');
if (paramValue.isNotEmpty) {
if (location == 'query') {
queryParams.add(QueryParam(paramName, paramValue));
} else if (location == 'header') {
headerParams[paramName] = paramValue;
} else if (location == 'cookie') {
headerParams.update(
'Cookie',
(existingCookie) => '$existingCookie; $paramName=$paramValue',
ifAbsent: () => '$paramName=$paramValue',
);
}
}
}
}

View File

@ -1,14 +1,16 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// @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;
// ignore: one_member_abstracts
abstract class Authentication {
/// Apply authentication settings to header and query params.
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams);

View File

@ -1,21 +1,26 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// @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 HttpBasicAuth implements Authentication {
HttpBasicAuth({this.username = '', this.password = ''});
String username;
String password;
@override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
final credentials = (username ?? '') + ':' + (password ?? '');
headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}';
if (username.isNotEmpty && password.isNotEmpty) {
final credentials = '$username:$password';
headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}';
}
}
}

View File

@ -1,10 +1,11 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.0
// @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;
@ -20,19 +21,29 @@ class HttpBearerAuth implements Authentication {
set accessToken(dynamic accessToken) {
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
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
if (_accessToken == null) {
return;
}
String accessToken;
if (_accessToken is String) {
headerParams['Authorization'] = 'Bearer $_accessToken';
accessToken = _accessToken;
} else if (_accessToken is HttpBearerAuthProvider) {
headerParams['Authorization'] = 'Bearer ${_accessToken()}';
accessToken = _accessToken!();
} 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!
//
// @dart=2.0
// @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 OAuth implements Authentication {
OAuth({this.accessToken});
OAuth({this.accessToken = ''});
String accessToken;
@override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
if (accessToken != null) {
if (accessToken.isNotEmpty) {
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!
//
// @dart=2.0
// @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;
@ -14,107 +15,232 @@ class ConfigurationDTO {
ConfigurationDTO({
this.id,
this.label,
this.title = const [],
this.imageId,
this.imageSource,
this.primaryColor,
this.secondaryColor,
this.languages,
this.languages = const [],
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
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
other.id == id &&
other.label == label &&
other.title == title &&
other.imageId == imageId &&
other.imageSource == imageSource &&
other.primaryColor == primaryColor &&
other.secondaryColor == secondaryColor &&
other.languages == languages &&
other.dateCreation == dateCreation;
other.dateCreation == dateCreation &&
other.isMobile == isMobile &&
other.isTablet == isTablet &&
other.isOffline == isOffline &&
other.instanceId == instanceId;
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(label == null ? 0 : label.hashCode) +
(primaryColor == null ? 0 : primaryColor.hashCode) +
(secondaryColor == null ? 0 : secondaryColor.hashCode) +
(languages == null ? 0 : languages.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode);
// ignore: unnecessary_parenthesis
(id == null ? 0 : id!.hashCode) +
(label == null ? 0 : label!.hashCode) +
(title == null ? 0 : title!.hashCode) +
(imageId == null ? 0 : imageId!.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
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() {
final json = <String, dynamic>{};
final _json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
_json[r'id'] = id;
}
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) {
json[r'primaryColor'] = primaryColor;
_json[r'primaryColor'] = primaryColor;
}
if (secondaryColor != null) {
json[r'secondaryColor'] = secondaryColor;
_json[r'secondaryColor'] = secondaryColor;
}
if (languages != null) {
json[r'languages'] = languages;
_json[r'languages'] = languages;
}
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
/// [json] if it's non-null, null if [json] is null.
static ConfigurationDTO fromJson(Map<String, dynamic> json) => json == null
? null
: ConfigurationDTO(
id: json[r'id'],
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']),
);
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ConfigurationDTO? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
static List<ConfigurationDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <ConfigurationDTO>[]
: json.map((v) => ConfigurationDTO.fromJson(v)).toList(growable: true == growable);
// 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 "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>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = ConfigurationDTO.fromJson(v));
if (json is Map && json.isNotEmpty) {
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;
}
// 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>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = ConfigurationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ConfigurationDTO.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!
//
// @dart=2.0
// @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;
@ -22,39 +23,72 @@ class DeviceDetailDTO {
this.connected,
this.dateCreation,
this.dateUpdate,
this.instanceId,
this.connectionLevel,
this.lastConnectionLevel,
this.batteryLevel,
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
bool operator ==(Object other) => identical(this, other) || other is DeviceDetailDTO &&
@ -68,6 +102,7 @@ class DeviceDetailDTO {
other.connected == connected &&
other.dateCreation == dateCreation &&
other.dateUpdate == dateUpdate &&
other.instanceId == instanceId &&
other.connectionLevel == connectionLevel &&
other.lastConnectionLevel == lastConnectionLevel &&
other.batteryLevel == batteryLevel &&
@ -75,122 +110,159 @@ class DeviceDetailDTO {
@override
int get hashCode =>
(id == null ? 0 : id.hashCode) +
(identifier == null ? 0 : identifier.hashCode) +
(name == null ? 0 : name.hashCode) +
(ipAddressWLAN == null ? 0 : ipAddressWLAN.hashCode) +
(ipAddressETH == null ? 0 : ipAddressETH.hashCode) +
(configurationId == null ? 0 : configurationId.hashCode) +
(configuration == null ? 0 : configuration.hashCode) +
(connected == null ? 0 : connected.hashCode) +
(dateCreation == null ? 0 : dateCreation.hashCode) +
(dateUpdate == null ? 0 : dateUpdate.hashCode) +
(connectionLevel == null ? 0 : connectionLevel.hashCode) +
(lastConnectionLevel == null ? 0 : lastConnectionLevel.hashCode) +
(batteryLevel == null ? 0 : batteryLevel.hashCode) +
(lastBatteryLevel == null ? 0 : lastBatteryLevel.hashCode);
// ignore: unnecessary_parenthesis
(id == null ? 0 : id!.hashCode) +
(identifier == null ? 0 : identifier!.hashCode) +
(name == null ? 0 : name!.hashCode) +
(ipAddressWLAN == null ? 0 : ipAddressWLAN!.hashCode) +
(ipAddressETH == null ? 0 : ipAddressETH!.hashCode) +
(configurationId == null ? 0 : configurationId!.hashCode) +
(configuration == null ? 0 : configuration!.hashCode) +
(connected == null ? 0 : connected!.hashCode) +
(dateCreation == null ? 0 : dateCreation!.hashCode) +
(dateUpdate == null ? 0 : dateUpdate!.hashCode) +
(instanceId == null ? 0 : instanceId!.hashCode) +
(connectionLevel == null ? 0 : connectionLevel!.hashCode) +
(lastConnectionLevel == null ? 0 : lastConnectionLevel!.hashCode) +
(batteryLevel == null ? 0 : batteryLevel!.hashCode) +
(lastBatteryLevel == null ? 0 : lastBatteryLevel!.hashCode);
@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() {
final json = <String, dynamic>{};
final _json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
_json[r'id'] = id;
}
if (identifier != null) {
json[r'identifier'] = identifier;
_json[r'identifier'] = identifier;
}
if (name != null) {
json[r'name'] = name;
_json[r'name'] = name;
}
if (ipAddressWLAN != null) {
json[r'ipAddressWLAN'] = ipAddressWLAN;
_json[r'ipAddressWLAN'] = ipAddressWLAN;
}
if (ipAddressETH != null) {
json[r'ipAddressETH'] = ipAddressETH;
_json[r'ipAddressETH'] = ipAddressETH;
}
if (configurationId != null) {
json[r'configurationId'] = configurationId;
_json[r'configurationId'] = configurationId;
}
if (configuration != null) {
json[r'configuration'] = configuration;
_json[r'configuration'] = configuration;
}
if (connected != null) {
json[r'connected'] = connected;
_json[r'connected'] = connected;
}
if (dateCreation != null) {
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
_json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
}
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) {
json[r'connectionLevel'] = connectionLevel;
_json[r'connectionLevel'] = connectionLevel;
}
if (lastConnectionLevel != null) {
json[r'lastConnectionLevel'] = lastConnectionLevel.toUtc().toIso8601String();
_json[r'lastConnectionLevel'] = lastConnectionLevel!.toUtc().toIso8601String();
}
if (batteryLevel != null) {
json[r'batteryLevel'] = batteryLevel;
_json[r'batteryLevel'] = batteryLevel;
}
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
/// [json] if it's non-null, null if [json] is null.
static DeviceDetailDTO fromJson(Map<String, dynamic> json) => json == null
? null
: DeviceDetailDTO(
id: json[r'id'],
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']),
);
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static DeviceDetailDTO? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
static List<DeviceDetailDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
json == null || json.isEmpty
? true == emptyIsNull ? null : <DeviceDetailDTO>[]
: json.map((v) => DeviceDetailDTO.fromJson(v)).toList(growable: true == growable);
// 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 "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>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) => map[key] = DeviceDetailDTO.fromJson(v));
if (json is Map && json.isNotEmpty) {
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;
}
// 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>>{};
if (json != null && json.isNotEmpty) {
json.forEach((String key, dynamic v) {
map[key] = DeviceDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
});
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = DeviceDetailDTO.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>{
};
}

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