From 6429ea0ad8be395d9910fa283f8c6b2f5d96fc99 Mon Sep 17 00:00:00 2001 From: Fransolet Thomas Date: Fri, 31 Mar 2023 18:23:11 +0200 Subject: [PATCH] Add isMobile for number sections --- lib/Screens/Configurations/listView_card_section.dart | 10 ++++++---- lib/Screens/Configurations/section_reorderList.dart | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Screens/Configurations/listView_card_section.dart b/lib/Screens/Configurations/listView_card_section.dart index 777898c..50a3e8a 100644 --- a/lib/Screens/Configurations/listView_card_section.dart +++ b/lib/Screens/Configurations/listView_card_section.dart @@ -10,6 +10,7 @@ class ListViewCardSections extends StatefulWidget { final int index; final Key key; final List sections; + final bool isMobile; final AppContext appContext; final Function onSelect; //final ValueChanged> onChanged; @@ -18,6 +19,7 @@ class ListViewCardSections extends StatefulWidget { this.sections, this.index, this.key, + this.isMobile, this.appContext, this.onSelect ); @@ -39,20 +41,20 @@ class _ListViewCardSectionsState extends State { }, child: Center( //padding: const EdgeInsets.only(right: 30.0), - child: getElement(widget.index, widget.sections[widget.index], size, appContext) + child: getElement(widget.index, widget.sections[widget.index], size, widget.isMobile, appContext) ), ), ); } - getElement(int index, SectionDTO sectionDTO, Size size, AppContext appContext) { + getElement(int index, SectionDTO sectionDTO, Size size, bool isMobile, AppContext appContext) { return Container( width: 150, height: 150, decoration: boxDecoration(sectionDTO, appContext), child: Stack( children: [ - Align( + isMobile ? Align( alignment: Alignment.bottomLeft, child: Container( padding: const EdgeInsets.symmetric( @@ -71,7 +73,7 @@ class _ListViewCardSectionsState extends State { style: const TextStyle(color: Colors.white) ), ), - ), + ): SizedBox(), Padding( padding: const EdgeInsets.all(5.0), child: Align( diff --git a/lib/Screens/Configurations/section_reorderList.dart b/lib/Screens/Configurations/section_reorderList.dart index 25099b8..e74901d 100644 --- a/lib/Screens/Configurations/section_reorderList.dart +++ b/lib/Screens/Configurations/section_reorderList.dart @@ -79,6 +79,7 @@ class _SectionReorderListState extends State { sections, index, Key('$index'), + currentConfiguration.isMobile, appContext, (section) { setState(() {