diff --git a/lib/Models/menuSection.dart b/lib/Models/menuSection.dart index e06a450..5cd5327 100644 --- a/lib/Models/menuSection.dart +++ b/lib/Models/menuSection.dart @@ -1,15 +1,17 @@ class MenuSection { String name; String type; - int order; + int menuId; + List subMenu; - MenuSection({required this.name, required this.type, required this.order}); + MenuSection({required this.name, required this.type, required this.menuId, required this.subMenu}); factory MenuSection.fromJson(Map json) { return new MenuSection( name: json['name'] as String, type: json['type'] as String, - order: json['order'] as int, + menuId: json['menuId'] as int, + subMenu: json['subMenu'] as List, ); } @@ -17,12 +19,13 @@ class MenuSection { return { 'name': name, 'type': type, - 'order': order + 'menuId': menuId, + 'subMenu': subMenu }; } @override String toString() { - return '{name: $name, type: $type, order: $order}'; + return '{name: $name, type: $type, menuId: $menuId, subMenu: $subMenu}'; } } \ No newline at end of file diff --git a/lib/Screens/Main/components/body.dart b/lib/Screens/Main/components/body.dart index 82c682c..89e9b8f 100644 --- a/lib/Screens/Main/components/body.dart +++ b/lib/Screens/Main/components/body.dart @@ -1,6 +1,7 @@ import 'dart:html'; import 'package:auto_size_text/auto_size_text.dart'; +import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Models/menu.dart'; @@ -16,201 +17,215 @@ import 'package:manager_app/main.dart'; import 'package:manager_api_new/api.dart'; import 'package:provider/provider.dart'; - class Body extends StatefulWidget { - final bool showDevice; - Body({ - Key? key, - required this.showDevice - }) : super(key: key); + final InstanceDTO instance; + Body({Key? key, required this.instance}) : super(key: key); @override _BodyState createState() => _BodyState(); } class _BodyState extends State { - bool isChecked = false; - int currentPosition = 0; - var selectedElement; + late int currentPosition; late MenuSection devices; late MenuSection configurations; late MenuSection resources; - Menu menu = new Menu(title: "MyInfoMate"); + Menu menu = Menu(title: "MyInfoMate"); @override void initState() { - devices = new MenuSection(name: "Tablettes", type: "devices", order: 0); - configurations = new MenuSection(name: "Configurations", type: "configurations", order: widget.showDevice ? 1 : 0); // TODO Renommer spécifiquement en Visites pour St Heribert - resources = new MenuSection(name: "Ressources", type: "resources", order: widget.showDevice ? 2 : 1); - //tabsToShow.add(new Tab(text: "Vidéo en ligne")); - super.initState(); + devices = MenuSection(name: "Applications", type: "devices", menuId: 0, subMenu: []); + if (widget.instance.isMobile!) devices.subMenu.add(MenuSection(name: "Mobile", type: "mobile", menuId: 1, subMenu: [])); + if (widget.instance.isTablet!) devices.subMenu.add(MenuSection(name: "Kiosk", type: "kiosk", menuId: 2, subMenu: [])); + if (widget.instance.isWeb!) devices.subMenu.add(MenuSection(name: "Web", type: "web", menuId: 3, subMenu: [])); + if (widget.instance.isVR!) devices.subMenu.add(MenuSection(name: "VR", type: "vr", menuId: 4, subMenu: [])); + + configurations = MenuSection(name: "Configurations", type: "configurations", menuId: 5, subMenu: []); + resources = MenuSection(name: "Ressources", type: "resources", menuId: 6, subMenu: []); + + menu.sections = [devices, configurations, resources]; } + Widget buildMenu(BuildContext context, AppContext appContext, ManagerAppContext managerAppContext, bool isDrawer) { + return Container( + width: isDrawer ? null : 250, // fixed width on sidebar, null on drawer for full width + color: kSecond, + child: Column( + children: [ + DrawerHeader( + child: Text( + menu.title, + style: TextStyle(color: kPrimaryColor, fontSize: 30, fontWeight: FontWeight.w400, fontFamily: "Helvetica"), + ), + ), + Expanded( + child: ListView( + padding: EdgeInsets.zero, + children: menu.sections!.map((section) { + if (section.subMenu.isEmpty) { + return ListTile( + title: Text(section.name, style: TextStyle(color: section.menuId == currentPosition ? kPrimaryColor : kBodyTextColor, fontSize: 20)), + selected: currentPosition == section.menuId, + onTap: () { + setState(() { + currentPosition = section.menuId; + selectedElement = initElementToShow(currentPosition, menu); + managerAppContext.currentPositionMenu = currentPosition; + appContext.setContext(managerAppContext); + }); + if (isDrawer) Navigator.of(context).pop(); // Close drawer on mobile + }, + ); + } else { + return ExpansionTile( + iconColor: currentPosition >= 1 && currentPosition <= 4 ? kPrimaryColor : kBodyTextColor, + collapsedIconColor: currentPosition >= 1 && currentPosition <= 4 ? kPrimaryColor : kBodyTextColor, + title: Text(section.name, style: TextStyle(color: currentPosition >= 1 && currentPosition <= 4 ? kPrimaryColor : kBodyTextColor, fontSize: 20)), + children: section.subMenu.map((subSection) { + return ListTile( + title: Padding( + padding: const EdgeInsets.only(left: 16.0), + child: Text(subSection.name, style: TextStyle(color: subSection.menuId == currentPosition ? kPrimaryColor : kBodyTextColor, fontSize: 18)), + ), + selected: currentPosition == subSection.menuId, + onTap: () { + setState(() { + currentPosition = subSection.menuId; + selectedElement = initElementToShow(currentPosition, menu); + managerAppContext.currentPositionMenu = currentPosition; + appContext.setContext(managerAppContext); + }); + if (isDrawer) Navigator.of(context).pop(); + }, + ); + }).toList(), + ); + } + }).toList(), + ), + ), + // Footer: Email + Logout button + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + AutoSizeText( + (appContext.getContext() as ManagerAppContext).email ?? "", + style: TextStyle(color: kBodyTextColor, fontSize: 16, fontWeight: FontWeight.w300, fontFamily: "Helvetica"), + maxLines: 1, + ), + IconButton( + icon: Icon(Icons.logout, color: kPrimaryColor), + onPressed: () async { + var session = await loadJsonSessionFile(); + setState(() { + Storage localStorage = window.localStorage; + localStorage.clear(); + ManagerAppContext managerAppContext = appContext.getContext(); + managerAppContext.accessToken = null; + appContext.setContext(managerAppContext); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => LoginScreen(session: session)), + (route) => false, + ); + }); + }, + ) + ], + ), + ), + ], + ), + ); + } + + late Widget selectedElement; + @override Widget build(BuildContext context) { final appContext = Provider.of(context); - Size size = MediaQuery.of(context).size; - - menu.sections = []; - - if(widget.showDevice) // pour ne pas perturber francoise - { - menu.sections!.add(devices); - } - - menu.sections!.add(configurations); - menu.sections!.add(resources); - ManagerAppContext managerAppContext = appContext.getContext(); - currentPosition = managerAppContext.currentPositionMenu ?? currentPosition; + if(managerAppContext.currentPositionMenu == null) { + if (widget.instance.isMobile!) { + currentPosition = 1; + } else if (widget.instance.isTablet!) { + currentPosition = 2; + } else if (widget.instance.isWeb!) { + currentPosition = 3; + } else { + currentPosition = 4; + } + } else { + currentPosition = managerAppContext.currentPositionMenu!; + } selectedElement = initElementToShow(currentPosition, menu); + Size size = MediaQuery.of(context).size; + bool isMobile = size.width < 700; - return Background( - child: Row( - children: [ - if(true) //!ResponsiveBreakpoints.of(context).equals(TABLET) - // MENU - Container( - width: size.width * 0.15, - decoration: BoxDecoration( - color: kSecond, - borderRadius: BorderRadius.only(topRight: Radius.circular(20), bottomRight: Radius.circular(20)), - boxShadow: [ - BoxShadow( - color: kSecond.withOpacity(0.3), - spreadRadius: 0.5, - blurRadius: 0.5, - offset: Offset(0, 1.5), // changes position of shadow - ), - ], - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Container( - alignment: AlignmentDirectional.bottomStart, - child: AutoSizeText( - menu.title, - style: new TextStyle(color: kPrimaryColor, fontSize: 30, fontWeight: FontWeight.w400, fontFamily: "Helvetica"), - maxLines: 1, - ), - ), - ), - Container( - height: size.height * 0.2, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - for (var section in menu.sections!) - InkWell( - onTap: () => { - setState(() { - currentPosition = section.order; - selectedElement = initElementToShow(currentPosition, menu); - managerAppContext.currentPositionMenu = currentPosition; - appContext.setContext(managerAppContext); - }) - }, - child: Container( - alignment: AlignmentDirectional.bottomStart, - decoration: BoxDecoration( - border: currentPosition == section.order ? Border( - right: BorderSide( - color: kPrimaryColor, - width: 4, - ), - ): null, - ), - child: Padding( - padding: const EdgeInsets.only(left: 10), - child: AutoSizeText( - section.name, - style: new TextStyle(color: kBodyTextColor, fontSize: 25, fontWeight: FontWeight.w300, fontFamily: "Helvetica"), - maxLines: 1, - ), - ), - ), - ), - ] - ), - ), - SizedBox( - height: size.height * 0.35, - ), - Container( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - AutoSizeText( - (appContext.getContext() as ManagerAppContext).email!, - style: new TextStyle(color: kBodyTextColor, fontSize: 20, fontWeight: FontWeight.w300, fontFamily: "Helvetica"), - maxLines: 1, - ), - IconButton( - icon: Icon(Icons.logout), - onPressed: () async { - var session = await loadJsonSessionFile(); - - setState(() { - print("Logout"); - Storage localStorage = window.localStorage; - localStorage.clear(); - ManagerAppContext managerAppContext = appContext.getContext(); - managerAppContext.accessToken = null; - appContext.setContext(managerAppContext); - - Navigator.pushAndRemoveUntil( - context, - MaterialPageRoute( - builder: (context) { - return LoginScreen(session: session); - }, - ), - (Route route) => false // For pushAndRemoveUntil - ); - - }); - }, - color: kPrimaryColor, - ), - ], - ), - ) - ) - ], - ), - ), - // Main Container - Container( - width: size.width * 0.85,//!ResponsiveBreakpoints.of(context).equals(TABLET) ? size.width * 0.85 : size.width, - child: Padding( - padding: const EdgeInsets.all(0.0), - child: selectedElement), + return Scaffold( + appBar: isMobile + ? AppBar( + title: Text(menu.title, style: TextStyle(color: kPrimaryColor)), + backgroundColor: kSecond, + leading: Builder( + builder: (context) => IconButton( + icon: Icon(Icons.menu, color: kPrimaryColor), + onPressed: () => Scaffold.of(context).openDrawer(), + ), + ), + ) + : null, + drawer: isMobile ? Drawer(child: buildMenu(context, appContext, managerAppContext, true)) : null, + body: Row( + children: [ + if (!isMobile) + buildMenu(context, appContext, managerAppContext, false), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: selectedElement, ), - ] + ), + ], ), ); } } initElementToShow(int currentPosition, Menu menu) { - MenuSection elementToShow = menu.sections!.where((s) => s.order == currentPosition).first; + MenuSection? elementToShow = menu.sections!.firstWhereOrNull((s) => s.menuId == currentPosition); + + if(elementToShow == null) { + elementToShow = menu.sections![0].subMenu.where((s) => s.menuId == currentPosition).first; + } switch (elementToShow.type) { - case 'devices' : + case 'mobile' : + return Padding( + padding: const EdgeInsets.all(8.0), + child: Text("TODO mobile") + ); + case 'kiosk' : return Padding( padding: const EdgeInsets.all(8.0), child: DevicesScreen() ); + case 'web' : + return Padding( + padding: const EdgeInsets.all(8.0), + child: Text("TODO web") + ); + case 'vr' : + return Padding( + padding: const EdgeInsets.all(8.0), + child: Text("TODO vr") + ); case 'configurations' : return Padding( padding: const EdgeInsets.all(8.0), diff --git a/lib/Screens/Main/main_screen.dart b/lib/Screens/Main/main_screen.dart index 58c107a..4df4d6e 100644 --- a/lib/Screens/Main/main_screen.dart +++ b/lib/Screens/Main/main_screen.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:manager_api_new/api.dart'; +import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/Models/managerContext.dart'; import 'package:manager_app/Models/menu.dart'; import 'package:manager_app/Models/menuSection.dart'; @@ -19,66 +21,43 @@ class _MainScreenState extends State { @override Widget build(BuildContext context) { final GlobalKey<_MainScreenState> key = GlobalKey(); - final appContext = Provider.of(context); + Size size = MediaQuery.of(context).size; ManagerAppContext managerAppContext = appContext.getContext(); - var isFortSt = managerAppContext.instanceId == "633ee379d9405f32f166f047"; + //var isFortSt = managerAppContext.instanceId == "633ee379d9405f32f166f047"; - if(!ResponsiveBreakpoints.of(context).equals(TABLET) || isFortSt) { - return Scaffold( - key: key, - body: Body(showDevice: !isFortSt), - ); - } else { - return Scaffold( - key: key, - appBar: AppBar(title: Text("MyInfoMate", style: new TextStyle(color: kPrimaryColor, fontSize: 30, fontWeight: FontWeight.w400, fontFamily: "Helvetica")), backgroundColor: kSecond.withOpacity(0.3), iconTheme: IconThemeData(color: kPrimaryColor)), - drawer: Drawer( - child: getMenu() - ), - body: Body(showDevice: isFortSt), - ); - } - - } - - getMenu() { - MenuSection devices = new MenuSection(name: "Tablettes", type: "devices", order: 0); - MenuSection configurations = new MenuSection(name: "Configurations", type: "configurations", order: 1); // TODO Visites pour Fort St Héribert - MenuSection resources = new MenuSection(name: "Ressources", type: "resources", order: 2); - - Menu menu = new Menu(title: "MyInfoMate"); - - return ListView( - // Important: Remove any padding from the ListView. - padding: EdgeInsets.zero, - children: [ - DrawerHeader( - decoration: BoxDecoration( - color: kPrimaryColor, - ), - child: Text(menu.title), - ), - ListTile( - title: Text(devices.name), - onTap: () { - // TODO Navigate to configurations screen (by route if possible) - }, - ), - ListTile( - title: Text(configurations.name), - onTap: () { - // TODO Navigate to configurations screen (by route if possible) - }, - ), - ListTile( - title: Text(resources.name), - onTap: () { - // TODO Navigate to resources screen (by route if possible) - }, - ), - ], + return FutureBuilder( + future: getInstanceInfo(managerAppContext), + builder: (context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + if (snapshot.data != null) { + var instanceDTO = snapshot.data; + return Scaffold( + key: key, + body: Body(instance: instanceDTO!), + ); + } else { + return Text("No data"); + } + } else if (snapshot.connectionState == ConnectionState.none) { + return Text("No data"); + } else { + return Center( + child: Container( + height: size.height * 0.1, + child: CommonLoader() + ) + ); + } + } ); } + + Future getInstanceInfo(ManagerAppContext managerAppContext) async { + InstanceDTO? instance = await managerAppContext.clientAPI!.instanceApi!.instanceGetDetail(managerAppContext.instanceId!); + return instance; + } } + + diff --git a/lib/Screens/login_screen.dart b/lib/Screens/login_screen.dart index f0369fb..1ba0360 100644 --- a/lib/Screens/login_screen.dart +++ b/lib/Screens/login_screen.dart @@ -254,7 +254,7 @@ class _LoginScreenState extends State { borderRadius: BorderRadius.circular(8.0), boxShadow: [ BoxShadow( - color: kWhite.withOpacity(0.3), + color: kWhite.withValues(alpha: 0.3), spreadRadius: 0.5, blurRadius: 0.5, offset: Offset(0, 1.5), // changes position of shadow diff --git a/lib/api/openApiTest.dart b/lib/api/openApiTest.dart index af1aeba..69d0a47 100644 --- a/lib/api/openApiTest.dart +++ b/lib/api/openApiTest.dart @@ -1,4 +1,4 @@ -// Openapi Generator last run: : 2025-07-17T12:00:29.078649 +// Openapi Generator last run: : 2025-08-01T15:25:28.408371 import 'package:openapi_generator_annotations/openapi_generator_annotations.dart'; @Openapi( diff --git a/lib/api/swagger.yaml b/lib/api/swagger.yaml index 8bf9145..392a7e5 100644 --- a/lib/api/swagger.yaml +++ b/lib/api/swagger.yaml @@ -4,7 +4,7 @@ "info": { "title": "Manager Service", "description": "API Manager Service", - "version": "Version Alpha 0.1" + "version": "Version Alpha" }, "servers": [ { @@ -7078,6 +7078,9 @@ "isTablet": { "type": "boolean" }, + "isWeb": { + "type": "boolean" + }, "isVR": { "type": "boolean" } @@ -7116,6 +7119,9 @@ "isTablet": { "type": "boolean" }, + "isWeb": { + "type": "boolean" + }, "isVR": { "type": "boolean" } diff --git a/lib/client.dart b/lib/client.dart index 9459cf8..2ebfc19 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -11,6 +11,9 @@ class Client { UserApi? _userApi; UserApi? get userApi => _userApi; + InstanceApi? _instanceApi; + InstanceApi? get instanceApi => _instanceApi; + ConfigurationApi? _configurationApi; ConfigurationApi? get configurationApi => _configurationApi; @@ -36,6 +39,7 @@ class Client { //basePath: "https://localhost:44339"); _apiClient!.addDefaultHeader("Access-Control_Allow_Origin", "*"); _authenticationApi = AuthenticationApi(_apiClient); + _instanceApi = InstanceApi(_apiClient); _userApi = UserApi(_apiClient); _configurationApi = ConfigurationApi(_apiClient); _sectionApi = SectionApi(_apiClient); diff --git a/manager_api_new/.openapi-generator/FILES b/manager_api_new/.openapi-generator/FILES index f912150..ebc4ee4 100644 --- a/manager_api_new/.openapi-generator/FILES +++ b/manager_api_new/.openapi-generator/FILES @@ -261,64 +261,3 @@ lib/model/video_dto.dart lib/model/weather_dto.dart lib/model/web_dto.dart pubspec.yaml -test/app_configuration_link_application_instance_test.dart -test/app_configuration_link_configuration_test.dart -test/app_configuration_link_dto_test.dart -test/app_configuration_link_test.dart -test/app_type_test.dart -test/application_instance_dto_test.dart -test/application_instance_section_event_test.dart -test/application_instance_test.dart -test/configuration_test.dart -test/coordinate_equality_comparer_test.dart -test/coordinate_sequence_factory_test.dart -test/coordinate_sequence_test.dart -test/coordinate_test.dart -test/dimension_test.dart -test/envelope_test.dart -test/event_address_dto_geometry_test.dart -test/event_address_dto_test.dart -test/event_agenda_dto_address_test.dart -test/event_agenda_dto_resource_test.dart -test/event_agenda_dto_test.dart -test/geometry_centroid_test.dart -test/geometry_dto_test.dart -test/geometry_envelope_internal_test.dart -test/geometry_factory_coordinate_sequence_factory_test.dart -test/geometry_factory_geometry_services_test.dart -test/geometry_factory_test.dart -test/geometry_precision_model_test.dart -test/geometry_test.dart -test/geometry_type_test.dart -test/guided_path_dto_test.dart -test/guided_path_section_map_test.dart -test/guided_path_test.dart -test/guided_step_dto_test.dart -test/guided_step_dto_trigger_geo_point_test.dart -test/guided_step_guided_path_test.dart -test/guided_step_test.dart -test/guided_step_trigger_geo_point_test.dart -test/layout_main_page_type_test.dart -test/map_annotation_dto_test.dart -test/map_annotation_geometry_test.dart -test/map_annotation_icon_resource_test.dart -test/map_annotation_test.dart -test/nts_geometry_services_coordinate_equality_comparer_test.dart -test/nts_geometry_services_geometry_overlay_test.dart -test/nts_geometry_services_test.dart -test/ogc_geometry_type_test.dart -test/ordinates_test.dart -test/point_all_of_boundary_test.dart -test/point_all_of_coordinate_sequence_test.dart -test/point_all_of_coordinate_test.dart -test/point_test.dart -test/precision_model_test.dart -test/precision_models_test.dart -test/programme_block_dto_test.dart -test/programme_block_test.dart -test/question_type_test.dart -test/quiz_question_guided_step_test.dart -test/section_agenda_api_test.dart -test/section_event_api_test.dart -test/section_event_dto_test.dart -test/section_event_test.dart diff --git a/manager_api_new/doc/Instance.md b/manager_api_new/doc/Instance.md index 98cb4e4..26ec759 100644 --- a/manager_api_new/doc/Instance.md +++ b/manager_api_new/doc/Instance.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **isStatistic** | **bool** | | [optional] **isMobile** | **bool** | | [optional] **isTablet** | **bool** | | [optional] +**isWeb** | **bool** | | [optional] **isVR** | **bool** | | [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) diff --git a/manager_api_new/doc/InstanceDTO.md b/manager_api_new/doc/InstanceDTO.md index dda8541..57d7322 100644 --- a/manager_api_new/doc/InstanceDTO.md +++ b/manager_api_new/doc/InstanceDTO.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **isStatistic** | **bool** | | [optional] **isMobile** | **bool** | | [optional] **isTablet** | **bool** | | [optional] +**isWeb** | **bool** | | [optional] **isVR** | **bool** | | [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) diff --git a/manager_api_new/lib/model/instance.dart b/manager_api_new/lib/model/instance.dart index fa96a04..b1fb94d 100644 --- a/manager_api_new/lib/model/instance.dart +++ b/manager_api_new/lib/model/instance.dart @@ -21,6 +21,7 @@ class Instance { this.isStatistic, this.isMobile, this.isTablet, + this.isWeb, this.isVR, }); @@ -70,6 +71,14 @@ class Instance { /// 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? isWeb; + /// /// 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 @@ -90,6 +99,7 @@ class Instance { other.isStatistic == isStatistic && other.isMobile == isMobile && other.isTablet == isTablet && + other.isWeb == isWeb && other.isVR == isVR; @override @@ -103,11 +113,12 @@ class Instance { (isStatistic == null ? 0 : isStatistic!.hashCode) + (isMobile == null ? 0 : isMobile!.hashCode) + (isTablet == null ? 0 : isTablet!.hashCode) + + (isWeb == null ? 0 : isWeb!.hashCode) + (isVR == null ? 0 : isVR!.hashCode); @override String toString() => - 'Instance[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isVR=$isVR]'; + 'Instance[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isWeb=$isWeb, isVR=$isVR]'; Map toJson() { final json = {}; @@ -143,6 +154,11 @@ class Instance { } else { json[r'isTablet'] = null; } + if (this.isWeb != null) { + json[r'isWeb'] = this.isWeb; + } else { + json[r'isWeb'] = null; + } if (this.isVR != null) { json[r'isVR'] = this.isVR; } else { @@ -180,6 +196,7 @@ class Instance { isStatistic: mapValueOfType(json, r'isStatistic'), isMobile: mapValueOfType(json, r'isMobile'), isTablet: mapValueOfType(json, r'isTablet'), + isWeb: mapValueOfType(json, r'isWeb'), isVR: mapValueOfType(json, r'isVR'), ); } diff --git a/manager_api_new/lib/model/instance_dto.dart b/manager_api_new/lib/model/instance_dto.dart index 082b895..fdae691 100644 --- a/manager_api_new/lib/model/instance_dto.dart +++ b/manager_api_new/lib/model/instance_dto.dart @@ -21,6 +21,7 @@ class InstanceDTO { this.isStatistic, this.isMobile, this.isTablet, + this.isWeb, this.isVR, }); @@ -64,6 +65,14 @@ class InstanceDTO { /// 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? isWeb; + /// /// 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 @@ -84,6 +93,7 @@ class InstanceDTO { other.isStatistic == isStatistic && other.isMobile == isMobile && other.isTablet == isTablet && + other.isWeb == isWeb && other.isVR == isVR; @override @@ -97,11 +107,12 @@ class InstanceDTO { (isStatistic == null ? 0 : isStatistic!.hashCode) + (isMobile == null ? 0 : isMobile!.hashCode) + (isTablet == null ? 0 : isTablet!.hashCode) + + (isWeb == null ? 0 : isWeb!.hashCode) + (isVR == null ? 0 : isVR!.hashCode); @override String toString() => - 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isVR=$isVR]'; + 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation, pinCode=$pinCode, isPushNotification=$isPushNotification, isStatistic=$isStatistic, isMobile=$isMobile, isTablet=$isTablet, isWeb=$isWeb, isVR=$isVR]'; Map toJson() { final json = {}; @@ -145,6 +156,11 @@ class InstanceDTO { } else { json[r'isTablet'] = null; } + if (this.isWeb != null) { + json[r'isWeb'] = this.isWeb; + } else { + json[r'isWeb'] = null; + } if (this.isVR != null) { json[r'isVR'] = this.isVR; } else { @@ -182,6 +198,7 @@ class InstanceDTO { isStatistic: mapValueOfType(json, r'isStatistic'), isMobile: mapValueOfType(json, r'isMobile'), isTablet: mapValueOfType(json, r'isTablet'), + isWeb: mapValueOfType(json, r'isWeb'), isVR: mapValueOfType(json, r'isVR'), ); }