Filtre de la liste nouvelle section (que article pour isMobile)
This commit is contained in:
parent
164f904f13
commit
7306373277
@ -118,7 +118,9 @@ class _MenuConfigState extends State<MenuConfig> {
|
|||||||
menuDTO.sections.add(newSubsection);
|
menuDTO.sections.add(newSubsection);
|
||||||
widget.onChanged(jsonEncode(menuDTO).toString());
|
widget.onChanged(jsonEncode(menuDTO).toString());
|
||||||
});
|
});
|
||||||
});
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: MediaQuery.of(context).size.width * 0.04,
|
height: MediaQuery.of(context).size.width * 0.04,
|
||||||
|
|||||||
@ -8,11 +8,12 @@ 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';
|
||||||
|
|
||||||
void showNewSection(String configurationId, AppContext appContext, BuildContext context, bool isSubSection, Function sendSubSection) {
|
void showNewSection(String configurationId, AppContext appContext, BuildContext contextBuild, bool isSubSection, Function sendSubSection, bool isMobile) {
|
||||||
SectionDTO sectionDTO = new SectionDTO();
|
SectionDTO sectionDTO = new SectionDTO();
|
||||||
sectionDTO.configurationId = configurationId;
|
sectionDTO.configurationId = configurationId;
|
||||||
sectionDTO.isSubSection = isSubSection;
|
sectionDTO.isSubSection = isSubSection;
|
||||||
sectionDTO.parentId = isSubSection ? appContext.getContext().selectedSection.id : null;
|
sectionDTO.parentId = isSubSection ? appContext.getContext().selectedSection.id : null;
|
||||||
|
Size size = MediaQuery.of(contextBuild).size;
|
||||||
|
|
||||||
showDialog(
|
showDialog(
|
||||||
builder: (BuildContext context) => AlertDialog(
|
builder: (BuildContext context) => AlertDialog(
|
||||||
@ -20,6 +21,9 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext
|
|||||||
borderRadius: BorderRadius.all(Radius.circular(20.0))
|
borderRadius: BorderRadius.all(Radius.circular(20.0))
|
||||||
),
|
),
|
||||||
content: SingleChildScrollView(
|
content: SingleChildScrollView(
|
||||||
|
child: SizedBox(
|
||||||
|
width: size.width*0.3,
|
||||||
|
height: size.height*0.3,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Text(isSubSection? "Nouvelle sous section": "Nouvelle section", style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)),
|
Text(isSubSection? "Nouvelle sous section": "Nouvelle section", style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)),
|
||||||
@ -34,9 +38,9 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext
|
|||||||
),
|
),
|
||||||
MultiSelectContainer(
|
MultiSelectContainer(
|
||||||
label: "Type :",
|
label: "Type :",
|
||||||
initialValue: ["Map"],
|
initialValue: isMobile ? ["Article"] : ["Map"],
|
||||||
isMultiple: false,
|
isMultiple: false,
|
||||||
values: isSubSection ? section_types.where((sectionType) => sectionType != "Menu").toList(): section_types, // Todo get menu by enum type
|
values: isMobile ? section_types.where((sectionType) => sectionType == "Article").toList(): isSubSection ? section_types.where((sectionType) => sectionType != "Menu").toList(): section_types, // Todo get menu by enum type
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
var tempOutput = new List<String>.from(value);
|
var tempOutput = new List<String>.from(value);
|
||||||
sectionDTO.type = SectionType.fromJson(tempOutput[0]);
|
sectionDTO.type = SectionType.fromJson(tempOutput[0]);
|
||||||
@ -47,6 +51,7 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
@ -88,7 +93,7 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
), context: context
|
), context: contextBuild
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -58,6 +58,9 @@ class _SectionReorderListState extends State<SectionReorderList> {
|
|||||||
final appContext = Provider.of<AppContext>(context);
|
final appContext = Provider.of<AppContext>(context);
|
||||||
Size size = MediaQuery.of(context).size;
|
Size size = MediaQuery.of(context).size;
|
||||||
|
|
||||||
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
ConfigurationDTO currentConfiguration = managerAppContext.selectedConfiguration;
|
||||||
|
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
@ -138,7 +141,7 @@ class _SectionReorderListState extends State<SectionReorderList> {
|
|||||||
right: 10,
|
right: 10,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
showNewSection(widget.configurationId, appContext, context, false, null);
|
showNewSection(widget.configurationId, appContext, context, false, null, currentConfiguration.isMobile);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: MediaQuery.of(context).size.width * 0.04,
|
height: MediaQuery.of(context).size.width * 0.04,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user