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: [
if(TranslationHelper.get(imageDTO.title, appContext).isNotEmpty)
Padding( Padding(
padding: const EdgeInsets.only(top: 5.0, left:8.0, right: 8.0), padding: const EdgeInsets.only(top: 8.0, left:8.0, right: 8.0),
child: Text( child: Text(
TranslationHelper.get(imageDTO.title, appContext), TranslationHelper.get(imageDTO.title, appContext),
style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w400)), 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,7 +42,10 @@ 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(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Stack(
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -58,7 +61,7 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
currentIndex = index + 1; currentIndex = index + 1;
}); });
}, },
// height: widget.height * 0.95, height: widget.height * 0.86,
enlargeCenterPage: true, enlargeCenterPage: true,
reverse: false, reverse: false,
), ),
@ -66,14 +69,12 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
return Builder( return Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
//print(widget.imagesDTO[currentIndex-1]); //print(widget.imagesDTO[currentIndex-1]);
return InkWell( return Padding(
padding: const EdgeInsets.only(top: 5.0),
child: InkWell(
onTap: () { onTap: () {
showImagePopup(widget.imagesDTO[currentIndex-1]!, i!, appContext, context, size); showImagePopup(widget.imagesDTO[currentIndex-1]!, i!, appContext, context, size);
}, },
child: Container(
//color: Colors.red,
//height: widget.height * 1,
//width: size.width * 0.95,
child: ClipRRect( child: ClipRRect(
borderRadius: BorderRadius.circular(15.0), borderRadius: BorderRadius.circular(15.0),
child: visitAppContext.configuration!.isOffline! ? child: visitAppContext.configuration!.isOffline! ?
@ -116,7 +117,7 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
), ),
if(resourcesInWidget.length > 1) if(resourcesInWidget.length > 1)
Positioned( Positioned(
top: widget.height * 0.45, top: widget.height * 0.4,
right: 0, right: 0,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
@ -131,7 +132,7 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
), ),
if(resourcesInWidget.length > 1) if(resourcesInWidget.length > 1)
Positioned( Positioned(
top: widget.height * 0.45, top: widget.height * 0.4,
left: 0, left: 0,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
@ -146,25 +147,19 @@ class _SliderImagesWidget extends State<SliderImagesWidget> {
), ),
) )
), ),
if(resourcesInWidget.isEmpty)
const Center(child: Text("Aucune image à afficher", style: TextStyle(fontSize: kNoneInfoOrIncorrect)))
]
),
if(resourcesInWidget.isNotEmpty) if(resourcesInWidget.isNotEmpty)
Padding( Align(
padding: const EdgeInsets.only(bottom: 0),
child: Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: InkWell(
onTap: () {
sliderController!.nextPage(duration: const Duration(milliseconds: 500), curve: Curves.fastOutSlowIn);
},
child: Text( child: Text(
currentIndex.toString()+'/'+resourcesInWidget.length.toString(), currentIndex.toString()+'/'+resourcesInWidget.length.toString(),
style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w500, color: kBlue2), style: const TextStyle(fontSize: kArticleContentSize, fontWeight: FontWeight.w500, color: kBlue2),
),
) )
), ),
), ],
if(resourcesInWidget.isEmpty)
const Center(child: Text("Aucune image à afficher", style: TextStyle(fontSize: kNoneInfoOrIncorrect),))
]
); );
} }
} }

View File

@ -135,17 +135,19 @@ 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: Center(
child: Padding( child: Padding(
padding: const EdgeInsets.only(top: 45, left: 10), padding: const EdgeInsets.only(left: 10),
child: AutoSizeText( child: AutoSizeText(
TranslationHelper.get(configurations[index].title, appContext), TranslationHelper.get(configurations[index].title, appContext),
style: const TextStyle(fontSize: kMenuTitleDetailSize), style: const TextStyle(fontSize: kMenuTitleDetailSize),
maxFontSize: 20, maxFontSize: 18,
maxLines: 2, maxLines: 2,
), ),
), ),
), ),
), ),
),
], ],
), ),
if(configurations[index].isOffline!) if(configurations[index].isOffline!)