Adapt layout for smaller screen

This commit is contained in:
Fransolet Thomas 2023-01-22 20:15:22 +01:00
parent df07723ebd
commit 25f752539d
5 changed files with 138 additions and 140 deletions

View File

@ -1,12 +1,12 @@
# This is a generated file; do not edit or check into version control. # This is a generated file; do not edit or check into version control.
audio_session=/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/audio_session-0.1.13/ audio_session=C:\\Users\\thoma\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dartlang.org\\audio_session-0.1.13\\
just_audio=/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/just_audio-0.9.31/ just_audio=C:\\Users\\thoma\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dartlang.org\\just_audio-0.9.31\\
just_audio_web=/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/just_audio_web-0.4.7/ just_audio_web=C:\\Users\\thoma\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dartlang.org\\just_audio_web-0.4.7\\
path_provider=/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.11/ path_provider=C:\\Users\\thoma\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dartlang.org\\path_provider-2.0.11\\
path_provider_android=/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.22/ path_provider_android=C:\\Users\\thoma\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dartlang.org\\path_provider_android-2.0.22\\
path_provider_ios=/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_ios-2.0.11/ path_provider_ios=C:\\Users\\thoma\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dartlang.org\\path_provider_ios-2.0.11\\
path_provider_linux=/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/ path_provider_linux=C:\\Users\\thoma\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dartlang.org\\path_provider_linux-2.1.7\\
path_provider_macos=/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.7/ path_provider_macos=C:\\Users\\thoma\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dartlang.org\\path_provider_macos-2.0.7\\
path_provider_windows=/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/ path_provider_windows=C:\\Users\\thoma\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dartlang.org\\path_provider_windows-2.1.3\\
qr_code_scanner=/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-1.0.1/ qr_code_scanner=C:\\Users\\thoma\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dartlang.org\\qr_code_scanner-1.0.1\\
sqflite=/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.2.3/ sqflite=C:\\Users\\thoma\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dartlang.org\\sqflite-2.2.3\\

View File

@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"audio_session","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/audio_session-0.1.13/","native_build":true,"dependencies":[]},{"name":"just_audio","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/just_audio-0.9.31/","native_build":true,"dependencies":["audio_session"]},{"name":"path_provider_ios","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_ios-2.0.11/","native_build":true,"dependencies":[]},{"name":"qr_code_scanner","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-1.0.1/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.2.3/","native_build":true,"dependencies":[]}],"android":[{"name":"audio_session","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/audio_session-0.1.13/","native_build":true,"dependencies":[]},{"name":"just_audio","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/just_audio-0.9.31/","native_build":true,"dependencies":["audio_session"]},{"name":"path_provider_android","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.22/","native_build":true,"dependencies":[]},{"name":"qr_code_scanner","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/qr_code_scanner-1.0.1/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.2.3/","native_build":true,"dependencies":[]}],"macos":[{"name":"audio_session","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/audio_session-0.1.13/","native_build":true,"dependencies":[]},{"name":"just_audio","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/just_audio-0.9.31/","native_build":true,"dependencies":["audio_session"]},{"name":"path_provider_macos","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.7/","native_build":true,"dependencies":[]},{"name":"sqflite","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-2.2.3/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.7/","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/","native_build":false,"dependencies":[]}],"web":[{"name":"audio_session","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/audio_session-0.1.13/","dependencies":[]},{"name":"just_audio_web","path":"/Users/kiwixdevteam/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/just_audio_web-0.4.7/","dependencies":[]}]},"dependencyGraph":[{"name":"audio_session","dependencies":[]},{"name":"just_audio","dependencies":["just_audio_web","audio_session","path_provider"]},{"name":"just_audio_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_ios","path_provider_linux","path_provider_macos","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_ios","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"qr_code_scanner","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2023-01-22 17:43:39.812446","version":"3.3.9"} {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"audio_session","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\audio_session-0.1.13\\\\","native_build":true,"dependencies":[]},{"name":"just_audio","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\just_audio-0.9.31\\\\","native_build":true,"dependencies":["audio_session"]},{"name":"path_provider_ios","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_ios-2.0.11\\\\","native_build":true,"dependencies":[]},{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.2.3\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"audio_session","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\audio_session-0.1.13\\\\","native_build":true,"dependencies":[]},{"name":"just_audio","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\just_audio-0.9.31\\\\","native_build":true,"dependencies":["audio_session"]},{"name":"path_provider_android","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_android-2.0.22\\\\","native_build":true,"dependencies":[]},{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.2.3\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"audio_session","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\audio_session-0.1.13\\\\","native_build":true,"dependencies":[]},{"name":"just_audio","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\just_audio-0.9.31\\\\","native_build":true,"dependencies":["audio_session"]},{"name":"path_provider_macos","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.7\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.2.3\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.1.7\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.1.3\\\\","native_build":false,"dependencies":[]}],"web":[{"name":"audio_session","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\audio_session-0.1.13\\\\","dependencies":[]},{"name":"just_audio_web","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\just_audio_web-0.4.7\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"audio_session","dependencies":[]},{"name":"just_audio","dependencies":["just_audio_web","audio_session","path_provider"]},{"name":"just_audio_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_ios","path_provider_linux","path_provider_macos","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_ios","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"qr_code_scanner","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2023-01-22 20:14:50.014974","version":"3.3.10"}

View File

@ -18,18 +18,19 @@ void showImagePopup(ImageDTO imageDTO, ResourceModel resourceModel, AppContext a
content: SingleChildScrollView( content: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
Padding( if(TranslationHelper.get(imageDTO.title, appContext).isNotEmpty)
padding: const EdgeInsets.only(top: 5.0, left:8.0, right: 8.0), Padding(
child: Text( padding: const EdgeInsets.only(top: 8.0, left:8.0, right: 8.0),
TranslationHelper.get(imageDTO.title, appContext), child: Text(
style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w400)), TranslationHelper.get(imageDTO.title, appContext),
), style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w400)),
),
SizedBox( SizedBox(
height: size.height *0.3, height: size.height * 0.5,
width: size.width * 0.9, width: size.width * 0.95,
child: Center( child: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.only(left:8.0, right: 8.0), padding: const EdgeInsets.only(left:8.0, right: 8.0, bottom: 8.0, top: 8.0),
child: PhotoView( child: PhotoView(
imageProvider: (appContext.getContext() as VisitAppContext).configuration!.isOffline! ? imageProvider: (appContext.getContext() as VisitAppContext).configuration!.isOffline! ?
Image.memory(base64Decode(resourceModel.data!)).image : Image.memory(base64Decode(resourceModel.data!)).image :

View File

@ -42,129 +42,124 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
final appContext = Provider.of<AppContext>(context); final appContext = Provider.of<AppContext>(context);
VisitAppContext visitAppContext = appContext.getContext() as VisitAppContext; VisitAppContext visitAppContext = appContext.getContext() as VisitAppContext;
Size size = MediaQuery.of(context).size; Size size = MediaQuery.of(context).size;
return Stack( return Column(
children: [ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.center, Stack(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
if(resourcesInWidget.isNotEmpty) Column(
CarouselSlider( crossAxisAlignment: CrossAxisAlignment.center,
carouselController: sliderController, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
options: CarouselOptions( children: [
onPageChanged: (int index, CarouselPageChangedReason reason) { if(resourcesInWidget.isNotEmpty)
setState(() { CarouselSlider(
print("SET STATE"); carouselController: sliderController,
currentIndex = index + 1; options: CarouselOptions(
}); onPageChanged: (int index, CarouselPageChangedReason reason) {
}, setState(() {
// height: widget.height * 0.95, print("SET STATE");
enlargeCenterPage: true, currentIndex = index + 1;
reverse: false, });
), },
items: resourcesInWidget.map<Widget>((i) { height: widget.height * 0.86,
return Builder( enlargeCenterPage: true,
builder: (BuildContext context) { reverse: false,
//print(widget.imagesDTO[currentIndex-1]); ),
return InkWell( items: resourcesInWidget.map<Widget>((i) {
onTap: () { return Builder(
showImagePopup(widget.imagesDTO[currentIndex-1]!, i!, appContext, context, size); builder: (BuildContext context) {
}, //print(widget.imagesDTO[currentIndex-1]);
child: Container( return Padding(
//color: Colors.red, padding: const EdgeInsets.only(top: 5.0),
//height: widget.height * 1, child: InkWell(
//width: size.width * 0.95, onTap: () {
child: ClipRRect( showImagePopup(widget.imagesDTO[currentIndex-1]!, i!, appContext, context, size);
borderRadius: BorderRadius.circular(15.0), },
child: visitAppContext.configuration!.isOffline! ? child: ClipRRect(
Image.memory(base64Decode(i!.data!)) : borderRadius: BorderRadius.circular(15.0),
Image.network( child: visitAppContext.configuration!.isOffline! ?
i!.source!, Image.memory(base64Decode(i!.data!)) :
loadingBuilder: (BuildContext context, Widget child, Image.network(
ImageChunkEvent? loadingProgress) { i!.source!,
if (loadingProgress == null) { loadingBuilder: (BuildContext context, Widget child,
return child; ImageChunkEvent? loadingProgress) {
} if (loadingProgress == null) {
return Center( return child;
child: CircularProgressIndicator( }
color: kBlue1, return Center(
value: loadingProgress.expectedTotalBytes != null child: CircularProgressIndicator(
? loadingProgress.cumulativeBytesLoaded / color: kBlue1,
loadingProgress.expectedTotalBytes! value: loadingProgress.expectedTotalBytes != null
: null, ? loadingProgress.cumulativeBytesLoaded /
loadingProgress.expectedTotalBytes!
: null,
),
);
},
) /*PhotoView(
imageProvider: Image.memory(base64Decode(i!.data!)).image,
minScale: PhotoViewComputedScale.contained * 0.8,
maxScale: PhotoViewComputedScale.contained * 3.0,
backgroundDecoration: BoxDecoration(
color: Colors.transparent,
/*shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(15.0),*/
), ),
); )*/,
},
) /*PhotoView(
imageProvider: Image.memory(base64Decode(i!.data!)).image,
minScale: PhotoViewComputedScale.contained * 0.8,
maxScale: PhotoViewComputedScale.contained * 3.0,
backgroundDecoration: BoxDecoration(
color: Colors.transparent,
/*shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(15.0),*/
), ),
)*/, ),
), );
), },
); );
}, }).toList(),
); ),
}).toList(), ],
), ),
], if(resourcesInWidget.length > 1)
), Positioned(
if(resourcesInWidget.length > 1) top: widget.height * 0.4,
Positioned( right: 0,
top: widget.height * 0.45,
right: 0,
child: InkWell(
onTap: () {
sliderController!.nextPage(duration: const Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
},
child: const Icon(
Icons.chevron_right,
size: 45,
color: kBlue2,
),
)
),
if(resourcesInWidget.length > 1)
Positioned(
top: widget.height * 0.45,
left: 0,
child: InkWell(
onTap: () {
if (resourcesInWidget.isNotEmpty) {
sliderController!.previousPage(duration: const Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
}
},
child: const Icon(
Icons.chevron_left,
size: 45,
color: kBlue2,
),
)
),
if(resourcesInWidget.isNotEmpty)
Padding(
padding: const EdgeInsets.only(bottom: 0),
child: Align(
alignment: Alignment.bottomCenter,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
sliderController!.nextPage(duration: const Duration(milliseconds: 500), curve: Curves.fastOutSlowIn); sliderController!.nextPage(duration: const Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
}, },
child: Text( child: const Icon(
currentIndex.toString()+'/'+resourcesInWidget.length.toString(), Icons.chevron_right,
style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w500, color: kBlue2), size: 45,
color: kBlue2,
), ),
) )
), ),
), if(resourcesInWidget.length > 1)
if(resourcesInWidget.isEmpty) Positioned(
const Center(child: Text("Aucune image à afficher", style: TextStyle(fontSize: kNoneInfoOrIncorrect),)) top: widget.height * 0.4,
] left: 0,
child: InkWell(
onTap: () {
if (resourcesInWidget.isNotEmpty) {
sliderController!.previousPage(duration: const Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
}
},
child: const Icon(
Icons.chevron_left,
size: 45,
color: kBlue2,
),
)
),
if(resourcesInWidget.isEmpty)
const Center(child: Text("Aucune image à afficher", style: TextStyle(fontSize: kNoneInfoOrIncorrect)))
]
),
if(resourcesInWidget.isNotEmpty)
Align(
alignment: Alignment.bottomCenter,
child: Text(
currentIndex.toString()+'/'+resourcesInWidget.length.toString(),
style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w500, color: kBlue2),
)
),
],
); );
} }
} }

View File

@ -135,13 +135,15 @@ class _ConfigurationsListState extends State<ConfigurationsList> {
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Container( child: Container(
width: size.width*0.45, width: size.width*0.45,
child: Padding( child: Center(
padding: const EdgeInsets.only(top: 45, left: 10), child: Padding(
child: AutoSizeText( padding: const EdgeInsets.only(left: 10),
TranslationHelper.get(configurations[index].title, appContext), child: AutoSizeText(
style: const TextStyle(fontSize: kMenuTitleDetailSize), TranslationHelper.get(configurations[index].title, appContext),
maxFontSize: 20, style: const TextStyle(fontSize: kMenuTitleDetailSize),
maxLines: 2, maxFontSize: 18,
maxLines: 2,
),
), ),
), ),
), ),