Update agenda resourceIds + update widget selection
This commit is contained in:
parent
2596a6cc84
commit
5fd5aa5c53
@ -1,5 +1,6 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:manager_app/Components/resource_input_container.dart';
|
||||
import 'package:manager_app/Components/rounded_button.dart';
|
||||
import 'package:manager_app/Components/text_form_input_container.dart';
|
||||
import 'package:manager_app/Models/managerContext.dart';
|
||||
@ -12,7 +13,7 @@ import 'package:provider/provider.dart';
|
||||
import 'audio_input_container.dart';
|
||||
import 'flag_decoration.dart';
|
||||
|
||||
showMultiStringInput (String label, String modalLabel, bool isTitle, List<TranslationDTO> values, List<TranslationDTO> newValues, Function onGetResult, int maxLines, bool isAudio, BuildContext context) { /*Function onSelect,*/
|
||||
showMultiStringInput (String label, String modalLabel, bool isTitle, List<TranslationDTO> values, List<TranslationDTO> newValues, Function onGetResult, int maxLines, List<ResourceType>? resourceTypes, BuildContext context) { /*Function onSelect,*/
|
||||
showDialog(
|
||||
builder: (BuildContext context) => AlertDialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
@ -26,7 +27,7 @@ showMultiStringInput (String label, String modalLabel, bool isTitle, List<Transl
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: getTranslations(context, Provider.of<AppContext>(context), label, isTitle, isAudio, newValues),
|
||||
children: getTranslations(context, Provider.of<AppContext>(context), label, isTitle, resourceTypes, newValues),
|
||||
),
|
||||
),
|
||||
),
|
||||
@ -93,7 +94,7 @@ showMultiStringInput (String label, String modalLabel, bool isTitle, List<Transl
|
||||
);
|
||||
}
|
||||
|
||||
getTranslations(BuildContext context, AppContext appContext, String label, bool isTitle, bool isAudio, List<TranslationDTO> newValues) {
|
||||
getTranslations(BuildContext context, AppContext appContext, String label, bool isTitle, List<ResourceType>? resourceTypes, List<TranslationDTO> newValues) {
|
||||
List<Widget> translations = <Widget>[];
|
||||
ManagerAppContext managerAppContext = appContext.getContext();
|
||||
for(var language in managerAppContext.selectedConfiguration!.languages!) {
|
||||
@ -121,7 +122,7 @@ getTranslations(BuildContext context, AppContext appContext, String label, bool
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
!isAudio ?
|
||||
resourceTypes == null ?
|
||||
TextFormInputContainer(
|
||||
label: label,
|
||||
color: kWhite,
|
||||
@ -136,14 +137,21 @@ getTranslations(BuildContext context, AppContext appContext, String label, bool
|
||||
height: 100,
|
||||
//color: Colors.blueAccent,
|
||||
child: Center(
|
||||
child: AudioInputContainer(
|
||||
child: ResourceInputContainer(
|
||||
label: "",
|
||||
initialValue: newValues.where((element) => element.language == language).first.value == null ? null : newValues.where((element) => element.language == language).first.value!,
|
||||
inResourceTypes: resourceTypes,
|
||||
onChanged: (ResourceDTO resource) {
|
||||
newValues.where((element) => element.language == language).first.value = resource.id;
|
||||
},
|
||||
)/*AudioInputContainer(
|
||||
//label: "Audio :",
|
||||
initialValue: newValues.where((element) => element.language == language).first.value,
|
||||
color: kPrimaryColor,
|
||||
onChanged: (ResourceDTO resource) {
|
||||
newValues.where((element) => element.language == language).first.value = resource.id;
|
||||
},
|
||||
),
|
||||
),*/
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@ -17,7 +17,7 @@ class MultiStringInputAndResourceContainer extends StatelessWidget {
|
||||
final Function onGetResult;
|
||||
final int maxLines;
|
||||
final bool isTitle;
|
||||
final bool isAudio;
|
||||
final List<ResourceType>? resourceTypes;
|
||||
final double fontSize;
|
||||
const MultiStringInputAndResourceContainer({
|
||||
Key? key,
|
||||
@ -28,7 +28,7 @@ class MultiStringInputAndResourceContainer extends StatelessWidget {
|
||||
required this.onGetResult,
|
||||
required this.maxLines,
|
||||
required this.isTitle,
|
||||
this.isAudio = false,
|
||||
this.resourceTypes = null,
|
||||
this.fontSize = 25,
|
||||
}) : super(key: key);
|
||||
|
||||
@ -69,7 +69,7 @@ class MultiStringInputAndResourceContainer extends StatelessWidget {
|
||||
}
|
||||
});
|
||||
|
||||
showMultiStringInputAndResourceHTML(label, modalLabel, isTitle, initials, newValues, onGetResult, maxLines, isAudio, context);
|
||||
showMultiStringInputAndResourceHTML(label, modalLabel, isTitle, initials, newValues, onGetResult, maxLines, resourceTypes, context);
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
@ -80,7 +80,7 @@ class MultiStringInputAndResourceContainer extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 15),
|
||||
child: Center(
|
||||
child: AutoSizeText(
|
||||
isAudio ? "Changer audios" : "Changer traductions",
|
||||
resourceTypes == null ? "Changer traductions" : "Changer ressources",
|
||||
style: TextStyle(color: kWhite),
|
||||
maxLines: 2,
|
||||
)
|
||||
|
||||
@ -18,7 +18,7 @@ class MultiStringInputContainer extends StatelessWidget {
|
||||
final Function onGetResult;
|
||||
final int maxLines;
|
||||
final bool isTitle;
|
||||
final bool isAudio;
|
||||
final List<ResourceType>? resourceTypes;
|
||||
final bool isHTML;
|
||||
final double fontSize;
|
||||
final bool isMandatory;
|
||||
@ -31,7 +31,7 @@ class MultiStringInputContainer extends StatelessWidget {
|
||||
required this.onGetResult,
|
||||
required this.maxLines,
|
||||
required this.isTitle,
|
||||
this.isAudio = false,
|
||||
this.resourceTypes = null,
|
||||
this.isHTML = false,
|
||||
this.fontSize = 25,
|
||||
this.isMandatory = true,
|
||||
@ -76,13 +76,14 @@ class MultiStringInputContainer extends StatelessWidget {
|
||||
});
|
||||
|
||||
if(isHTML) {
|
||||
showMultiStringInputHTML(label, modalLabel, isTitle, initials, newValues, onGetResult, maxLines, isAudio, context, isMandatory);
|
||||
showMultiStringInputHTML(label, modalLabel, isTitle, initials, newValues, onGetResult, maxLines, resourceTypes, context, isMandatory);
|
||||
} else {
|
||||
showMultiStringInput(label, modalLabel, isTitle, initials, newValues, onGetResult, maxLines, isAudio, context);
|
||||
showMultiStringInput(label, modalLabel, isTitle, initials, newValues, onGetResult, maxLines, resourceTypes, context);
|
||||
}
|
||||
|
||||
},
|
||||
child: Container(
|
||||
constraints: BoxConstraints(maxHeight: 100),
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
@ -91,7 +92,7 @@ class MultiStringInputContainer extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(left: 5, right: 5, top: 15, bottom: 15),
|
||||
child: Center(
|
||||
child: AutoSizeText(
|
||||
isAudio ? "Changer audios" : "Changer traductions",
|
||||
resourceTypes == null ? "Changer traductions" : "Changer ressources",
|
||||
style: TextStyle(color: kWhite),
|
||||
maxLines: 2,
|
||||
)
|
||||
|
||||
@ -7,7 +7,7 @@ import 'package:manager_app/constants.dart';
|
||||
import 'package:manager_api_new/api.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
|
||||
showMultiStringInputHTML (String label, String modalLabel, bool isTitle, List<TranslationDTO> values, List<TranslationDTO> newValues, Function onGetResult, int maxLines, bool isAudio, BuildContext context, bool isMandatory) {
|
||||
showMultiStringInputHTML (String label, String modalLabel, bool isTitle, List<TranslationDTO> values, List<TranslationDTO> newValues, Function onGetResult, int maxLines, List<ResourceType>? resourceTypes, BuildContext context, bool isMandatory) {
|
||||
showDialog(
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
@ -16,7 +16,7 @@ showMultiStringInputHTML (String label, String modalLabel, bool isTitle, List<Tr
|
||||
),
|
||||
title: Center(child: Text(modalLabel)),
|
||||
content: SingleChildScrollView(
|
||||
child: TranslationInputContainer(isTitle: isTitle, values: values, newValues: newValues, onGetResult: onGetResult, maxLines: maxLines, isAudio: isAudio)
|
||||
child: TranslationInputContainer(isTitle: isTitle, values: values, newValues: newValues, onGetResult: onGetResult, maxLines: maxLines, resourceTypes: resourceTypes)
|
||||
),
|
||||
actions: <Widget>[
|
||||
Row(
|
||||
@ -68,7 +68,7 @@ showMultiStringInputHTML (String label, String modalLabel, bool isTitle, List<Tr
|
||||
);
|
||||
}
|
||||
|
||||
showMultiStringInputAndResourceHTML (String label, String modalLabel, bool isTitle, List<TranslationAndResourceDTO> values, List<TranslationAndResourceDTO> newValues, Function onGetResult, int maxLines, bool isAudio, BuildContext context) {
|
||||
showMultiStringInputAndResourceHTML (String label, String modalLabel, bool isTitle, List<TranslationAndResourceDTO> values, List<TranslationAndResourceDTO> newValues, Function onGetResult, int maxLines, List<ResourceType>? resourceTypes, BuildContext context) {
|
||||
showDialog(
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
@ -77,7 +77,7 @@ showMultiStringInputAndResourceHTML (String label, String modalLabel, bool isTit
|
||||
),
|
||||
title: Center(child: Text(modalLabel)),
|
||||
content: SingleChildScrollView(
|
||||
child: TranslationInputAndResourceContainer(isTitle: isTitle, values: values, newValues: newValues, onGetResult: onGetResult, maxLines: maxLines, isAudio: isAudio)
|
||||
child: TranslationInputAndResourceContainer(isTitle: isTitle, values: values, newValues: newValues, onGetResult: onGetResult, maxLines: maxLines, resourceTypes: resourceTypes)
|
||||
),
|
||||
actions: <Widget>[
|
||||
Row(
|
||||
|
||||
@ -53,7 +53,7 @@ class _TranslationInputAndResourceContainerState extends State<TranslationInputA
|
||||
if (!_tabController!.indexIsChanging) {
|
||||
setState(() {
|
||||
currentLanguage!.value = widget.newValues[_tabController!.index].language;
|
||||
if(!widget.isAudio) {
|
||||
if(widget.resourceTypes == null) {
|
||||
print("insert try without ress");
|
||||
print(widget.newValues[_tabController!.index].value!);
|
||||
controllerQuill.clear();
|
||||
@ -111,14 +111,14 @@ class _TranslationInputAndResourceContainerState extends State<TranslationInputA
|
||||
tabs: widget.newValues.map((v) => Tab(icon: FlagDecoration(language: v.language!))).toList(), // text: v.language!.toUpperCase(),
|
||||
),
|
||||
),
|
||||
getTranslation(context, Provider.of<AppContext>(context), controllerQuill, customToolBarList, widget.isTitle, widget.isAudio, widget.newValues, currentLanguage!)
|
||||
getTranslation(context, Provider.of<AppContext>(context), controllerQuill, customToolBarList, widget.isTitle, widget.resourceTypes, widget.newValues, currentLanguage!)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
getTranslation(BuildContext context, AppContext appContext, QuillEditorController controllerQuill, List<ToolBarStyle> customToolBarList, bool isTitle, bool isAudio, List<TranslationAndResourceDTO> newValues, ValueNotifier<String?> currentLanguage) {
|
||||
getTranslation(BuildContext context, AppContext appContext, QuillEditorController controllerQuill, List<ToolBarStyle> customToolBarList, bool isTitle, List<ResourceType>? resourceTypes, List<TranslationAndResourceDTO> newValues, ValueNotifier<String?> currentLanguage) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(6.0),
|
||||
child: Padding(
|
||||
@ -127,7 +127,7 @@ class _TranslationInputAndResourceContainerState extends State<TranslationInputA
|
||||
width: MediaQuery.of(context).size.width *0.7,
|
||||
//color: Colors.blueAccent,
|
||||
height: widget.isTitle ? MediaQuery.of(context).size.height *0.32 : MediaQuery.of(context).size.height *0.37,
|
||||
child: !isAudio ?
|
||||
child: resourceTypes != null ?
|
||||
Column(
|
||||
children: [
|
||||
ToolBar(
|
||||
@ -208,6 +208,14 @@ class _TranslationInputAndResourceContainerState extends State<TranslationInputA
|
||||
child: ValueListenableBuilder<String?>(
|
||||
valueListenable: currentLanguage,
|
||||
builder: (context, value, _) {
|
||||
return ResourceInputContainer(
|
||||
label: "",
|
||||
initialValue: newValues.where((element) => element.language! == value).first.resourceId,
|
||||
inResourceTypes: widget.resourceTypes!,
|
||||
onChanged: (ResourceDTO resource) {
|
||||
newValues.where((element) => element.language! == value).first.value = resource.id;
|
||||
}
|
||||
);
|
||||
return AudioInputContainer(
|
||||
initialValue: newValues.where((element) => element.language! == value).first.value,
|
||||
color: kPrimaryColor,
|
||||
@ -232,7 +240,7 @@ class TranslationInputAndResourceContainer extends StatefulWidget {
|
||||
required this.newValues,
|
||||
required this.onGetResult,
|
||||
required this.maxLines,
|
||||
required this.isAudio,
|
||||
required this.resourceTypes,
|
||||
}) : super(key: key);
|
||||
|
||||
bool isTitle;
|
||||
@ -240,7 +248,7 @@ class TranslationInputAndResourceContainer extends StatefulWidget {
|
||||
List<TranslationAndResourceDTO> newValues;
|
||||
Function onGetResult;
|
||||
int maxLines;
|
||||
bool isAudio;
|
||||
List<ResourceType>? resourceTypes;
|
||||
|
||||
@override
|
||||
State<TranslationInputAndResourceContainer> createState() => _TranslationInputAndResourceContainerState();
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:manager_api_new/api.dart';
|
||||
import 'package:manager_app/Components/audio_input_container.dart';
|
||||
import 'package:manager_app/Components/resource_input_container.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
import 'package:manager_app/constants.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
@ -51,7 +52,7 @@ class _TranslationInputContainerState extends State<TranslationInputContainer> w
|
||||
if (!_tabController!.indexIsChanging) {
|
||||
setState(() {
|
||||
currentLanguage!.value = widget.newValues[_tabController!.index].language;
|
||||
if(!widget.isAudio) {
|
||||
if(widget.resourceTypes == null) {
|
||||
print("insert try without ress");
|
||||
print(widget.newValues[_tabController!.index].value!);
|
||||
controllerQuill.clear();
|
||||
@ -68,7 +69,7 @@ class _TranslationInputContainerState extends State<TranslationInputContainer> w
|
||||
_tabController!.dispose();
|
||||
}
|
||||
|
||||
getTranslation(BuildContext context, AppContext appContext, QuillEditorController controllerQuill, List<ToolBarStyle> customToolBarList, bool isTitle, bool isAudio, List<TranslationDTO> newValues, ValueNotifier<String?> currentLanguage) {
|
||||
getTranslation(BuildContext context, AppContext appContext, QuillEditorController controllerQuill, List<ToolBarStyle> customToolBarList, bool isTitle, List<ResourceType>? resourceTypes, List<TranslationDTO> newValues, ValueNotifier<String?> currentLanguage) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(6.0),
|
||||
child: Padding(
|
||||
@ -80,7 +81,7 @@ class _TranslationInputContainerState extends State<TranslationInputContainer> w
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
!isAudio ?
|
||||
resourceTypes == null ?
|
||||
Column(
|
||||
children: [
|
||||
ToolBar(
|
||||
@ -155,14 +156,22 @@ class _TranslationInputContainerState extends State<TranslationInputContainer> w
|
||||
child: ValueListenableBuilder<String?>(
|
||||
valueListenable: currentLanguage,
|
||||
builder: (context, value, _) {
|
||||
return AudioInputContainer(
|
||||
return ResourceInputContainer(
|
||||
label: "",
|
||||
initialValue: newValues.where((element) => element.language! == value).first.value,
|
||||
inResourceTypes: widget.resourceTypes!,
|
||||
onChanged: (ResourceDTO resource) {
|
||||
newValues.where((element) => element.language! == value).first.value = resource.id;
|
||||
}
|
||||
);
|
||||
/*return AudioInputContainer(
|
||||
//label: "Audio :",
|
||||
initialValue: newValues.where((element) => element.language! == value).first.value,
|
||||
color: kPrimaryColor,
|
||||
onChanged: (ResourceDTO resource) {
|
||||
newValues.where((element) => element.language! == value).first.value = resource.id;
|
||||
},
|
||||
);
|
||||
);*/
|
||||
},
|
||||
),
|
||||
),
|
||||
@ -213,7 +222,7 @@ class _TranslationInputContainerState extends State<TranslationInputContainer> w
|
||||
tabs: widget.newValues.map((v) => Tab(icon: FlagDecoration(language: v.language!))).toList(), // text: v.language!.toUpperCase(),
|
||||
),
|
||||
),
|
||||
getTranslation(context, Provider.of<AppContext>(context), controllerQuill, customToolBarList, widget.isTitle, widget.isAudio, widget.newValues, currentLanguage!)
|
||||
getTranslation(context, Provider.of<AppContext>(context), controllerQuill, customToolBarList, widget.isTitle, widget.resourceTypes, widget.newValues, currentLanguage!)
|
||||
/*TabContainer(
|
||||
radius: 0,
|
||||
tabs: values.map((v) => v.language!.toUpperCase()).toList(),
|
||||
@ -239,7 +248,7 @@ class TranslationInputContainer extends StatefulWidget {
|
||||
required this.newValues,
|
||||
required this.onGetResult,
|
||||
required this.maxLines,
|
||||
required this.isAudio,
|
||||
required this.resourceTypes,
|
||||
}) : super(key: key);
|
||||
|
||||
bool isTitle;
|
||||
@ -247,7 +256,7 @@ class TranslationInputContainer extends StatefulWidget {
|
||||
List<TranslationDTO> newValues;
|
||||
Function onGetResult;
|
||||
int maxLines;
|
||||
bool isAudio;
|
||||
List<ResourceType>? resourceTypes;
|
||||
|
||||
@override
|
||||
State<TranslationInputContainer> createState() => _TranslationInputContainerState();
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:manager_app/Components/multi_string_input_container.dart';
|
||||
import 'package:manager_app/Components/resource_input_container.dart';
|
||||
import 'package:manager_api_new/api.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:manager_app/constants.dart';
|
||||
|
||||
class AgendaConfig extends StatefulWidget {
|
||||
final String? color;
|
||||
final String? label;
|
||||
@ -33,7 +36,25 @@ class _AgendaConfigState extends State<AgendaConfig> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ResourceInputContainer(
|
||||
return MultiStringInputContainer(
|
||||
label: "Fichiers json :",
|
||||
resourceTypes: [ResourceType.Json, ResourceType.JsonUrl],
|
||||
modalLabel: "JSON",
|
||||
color: kPrimaryColor,
|
||||
initialValue: agendaDTO.resourceIds!,
|
||||
isTitle: false,
|
||||
onGetResult: (value) {
|
||||
setState(() {
|
||||
if (agendaDTO.resourceIds != value) {
|
||||
agendaDTO.resourceIds = value;
|
||||
//save(true, articleDTO, appContext);
|
||||
widget.onChanged(jsonEncode(agendaDTO).toString());
|
||||
}
|
||||
});
|
||||
},
|
||||
maxLines: 1,
|
||||
);
|
||||
/*return ResourceInputContainer(
|
||||
label: "Fichier JSON :",
|
||||
initialValue: agendaDTO.resourceId == null ? '': agendaDTO.resourceId,
|
||||
inResourceTypes: [ResourceType.Json, ResourceType.JsonUrl],
|
||||
@ -42,6 +63,6 @@ class _AgendaConfigState extends State<AgendaConfig> {
|
||||
agendaDTO.resourceId = resourceDTO.id;
|
||||
widget.onChanged(jsonEncode(agendaDTO).toString());
|
||||
}
|
||||
);
|
||||
);*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ class _ArticleConfigState extends State<ArticleConfig> {
|
||||
children: [
|
||||
MultiStringInputContainer(
|
||||
label: "Audio :",
|
||||
isAudio: true,
|
||||
resourceTypes: [ResourceType.Audio],
|
||||
modalLabel: "Audio",
|
||||
color: kPrimaryColor,
|
||||
initialValue: articleDTO != null ? articleDTO.audioIds! : [],
|
||||
|
||||
@ -50,7 +50,7 @@ Future<LevelDTO?> showNewOrUpdateScoreQuizz(LevelDTO? inputLevelDTO, AppContext
|
||||
print(levelDTO);
|
||||
return levelDTO;
|
||||
}
|
||||
}, 1, false, context);
|
||||
}, 1, [], context);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -127,7 +127,7 @@ class _QuizzResponseListState extends State<QuizzResponseList> {
|
||||
widget.onChanged(responsesMiddle);
|
||||
});
|
||||
}
|
||||
}, 1, false, context);
|
||||
}, 1, [], context);
|
||||
},
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.width * 0.04,
|
||||
@ -225,7 +225,7 @@ class _QuizzResponseListState extends State<QuizzResponseList> {
|
||||
widget.onChanged(responsesMiddle);
|
||||
}
|
||||
});
|
||||
}, 1, false, context);
|
||||
}, 1, [], context);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
|
||||
@ -364,7 +364,7 @@ class _QuizzConfigState extends State<QuizzConfig> {
|
||||
widget.onChanged(jsonEncode(quizzDTO).toString());
|
||||
});
|
||||
}
|
||||
}, 1, false, context);
|
||||
}, 1, [], context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2424,12 +2424,11 @@ components:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
properties:
|
||||
resourceId:
|
||||
type: string
|
||||
nullable: true
|
||||
resourceUrl:
|
||||
type: string
|
||||
resourceIds:
|
||||
type: array
|
||||
nullable: true
|
||||
items:
|
||||
$ref: '#/components/schemas/TranslationDTO'
|
||||
User:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
|
||||
@ -8,8 +8,7 @@ import 'package:manager_api_new/api.dart';
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**resourceId** | **String** | | [optional]
|
||||
**resourceUrl** | **String** | | [optional]
|
||||
**resourceIds** | [**List<TranslationDTO>**](TranslationDTO.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)
|
||||
|
||||
|
||||
@ -13,39 +13,29 @@ part of openapi.api;
|
||||
class AgendaDTO {
|
||||
/// Returns a new [AgendaDTO] instance.
|
||||
AgendaDTO({
|
||||
this.resourceId,
|
||||
this.resourceUrl,
|
||||
this.resourceIds = const [],
|
||||
});
|
||||
|
||||
String? resourceId;
|
||||
|
||||
String? resourceUrl;
|
||||
List<TranslationDTO>? resourceIds;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AgendaDTO &&
|
||||
other.resourceId == resourceId &&
|
||||
other.resourceUrl == resourceUrl;
|
||||
other.resourceIds == resourceIds;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(resourceId == null ? 0 : resourceId!.hashCode) +
|
||||
(resourceUrl == null ? 0 : resourceUrl!.hashCode);
|
||||
(resourceIds == null ? 0 : resourceIds!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AgendaDTO[resourceId=$resourceId, resourceUrl=$resourceUrl]';
|
||||
String toString() => 'AgendaDTO[resourceIds=$resourceIds]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (this.resourceId != null) {
|
||||
json[r'resourceId'] = this.resourceId;
|
||||
if (this.resourceIds != null) {
|
||||
json[r'resourceIds'] = this.resourceIds;
|
||||
} else {
|
||||
json[r'resourceId'] = null;
|
||||
}
|
||||
if (this.resourceUrl != null) {
|
||||
json[r'resourceUrl'] = this.resourceUrl;
|
||||
} else {
|
||||
json[r'resourceUrl'] = null;
|
||||
json[r'resourceIds'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
@ -69,8 +59,7 @@ class AgendaDTO {
|
||||
}());
|
||||
|
||||
return AgendaDTO(
|
||||
resourceId: mapValueOfType<String>(json, r'resourceId'),
|
||||
resourceUrl: mapValueOfType<String>(json, r'resourceUrl'),
|
||||
resourceIds: TranslationDTO.listFromJson(json[r'resourceIds']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user