update service generation + section reorder (wip)
This commit is contained in:
parent
15c5430cc7
commit
700201ed00
@ -11,6 +11,7 @@ class ManagerAppContext with ChangeNotifier{
|
|||||||
String currentRoute;
|
String currentRoute;
|
||||||
ConfigurationDTO selectedConfiguration;
|
ConfigurationDTO selectedConfiguration;
|
||||||
SectionDTO selectedSection;
|
SectionDTO selectedSection;
|
||||||
|
bool isLoading = false;
|
||||||
|
|
||||||
ManagerAppContext({this.email, this.token, this.currentRoute});
|
ManagerAppContext({this.email, this.token, this.currentRoute});
|
||||||
|
|
||||||
|
|||||||
@ -26,10 +26,7 @@ class _GeoPointImageListState extends State<GeoPointImageList> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
imagesGeo = new List<ImageGeoPoint>.from(widget.images);
|
imagesGeo = new List<ImageGeoPoint>.from(widget.images);
|
||||||
|
|
||||||
//imagesGeo = widget.images;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _onReorder(int oldIndex, int newIndex) {
|
void _onReorder(int oldIndex, int newIndex) {
|
||||||
@ -41,12 +38,6 @@ class _GeoPointImageListState extends State<GeoPointImageList> {
|
|||||||
final ImageGeoPoint item = imagesGeo.removeAt(oldIndex);
|
final ImageGeoPoint item = imagesGeo.removeAt(oldIndex);
|
||||||
imagesGeo.insert(newIndex, item);
|
imagesGeo.insert(newIndex, item);
|
||||||
|
|
||||||
/*var i = 0;
|
|
||||||
menuDTO.sections.forEach((image) {
|
|
||||||
//image.order = i; // TODO
|
|
||||||
i++;
|
|
||||||
});*/
|
|
||||||
|
|
||||||
widget.onChanged(imagesGeo);
|
widget.onChanged(imagesGeo);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -89,7 +80,7 @@ class _GeoPointImageListState extends State<GeoPointImageList> {
|
|||||||
top: 10,
|
top: 10,
|
||||||
left: 10,
|
left: 10,
|
||||||
child: Text(
|
child: Text(
|
||||||
"Images test",
|
"Images",
|
||||||
style: TextStyle(fontSize: 15),
|
style: TextStyle(fontSize: 15),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -110,16 +101,6 @@ class _GeoPointImageListState extends State<GeoPointImageList> {
|
|||||||
true,
|
true,
|
||||||
context
|
context
|
||||||
);
|
);
|
||||||
/*showNewOrUpdateGeoPoint(
|
|
||||||
null,
|
|
||||||
(GeoPointDTO geoPoint) {
|
|
||||||
setState(() {
|
|
||||||
mapDTO.points.add(geoPoint);
|
|
||||||
widget.onChanged(jsonEncode(mapDTO).toString());
|
|
||||||
});
|
|
||||||
},
|
|
||||||
appContext,
|
|
||||||
context);*/
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: MediaQuery.of(context).size.width * 0.04,
|
height: MediaQuery.of(context).size.width * 0.04,
|
||||||
@ -5,7 +5,7 @@ import 'package:manager_app/Components/rounded_button.dart';
|
|||||||
import 'package:manager_app/Components/string_input_container.dart';
|
import 'package:manager_app/Components/string_input_container.dart';
|
||||||
import 'package:manager_app/Components/text_form_input_container.dart';
|
import 'package:manager_app/Components/text_form_input_container.dart';
|
||||||
import 'package:manager_app/Models/managerContext.dart';
|
import 'package:manager_app/Models/managerContext.dart';
|
||||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/image_reorderList.dart';
|
import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/geopoint_image_list.dart';
|
||||||
import 'package:manager_app/app_context.dart';
|
import 'package:manager_app/app_context.dart';
|
||||||
import 'package:manager_app/constants.dart';
|
import 'package:manager_app/constants.dart';
|
||||||
import 'package:managerapi/api.dart';
|
import 'package:managerapi/api.dart';
|
||||||
|
|||||||
@ -142,6 +142,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
onChanged: (ResourceDTO resource) {
|
onChanged: (ResourceDTO resource) {
|
||||||
print("received value in grant older");
|
print("received value in grant older");
|
||||||
sectionDTO.imageId = resource.id;
|
sectionDTO.imageId = resource.id;
|
||||||
|
sectionDTO.imageSource = resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -10,7 +10,9 @@ import 'package:manager_app/Components/multi_select_container.dart';
|
|||||||
import 'package:manager_app/Components/rounded_button.dart';
|
import 'package:manager_app/Components/rounded_button.dart';
|
||||||
import 'package:manager_app/Components/string_input_container.dart';
|
import 'package:manager_app/Components/string_input_container.dart';
|
||||||
import 'package:manager_app/Models/managerContext.dart';
|
import 'package:manager_app/Models/managerContext.dart';
|
||||||
|
import 'package:manager_app/Screens/Configurations/listView_card_section.dart';
|
||||||
import 'package:manager_app/Screens/Configurations/new_section_popup.dart';
|
import 'package:manager_app/Screens/Configurations/new_section_popup.dart';
|
||||||
|
import 'package:manager_app/Screens/Configurations/section_reorderList.dart';
|
||||||
import 'package:manager_app/app_context.dart';
|
import 'package:manager_app/app_context.dart';
|
||||||
import 'package:manager_app/client.dart';
|
import 'package:manager_app/client.dart';
|
||||||
import 'package:manager_app/constants.dart';
|
import 'package:manager_app/constants.dart';
|
||||||
@ -29,6 +31,7 @@ class ConfigurationDetailScreen extends StatefulWidget {
|
|||||||
class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
||||||
ConfigurationDTO configurationDTO;
|
ConfigurationDTO configurationDTO;
|
||||||
SectionDTO selectedSection;
|
SectionDTO selectedSection;
|
||||||
|
List<SectionDTO> sections;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -171,9 +174,8 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
|||||||
future: getSections(configurationDTO, appContext.getContext().clientAPI),
|
future: getSections(configurationDTO, appContext.getContext().clientAPI),
|
||||||
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
var tempOutput = new List<SectionDTO>.from(snapshot.data).where((section) => !section.isSubSection).toList();
|
sections = new List<SectionDTO>.from(snapshot.data).where((section) => !section.isSubSection).toList();
|
||||||
tempOutput.add(SectionDTO(id: null));
|
return bodyGrid(configurationDTO, size, appContext);
|
||||||
return bodyGrid(configurationDTO, tempOutput, size, appContext);
|
|
||||||
} else if (snapshot.connectionState == ConnectionState.none) {
|
} else if (snapshot.connectionState == ConnectionState.none) {
|
||||||
return Text("No data");
|
return Text("No data");
|
||||||
} else {
|
} else {
|
||||||
@ -199,57 +201,6 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getElement(dynamic element, Size size) {
|
|
||||||
if (element.id != null) {
|
|
||||||
return Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: AutoSizeText(
|
|
||||||
element.label,
|
|
||||||
style: new TextStyle(fontSize: 15),
|
|
||||||
maxLines: 2,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: Alignment.bottomCenter,
|
|
||||||
child: Icon(
|
|
||||||
getSectionIcon(element.type),
|
|
||||||
color: kPrimaryColor,
|
|
||||||
size: 25,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Icon(
|
|
||||||
Icons.add,
|
|
||||||
color: kTextLightColor,
|
|
||||||
size: 40.0,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: size.height*0.05,
|
|
||||||
child: AutoSizeText(
|
|
||||||
"Nouvelle section",
|
|
||||||
maxLines: 2,
|
|
||||||
style: new TextStyle(color: kWhite, fontWeight: FontWeight.w400),
|
|
||||||
minFontSize: 2,
|
|
||||||
maxFontSize: 40,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getButtons(ConfigurationDTO configurationDTO, AppContext appContext) {
|
getButtons(ConfigurationDTO configurationDTO, AppContext appContext) {
|
||||||
return Align(
|
return Align(
|
||||||
alignment: AlignmentDirectional.bottomCenter,
|
alignment: AlignmentDirectional.bottomCenter,
|
||||||
@ -300,43 +251,22 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget bodyGrid(ConfigurationDTO configurationDTO, data, Size size, AppContext appContext) {
|
Widget bodyGrid(ConfigurationDTO configurationDTO, Size size, AppContext appContext) {
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Container(
|
child: Container(
|
||||||
height: size.height *0.40,
|
height: size.height *0.40,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: GridView.builder(
|
child: SectionReorderList(
|
||||||
shrinkWrap: true,
|
sectionsIn: sections,
|
||||||
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 8),
|
configurationId: configurationDTO.id,
|
||||||
itemCount: data.length,
|
onChanged: (List<SectionDTO> sectionsOut) {
|
||||||
itemBuilder: (BuildContext context, int index) {
|
print("onChanged parent SectionReorderList");
|
||||||
return
|
sections = sectionsOut;
|
||||||
InkWell(
|
print(sections[0].label);
|
||||||
onTap: () {
|
print(sections[1].label);
|
||||||
if (data[index].id == null) {
|
},
|
||||||
showNewSection(configurationDTO.id, appContext, context, false, null);
|
),
|
||||||
} else {
|
|
||||||
setState(() {
|
|
||||||
ManagerAppContext managerAppContext = appContext.getContext();
|
|
||||||
managerAppContext.selectedSection = data[index];
|
|
||||||
selectedSection = data[index];
|
|
||||||
appContext.setContext(managerAppContext);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
decoration: boxDecoration(data[index]),
|
|
||||||
padding: const EdgeInsets.all(15),
|
|
||||||
margin: EdgeInsets.symmetric(vertical: 15, horizontal: 15),
|
|
||||||
child: Align(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: getElement(data[index], size)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -378,7 +308,11 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<List<SectionDTO>> getSections(ConfigurationDTO configurationDTO, Client client) async {
|
Future<List<SectionDTO>> getSections(ConfigurationDTO configurationDTO, Client client) async {
|
||||||
|
print("getSections");
|
||||||
|
print(configurationDTO.id);
|
||||||
List<SectionDTO> sections = await client.sectionApi.sectionGetFromConfiguration(configurationDTO.id);
|
List<SectionDTO> sections = await client.sectionApi.sectionGetFromConfiguration(configurationDTO.id);
|
||||||
|
print(sections);
|
||||||
|
sections.sort((a, b) => a.order.compareTo(b.order));
|
||||||
return sections;
|
return sections;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
122
lib/Screens/Configurations/listView_card_section.dart
Normal file
122
lib/Screens/Configurations/listView_card_section.dart
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:manager_app/Components/fetch_section_icon.dart';
|
||||||
|
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart';
|
||||||
|
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Menu/showEditSubSection.dart';
|
||||||
|
import 'package:manager_app/app_context.dart';
|
||||||
|
import 'package:manager_app/constants.dart';
|
||||||
|
import 'package:managerapi/api.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class ListViewCardSections extends StatefulWidget {
|
||||||
|
final int index;
|
||||||
|
final Key key;
|
||||||
|
final List<SectionDTO> sections;
|
||||||
|
final AppContext appContext;
|
||||||
|
final Function onSelect;
|
||||||
|
//final ValueChanged<List<ImageGeoPoint>> onChanged;
|
||||||
|
|
||||||
|
ListViewCardSections(
|
||||||
|
this.sections,
|
||||||
|
this.index,
|
||||||
|
this.key,
|
||||||
|
this.appContext,
|
||||||
|
this.onSelect
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ListViewCardSectionsState createState() => _ListViewCardSectionsState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ListViewCardSectionsState extends State<ListViewCardSections> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final appContext = Provider.of<AppContext>(context);
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
|
||||||
|
return Card(
|
||||||
|
margin: EdgeInsets.all(4),
|
||||||
|
child: Center(
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
widget.onSelect(widget.sections[widget.index]);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 250,
|
||||||
|
height: 200,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 30.0),
|
||||||
|
child: getElement(widget.index, widget.sections[widget.index], size, appContext)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getElement(int index, SectionDTO sectionDTO, Size size, AppContext appContext) {
|
||||||
|
return Container(
|
||||||
|
decoration: boxDecoration(sectionDTO, appContext),
|
||||||
|
padding: const EdgeInsets.all(15),
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 15, horizontal: 15),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: getDetails(sectionDTO, size),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getDetails(dynamic element, Size size) {
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: AutoSizeText(
|
||||||
|
element.label,
|
||||||
|
style: new TextStyle(fontSize: 15),
|
||||||
|
maxLines: 2,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: Alignment.bottomCenter,
|
||||||
|
child: Icon(
|
||||||
|
getSectionIcon(element.type),
|
||||||
|
color: kPrimaryColor,
|
||||||
|
size: 25,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boxDecoration(SectionDTO sectionDTO, appContext) {
|
||||||
|
return BoxDecoration(
|
||||||
|
color: kBackgroundColor,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
border: Border.all(width: 1.5, color: kSecond),
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
image: sectionDTO.imageSource != null ? new DecorationImage(
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.18), BlendMode.dstATop),
|
||||||
|
image: new NetworkImage(
|
||||||
|
sectionDTO.imageSource,
|
||||||
|
),
|
||||||
|
) : null,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: kSecond,
|
||||||
|
spreadRadius: 0.5,
|
||||||
|
blurRadius: 5,
|
||||||
|
offset: Offset(0, 1.5), // changes position of shadow
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -103,10 +103,10 @@ void create(SectionDTO sectionDTO, AppContext appContext, BuildContext context,
|
|||||||
|
|
||||||
if (!isSubSection) {
|
if (!isSubSection) {
|
||||||
ManagerAppContext managerAppContext = appContext.getContext();
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
if (managerAppContext.selectedConfiguration.sectionIds == null) {
|
/*if (managerAppContext.selectedConfiguration.sectionIds == null) {
|
||||||
managerAppContext.selectedConfiguration.sectionIds = <String>[];
|
managerAppContext.selectedConfiguration.sectionIds = <String>[];
|
||||||
}
|
}
|
||||||
managerAppContext.selectedConfiguration.sectionIds.add(newSection.id);
|
managerAppContext.selectedConfiguration.sectionIds.add(newSection.id);*/
|
||||||
appContext.setContext(managerAppContext);
|
appContext.setContext(managerAppContext);
|
||||||
showNotification(Colors.green, kWhite, 'La section a été créée avec succès !', context);
|
showNotification(Colors.green, kWhite, 'La section a été créée avec succès !', context);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
132
lib/Screens/Configurations/section_reorderList.dart
Normal file
132
lib/Screens/Configurations/section_reorderList.dart
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:manager_app/Models/managerContext.dart';
|
||||||
|
import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/listView_card_geoPoint_images.dart';
|
||||||
|
import 'package:manager_app/Screens/Configurations/listView_card_section.dart';
|
||||||
|
import 'package:manager_app/Screens/Configurations/new_section_popup.dart';
|
||||||
|
import 'package:manager_app/Screens/Resources/select_resource_modal.dart';
|
||||||
|
import 'package:manager_app/app_context.dart';
|
||||||
|
import 'package:manager_app/constants.dart';
|
||||||
|
import 'package:managerapi/api.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class SectionReorderList extends StatefulWidget {
|
||||||
|
final String configurationId;
|
||||||
|
final List<SectionDTO> sectionsIn;
|
||||||
|
final ValueChanged<List<SectionDTO>> onChanged;
|
||||||
|
const SectionReorderList({
|
||||||
|
Key key,
|
||||||
|
this.configurationId,
|
||||||
|
this.sectionsIn,
|
||||||
|
this.onChanged,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_SectionReorderListState createState() => _SectionReorderListState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SectionReorderListState extends State<SectionReorderList> {
|
||||||
|
List<SectionDTO> sections;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
sections = new List<SectionDTO>.from(widget.sectionsIn);
|
||||||
|
}
|
||||||
|
|
||||||
|
void _onReorder(int oldIndex, int newIndex) {
|
||||||
|
setState(
|
||||||
|
() {
|
||||||
|
if (newIndex > oldIndex) {
|
||||||
|
newIndex -= 1;
|
||||||
|
}
|
||||||
|
final SectionDTO item = sections.removeAt(oldIndex);
|
||||||
|
sections.insert(newIndex, item);
|
||||||
|
|
||||||
|
var i = 0;
|
||||||
|
sections.forEach((section) {
|
||||||
|
section.order = i;
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
|
||||||
|
widget.onChanged(sections);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final appContext = Provider.of<AppContext>(context);
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 10.0, right: 10.0, bottom: 10.0, top: 15.0),
|
||||||
|
child: ReorderableListView(
|
||||||
|
onReorder: _onReorder,
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 20.0),
|
||||||
|
children: List.generate(
|
||||||
|
sections.length,
|
||||||
|
(index) {
|
||||||
|
return ListViewCardSections(
|
||||||
|
sections,
|
||||||
|
index,
|
||||||
|
Key('$index'),
|
||||||
|
appContext,
|
||||||
|
(section) {
|
||||||
|
setState(() {
|
||||||
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
managerAppContext.selectedSection = section;
|
||||||
|
appContext.setContext(managerAppContext);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 10,
|
||||||
|
left: 10,
|
||||||
|
child: Text(
|
||||||
|
"Sections",
|
||||||
|
style: TextStyle(fontSize: 15),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: 10,
|
||||||
|
right: 10,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
showNewSection(widget.configurationId, appContext, context, false, null);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.width * 0.04,
|
||||||
|
width: MediaQuery.of(context).size.width * 0.04,
|
||||||
|
child: Icon(
|
||||||
|
Icons.add,
|
||||||
|
color: kTextLightColor,
|
||||||
|
size: 30.0,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.lightGreen,
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
borderRadius: BorderRadius.circular(20.0),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: kSecond,
|
||||||
|
spreadRadius: 0.5,
|
||||||
|
blurRadius: 5,
|
||||||
|
offset: Offset(0, 1.5), // changes position of shadow
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -17,6 +17,7 @@ void showNewResource(AppContext appContext, BuildContext context) {
|
|||||||
Size size = MediaQuery.of(context).size;
|
Size size = MediaQuery.of(context).size;
|
||||||
var fileName;
|
var fileName;
|
||||||
File fileToSend;
|
File fileToSend;
|
||||||
|
|
||||||
showDialog(
|
showDialog(
|
||||||
builder: (BuildContext context) => AlertDialog(
|
builder: (BuildContext context) => AlertDialog(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
@ -55,7 +56,7 @@ void showNewResource(AppContext appContext, BuildContext context) {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
Align(
|
||||||
|
|||||||
@ -10,7 +10,6 @@ Name | Type | Description | Notes
|
|||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**label** | **String** | | [optional]
|
**label** | **String** | | [optional]
|
||||||
**sectionIds** | **List<String>** | | [optional] [default to const []]
|
|
||||||
**primaryColor** | **String** | | [optional]
|
**primaryColor** | **String** | | [optional]
|
||||||
**secondaryColor** | **String** | | [optional]
|
**secondaryColor** | **String** | | [optional]
|
||||||
**languages** | **List<String>** | | [optional] [default to const []]
|
**languages** | **List<String>** | | [optional] [default to const []]
|
||||||
|
|||||||
@ -10,7 +10,6 @@ Name | Type | Description | Notes
|
|||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**imageResourceId** | **String** | | [optional]
|
**imageResourceId** | **String** | | [optional]
|
||||||
**imageSource** | **String** | | [optional]
|
**imageSource** | **String** | | [optional]
|
||||||
**order** | **int** | | [optional]
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
@ -13,12 +13,14 @@ Name | Type | Description | Notes
|
|||||||
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
**description** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
**description** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
**imageId** | **String** | | [optional]
|
**imageId** | **String** | | [optional]
|
||||||
|
**imageSource** | **String** | | [optional]
|
||||||
**configurationId** | **String** | | [optional]
|
**configurationId** | **String** | | [optional]
|
||||||
**isSubSection** | **bool** | | [optional]
|
**isSubSection** | **bool** | | [optional]
|
||||||
**parentId** | **String** | | [optional]
|
**parentId** | **String** | | [optional]
|
||||||
**type** | [**SectionType**](SectionType.md) | | [optional]
|
**type** | [**SectionType**](SectionType.md) | | [optional]
|
||||||
**data** | **String** | | [optional]
|
**data** | **String** | | [optional]
|
||||||
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
|
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**order** | **int** | | [optional]
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,6 @@ class ConfigurationDTO {
|
|||||||
ConfigurationDTO({
|
ConfigurationDTO({
|
||||||
this.id,
|
this.id,
|
||||||
this.label,
|
this.label,
|
||||||
this.sectionIds,
|
|
||||||
this.primaryColor,
|
this.primaryColor,
|
||||||
this.secondaryColor,
|
this.secondaryColor,
|
||||||
this.languages,
|
this.languages,
|
||||||
@ -25,8 +24,6 @@ class ConfigurationDTO {
|
|||||||
|
|
||||||
String label;
|
String label;
|
||||||
|
|
||||||
List<String> sectionIds;
|
|
||||||
|
|
||||||
String primaryColor;
|
String primaryColor;
|
||||||
|
|
||||||
String secondaryColor;
|
String secondaryColor;
|
||||||
@ -39,7 +36,6 @@ class ConfigurationDTO {
|
|||||||
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
|
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
|
||||||
other.id == id &&
|
other.id == id &&
|
||||||
other.label == label &&
|
other.label == label &&
|
||||||
other.sectionIds == sectionIds &&
|
|
||||||
other.primaryColor == primaryColor &&
|
other.primaryColor == primaryColor &&
|
||||||
other.secondaryColor == secondaryColor &&
|
other.secondaryColor == secondaryColor &&
|
||||||
other.languages == languages &&
|
other.languages == languages &&
|
||||||
@ -49,14 +45,13 @@ class ConfigurationDTO {
|
|||||||
int get hashCode =>
|
int get hashCode =>
|
||||||
(id == null ? 0 : id.hashCode) +
|
(id == null ? 0 : id.hashCode) +
|
||||||
(label == null ? 0 : label.hashCode) +
|
(label == null ? 0 : label.hashCode) +
|
||||||
(sectionIds == null ? 0 : sectionIds.hashCode) +
|
|
||||||
(primaryColor == null ? 0 : primaryColor.hashCode) +
|
(primaryColor == null ? 0 : primaryColor.hashCode) +
|
||||||
(secondaryColor == null ? 0 : secondaryColor.hashCode) +
|
(secondaryColor == null ? 0 : secondaryColor.hashCode) +
|
||||||
(languages == null ? 0 : languages.hashCode) +
|
(languages == null ? 0 : languages.hashCode) +
|
||||||
(dateCreation == null ? 0 : dateCreation.hashCode);
|
(dateCreation == null ? 0 : dateCreation.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'ConfigurationDTO[id=$id, label=$label, sectionIds=$sectionIds, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation]';
|
String toString() => 'ConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -66,9 +61,6 @@ class ConfigurationDTO {
|
|||||||
if (label != null) {
|
if (label != null) {
|
||||||
json[r'label'] = label;
|
json[r'label'] = label;
|
||||||
}
|
}
|
||||||
if (sectionIds != null) {
|
|
||||||
json[r'sectionIds'] = sectionIds;
|
|
||||||
}
|
|
||||||
if (primaryColor != null) {
|
if (primaryColor != null) {
|
||||||
json[r'primaryColor'] = primaryColor;
|
json[r'primaryColor'] = primaryColor;
|
||||||
}
|
}
|
||||||
@ -91,9 +83,6 @@ class ConfigurationDTO {
|
|||||||
: ConfigurationDTO(
|
: ConfigurationDTO(
|
||||||
id: json[r'id'],
|
id: json[r'id'],
|
||||||
label: json[r'label'],
|
label: json[r'label'],
|
||||||
sectionIds: json[r'sectionIds'] == null
|
|
||||||
? null
|
|
||||||
: (json[r'sectionIds'] as List).cast<String>(),
|
|
||||||
primaryColor: json[r'primaryColor'],
|
primaryColor: json[r'primaryColor'],
|
||||||
secondaryColor: json[r'secondaryColor'],
|
secondaryColor: json[r'secondaryColor'],
|
||||||
languages: json[r'languages'] == null
|
languages: json[r'languages'] == null
|
||||||
|
|||||||
@ -14,29 +14,24 @@ class ImageGeoPoint {
|
|||||||
ImageGeoPoint({
|
ImageGeoPoint({
|
||||||
this.imageResourceId,
|
this.imageResourceId,
|
||||||
this.imageSource,
|
this.imageSource,
|
||||||
this.order,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
String imageResourceId;
|
String imageResourceId;
|
||||||
|
|
||||||
String imageSource;
|
String imageSource;
|
||||||
|
|
||||||
int order;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) => identical(this, other) || other is ImageGeoPoint &&
|
bool operator ==(Object other) => identical(this, other) || other is ImageGeoPoint &&
|
||||||
other.imageResourceId == imageResourceId &&
|
other.imageResourceId == imageResourceId &&
|
||||||
other.imageSource == imageSource &&
|
other.imageSource == imageSource;
|
||||||
other.order == order;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode =>
|
||||||
(imageResourceId == null ? 0 : imageResourceId.hashCode) +
|
(imageResourceId == null ? 0 : imageResourceId.hashCode) +
|
||||||
(imageSource == null ? 0 : imageSource.hashCode) +
|
(imageSource == null ? 0 : imageSource.hashCode);
|
||||||
(order == null ? 0 : order.hashCode);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'ImageGeoPoint[imageResourceId=$imageResourceId, imageSource=$imageSource, order=$order]';
|
String toString() => 'ImageGeoPoint[imageResourceId=$imageResourceId, imageSource=$imageSource]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -46,9 +41,6 @@ class ImageGeoPoint {
|
|||||||
if (imageSource != null) {
|
if (imageSource != null) {
|
||||||
json[r'imageSource'] = imageSource;
|
json[r'imageSource'] = imageSource;
|
||||||
}
|
}
|
||||||
if (order != null) {
|
|
||||||
json[r'order'] = order;
|
|
||||||
}
|
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +51,6 @@ class ImageGeoPoint {
|
|||||||
: ImageGeoPoint(
|
: ImageGeoPoint(
|
||||||
imageResourceId: json[r'imageResourceId'],
|
imageResourceId: json[r'imageResourceId'],
|
||||||
imageSource: json[r'imageSource'],
|
imageSource: json[r'imageSource'],
|
||||||
order: json[r'order'],
|
|
||||||
);
|
);
|
||||||
|
|
||||||
static List<ImageGeoPoint> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
static List<ImageGeoPoint> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||||
|
|||||||
@ -17,12 +17,14 @@ class SectionDTO {
|
|||||||
this.title,
|
this.title,
|
||||||
this.description,
|
this.description,
|
||||||
this.imageId,
|
this.imageId,
|
||||||
|
this.imageSource,
|
||||||
this.configurationId,
|
this.configurationId,
|
||||||
this.isSubSection,
|
this.isSubSection,
|
||||||
this.parentId,
|
this.parentId,
|
||||||
this.type,
|
this.type,
|
||||||
this.data,
|
this.data,
|
||||||
this.dateCreation,
|
this.dateCreation,
|
||||||
|
this.order,
|
||||||
});
|
});
|
||||||
|
|
||||||
String id;
|
String id;
|
||||||
@ -35,6 +37,8 @@ class SectionDTO {
|
|||||||
|
|
||||||
String imageId;
|
String imageId;
|
||||||
|
|
||||||
|
String imageSource;
|
||||||
|
|
||||||
String configurationId;
|
String configurationId;
|
||||||
|
|
||||||
bool isSubSection;
|
bool isSubSection;
|
||||||
@ -47,6 +51,8 @@ class SectionDTO {
|
|||||||
|
|
||||||
DateTime dateCreation;
|
DateTime dateCreation;
|
||||||
|
|
||||||
|
int order;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) => identical(this, other) || other is SectionDTO &&
|
bool operator ==(Object other) => identical(this, other) || other is SectionDTO &&
|
||||||
other.id == id &&
|
other.id == id &&
|
||||||
@ -54,12 +60,14 @@ class SectionDTO {
|
|||||||
other.title == title &&
|
other.title == title &&
|
||||||
other.description == description &&
|
other.description == description &&
|
||||||
other.imageId == imageId &&
|
other.imageId == imageId &&
|
||||||
|
other.imageSource == imageSource &&
|
||||||
other.configurationId == configurationId &&
|
other.configurationId == configurationId &&
|
||||||
other.isSubSection == isSubSection &&
|
other.isSubSection == isSubSection &&
|
||||||
other.parentId == parentId &&
|
other.parentId == parentId &&
|
||||||
other.type == type &&
|
other.type == type &&
|
||||||
other.data == data &&
|
other.data == data &&
|
||||||
other.dateCreation == dateCreation;
|
other.dateCreation == dateCreation &&
|
||||||
|
other.order == order;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode =>
|
||||||
@ -68,15 +76,17 @@ class SectionDTO {
|
|||||||
(title == null ? 0 : title.hashCode) +
|
(title == null ? 0 : title.hashCode) +
|
||||||
(description == null ? 0 : description.hashCode) +
|
(description == null ? 0 : description.hashCode) +
|
||||||
(imageId == null ? 0 : imageId.hashCode) +
|
(imageId == null ? 0 : imageId.hashCode) +
|
||||||
|
(imageSource == null ? 0 : imageSource.hashCode) +
|
||||||
(configurationId == null ? 0 : configurationId.hashCode) +
|
(configurationId == null ? 0 : configurationId.hashCode) +
|
||||||
(isSubSection == null ? 0 : isSubSection.hashCode) +
|
(isSubSection == null ? 0 : isSubSection.hashCode) +
|
||||||
(parentId == null ? 0 : parentId.hashCode) +
|
(parentId == null ? 0 : parentId.hashCode) +
|
||||||
(type == null ? 0 : type.hashCode) +
|
(type == null ? 0 : type.hashCode) +
|
||||||
(data == null ? 0 : data.hashCode) +
|
(data == null ? 0 : data.hashCode) +
|
||||||
(dateCreation == null ? 0 : dateCreation.hashCode);
|
(dateCreation == null ? 0 : dateCreation.hashCode) +
|
||||||
|
(order == null ? 0 : order.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'SectionDTO[id=$id, label=$label, title=$title, description=$description, imageId=$imageId, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, data=$data, dateCreation=$dateCreation]';
|
String toString() => 'SectionDTO[id=$id, label=$label, title=$title, description=$description, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, data=$data, dateCreation=$dateCreation, order=$order]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -95,6 +105,9 @@ class SectionDTO {
|
|||||||
if (imageId != null) {
|
if (imageId != null) {
|
||||||
json[r'imageId'] = imageId;
|
json[r'imageId'] = imageId;
|
||||||
}
|
}
|
||||||
|
if (imageSource != null) {
|
||||||
|
json[r'imageSource'] = imageSource;
|
||||||
|
}
|
||||||
if (configurationId != null) {
|
if (configurationId != null) {
|
||||||
json[r'configurationId'] = configurationId;
|
json[r'configurationId'] = configurationId;
|
||||||
}
|
}
|
||||||
@ -113,6 +126,9 @@ class SectionDTO {
|
|||||||
if (dateCreation != null) {
|
if (dateCreation != null) {
|
||||||
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
|
json[r'dateCreation'] = dateCreation.toUtc().toIso8601String();
|
||||||
}
|
}
|
||||||
|
if (order != null) {
|
||||||
|
json[r'order'] = order;
|
||||||
|
}
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,6 +142,7 @@ class SectionDTO {
|
|||||||
title: TranslationDTO.listFromJson(json[r'title']),
|
title: TranslationDTO.listFromJson(json[r'title']),
|
||||||
description: TranslationDTO.listFromJson(json[r'description']),
|
description: TranslationDTO.listFromJson(json[r'description']),
|
||||||
imageId: json[r'imageId'],
|
imageId: json[r'imageId'],
|
||||||
|
imageSource: json[r'imageSource'],
|
||||||
configurationId: json[r'configurationId'],
|
configurationId: json[r'configurationId'],
|
||||||
isSubSection: json[r'isSubSection'],
|
isSubSection: json[r'isSubSection'],
|
||||||
parentId: json[r'parentId'],
|
parentId: json[r'parentId'],
|
||||||
@ -134,6 +151,7 @@ class SectionDTO {
|
|||||||
dateCreation: json[r'dateCreation'] == null
|
dateCreation: json[r'dateCreation'] == null
|
||||||
? null
|
? null
|
||||||
: DateTime.parse(json[r'dateCreation']),
|
: DateTime.parse(json[r'dateCreation']),
|
||||||
|
order: json[r'order'],
|
||||||
);
|
);
|
||||||
|
|
||||||
static List<SectionDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
static List<SectionDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||||
|
|||||||
@ -1193,11 +1193,6 @@ components:
|
|||||||
label:
|
label:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
sectionIds:
|
|
||||||
type: array
|
|
||||||
nullable: true
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
primaryColor:
|
primaryColor:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
@ -1320,6 +1315,9 @@ components:
|
|||||||
imageId:
|
imageId:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
|
imageSource:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
configurationId:
|
configurationId:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
@ -1336,6 +1334,9 @@ components:
|
|||||||
dateCreation:
|
dateCreation:
|
||||||
type: string
|
type: string
|
||||||
format: date-time
|
format: date-time
|
||||||
|
order:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
TranslationDTO:
|
TranslationDTO:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
@ -1434,9 +1435,6 @@ components:
|
|||||||
imageSource:
|
imageSource:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
order:
|
|
||||||
type: integer
|
|
||||||
format: int32
|
|
||||||
SliderDTO:
|
SliderDTO:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user