diff --git a/lib/Screens/Resources/resource_body_grid.dart b/lib/Screens/Resources/resource_body_grid.dart index 21bd932..c79aefa 100644 --- a/lib/Screens/Resources/resource_body_grid.dart +++ b/lib/Screens/Resources/resource_body_grid.dart @@ -88,31 +88,28 @@ class _ResourceBodyGridState extends State { ) ], ), - Container( - height: size.height *0.85, - child: SingleChildScrollView( - child: GridView.builder( - shrinkWrap: true, - gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 6), - itemCount: data.length, - itemBuilder: (BuildContext context, int index) { - return - InkWell( - onTap: () { - widget.onSelect(resourcesToShow[index]); - }, - child: Container( - decoration: boxDecoration(data[index], appContext), - padding: const EdgeInsets.all(15), - margin: EdgeInsets.symmetric(vertical: 15, horizontal: 15), - child: Align( - alignment: Alignment.center, - child: getElement(data[index], size, appContext) - ), + Expanded( + child: GridView.builder( + shrinkWrap: true, + gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 6), + itemCount: data.length, + itemBuilder: (BuildContext context, int index) { + return + InkWell( + onTap: () { + widget.onSelect(resourcesToShow[index]); + }, + child: Container( + decoration: boxDecoration(data[index], appContext), + padding: const EdgeInsets.all(15), + margin: EdgeInsets.symmetric(vertical: 15, horizontal: 15), + child: Align( + alignment: Alignment.center, + child: getElement(data[index], size, appContext) ), - ); - } - ), + ), + ); + } ), ), ], diff --git a/lib/Screens/Resources/resources_screen.dart b/lib/Screens/Resources/resources_screen.dart index 3f863bd..cff57af 100644 --- a/lib/Screens/Resources/resources_screen.dart +++ b/lib/Screens/Resources/resources_screen.dart @@ -31,39 +31,37 @@ class _ResourcesScreenState extends State { final appContext = Provider.of(context); Size size = MediaQuery.of(context).size; - return Container( - child: FutureBuilder( - future: getResources(widget.onGetResult, widget.isImage, appContext), - builder: (context, AsyncSnapshot snapshot) { - if (snapshot.connectionState == ConnectionState.done) { - var tempOutput = new List.from(snapshot.data); - // tempOutput.add(ResourceDTO(id: null)); - return ResourceBodyGrid(resources: tempOutput, onSelect: (value) { - print("result parent"); - print(value); - if (widget.onGetResult == null) { - // Main screen - if (value.id == null) { - showNewResource(appContext, context); - } else { - showResource(value, appContext, context, size); - } + return FutureBuilder( + future: getResources(widget.onGetResult, widget.isImage, appContext), + builder: (context, AsyncSnapshot snapshot) { + if (snapshot.connectionState == ConnectionState.done) { + var tempOutput = new List.from(snapshot.data); + // tempOutput.add(ResourceDTO(id: null)); + return ResourceBodyGrid(resources: tempOutput, onSelect: (value) { + print("result parent"); + print(value); + if (widget.onGetResult == null) { + // Main screen + if (value.id == null) { + showNewResource(appContext, context); } else { - if (value.id == null) { - showNewResource(appContext, context); - } else { - // Result for select modal - widget.onGetResult(value); - } + showResource(value, appContext, context, size); } - },);//bodyGrid(tempOutput, size, appContext); - } else if (snapshot.connectionState == ConnectionState.none) { - return Text("No data"); - } else { - return Center(child: Container(height: size.height * 0.2, child: Text('LOADING TODO FRAISE'))); - } + } else { + if (value.id == null) { + showNewResource(appContext, context); + } else { + // Result for select modal + widget.onGetResult(value); + } + } + },);//bodyGrid(tempOutput, size, appContext); + } else if (snapshot.connectionState == ConnectionState.none) { + return Text("No data"); + } else { + return Center(child: Container(height: size.height * 0.2, child: Text('LOADING TODO FRAISE'))); } - ), + } ); } }