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);
|
||||
widget.onChanged(jsonEncode(menuDTO).toString());
|
||||
});
|
||||
});
|
||||
},
|
||||
false
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
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: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.configurationId = configurationId;
|
||||
sectionDTO.isSubSection = isSubSection;
|
||||
sectionDTO.parentId = isSubSection ? appContext.getContext().selectedSection.id : null;
|
||||
Size size = MediaQuery.of(contextBuild).size;
|
||||
|
||||
showDialog(
|
||||
builder: (BuildContext context) => AlertDialog(
|
||||
@ -20,6 +21,9 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.0))
|
||||
),
|
||||
content: SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
width: size.width*0.3,
|
||||
height: size.height*0.3,
|
||||
child: Column(
|
||||
children: [
|
||||
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(
|
||||
label: "Type :",
|
||||
initialValue: ["Map"],
|
||||
initialValue: isMobile ? ["Article"] : ["Map"],
|
||||
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) {
|
||||
var tempOutput = new List<String>.from(value);
|
||||
sectionDTO.type = SectionType.fromJson(tempOutput[0]);
|
||||
@ -47,6 +51,7 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
actions: <Widget>[
|
||||
Row(
|
||||
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);
|
||||
Size size = MediaQuery.of(context).size;
|
||||
|
||||
ManagerAppContext managerAppContext = appContext.getContext();
|
||||
ConfigurationDTO currentConfiguration = managerAppContext.selectedConfiguration;
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
Padding(
|
||||
@ -138,7 +141,7 @@ class _SectionReorderListState extends State<SectionReorderList> {
|
||||
right: 10,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showNewSection(widget.configurationId, appContext, context, false, null);
|
||||
showNewSection(widget.configurationId, appContext, context, false, null, currentConfiguration.isMobile);
|
||||
},
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.width * 0.04,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user