diff --git a/lib/Screens/Agenda/event_list_item.dart b/lib/Screens/Agenda/event_list_item.dart index ef645b4..45ea188 100644 --- a/lib/Screens/Agenda/event_list_item.dart +++ b/lib/Screens/Agenda/event_list_item.dart @@ -139,7 +139,7 @@ class EventListItem extends StatelessWidget { HtmlWidget( eventAgenda.name!.length > 75 ? eventAgenda.name!.substring(0, 75) + " ..." : eventAgenda.name!, customStylesBuilder: (element) { - return {'text-align': 'center'}; + return {'text-align': 'center', 'font-family': "Roboto"}; }, textStyle: TextStyle(fontSize: 14.0), ), diff --git a/lib/Screens/Agenda/event_popup.dart b/lib/Screens/Agenda/event_popup.dart index b17f688..c6d2e28 100644 --- a/lib/Screens/Agenda/event_popup.dart +++ b/lib/Screens/Agenda/event_popup.dart @@ -245,7 +245,7 @@ class _EventPopupState extends State { HtmlWidget( widget.eventAgenda.description!, customStylesBuilder: (element) { - return {'text-align': 'left'}; + return {'text-align': 'left', 'font-family': "Roboto"}; }, textStyle: TextStyle(fontSize: kDescriptionSize), ), diff --git a/lib/Screens/MainView/main_view.dart b/lib/Screens/MainView/main_view.dart index e4c3fce..b447b9f 100644 --- a/lib/Screens/MainView/main_view.dart +++ b/lib/Screens/MainView/main_view.dart @@ -216,7 +216,7 @@ class _MainViewWidget extends State { Future getCurrentConfiguration(dynamic appContext) async { TabletAppContext tabletAppContext = await appContext.getContext(); try { - ConfigurationDTO? configurationDTO = await tabletAppContext.clientAPI!.configurationApi!.configurationGetDetail(tabletAppContext.configuration!.id!); + ConfigurationDTO? configurationDTO = await tabletAppContext.clientAPI!.configurationApi!.configurationGetDetail(tabletAppContext.configuration!.id!); // tabletAppContext.configuration!.id! // 65c5f0ee4c030e63ce16bff5 TODO Remove tabletAppContext.configuration = configurationDTO; backgroundColor = tabletAppContext.configuration != null ? new Color(int.parse(appContext.getContext().configuration.secondaryColor.split('(0x')[1].split(')')[0], radix: 16)) : Colors.white; @@ -348,7 +348,7 @@ class _MainViewWidget extends State { child: HtmlWidget( sectionsLocal![index].title!.firstWhere((translation) => translation.language == appContext.getContext().language).value ?? "", customStylesBuilder: (element) { - return {'text-align': 'right'}; + return {'text-align': 'right', 'font-family': "Roboto"}; }, textStyle: TextStyle(fontSize: isPortrait ? 10 : 25),//calculateFontSize(constraints.maxWidth, constraints.maxHeight, kIsWeb ? kWebMenuTitleDetailSize : kMenuTitleDetailSize)), ), diff --git a/lib/Screens/Map/marker_view.dart b/lib/Screens/Map/marker_view.dart index 0a453da..973d2c5 100644 --- a/lib/Screens/Map/marker_view.dart +++ b/lib/Screens/Map/marker_view.dart @@ -186,7 +186,7 @@ class _MarkerInfoWidget extends State { HtmlWidget( selectedPoint.description!.firstWhere((d) => d.language == language).value!, customStylesBuilder: (element) { - return {'text-align': 'left'}; + return {'text-align': 'left', 'font-family': "Roboto"}; }, textStyle: TextStyle(fontSize: kDescriptionSize), ), diff --git a/lib/Screens/Menu/menu_view.dart b/lib/Screens/Menu/menu_view.dart index 870f037..4d20592 100644 --- a/lib/Screens/Menu/menu_view.dart +++ b/lib/Screens/Menu/menu_view.dart @@ -66,7 +66,7 @@ class _MenuView extends State { return Center( child: GridView.builder( shrinkWrap: true, - gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: kIsWeb ? 1.7 : 1.4), + gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3, childAspectRatio: kIsWeb ? 1.7 : 1.2), itemCount: menuDTO.sections!.length, itemBuilder: (BuildContext context, int index) { return InkWell( @@ -87,8 +87,8 @@ class _MenuView extends State { }, child: Container( decoration: isImageBackground ? boxDecoration(appContext, menuDTO.sections![index], false) : null, - padding: const EdgeInsets.all(25), - margin: EdgeInsets.symmetric(vertical: 15, horizontal: 15), + padding: const EdgeInsets.all(12), + margin: EdgeInsets.symmetric(vertical: 8, horizontal: 8), child: isImageBackground ? Align( alignment: Alignment.bottomRight, child: FractionallySizedBox( @@ -100,9 +100,9 @@ class _MenuView extends State { child: HtmlWidget( menuDTO.sections![index].title!.firstWhere((translation) => translation.language == appContext.getContext().language).value!, customStylesBuilder: (element) { - return {'text-align': 'right'}; + return {'text-align': 'right', 'font-family': "Roboto"}; }, - textStyle: new TextStyle(fontSize: kIsWeb? kWebMenuTitleDetailSize : kMenuTitleDetailSize), + textStyle: new TextStyle(fontSize: kMenuTitleDetailSize), ), ), /*Align( @@ -121,7 +121,7 @@ class _MenuView extends State { ) : Column( children: [ Expanded( - flex: 8, + flex: 7, child: Container( decoration: BoxDecoration( color: menuDTO.sections![index].imageSource == null ? kBackgroundColor : null, // default color if no image @@ -134,14 +134,20 @@ class _MenuView extends State { ) ), Expanded( - flex: 2, - child: Center( - child: HtmlWidget( - menuDTO.sections![index].title!.firstWhere((translation) => translation.language == appContext.getContext().language).value ?? "", - customStylesBuilder: (element) { - return {'text-align': 'center', 'font-family': "Roboto"}; - }, - textStyle: TextStyle(fontSize: 25),//calculateFontSize(constraints.maxWidth, constraints.maxHeight, kIsWeb ? kWebMenuTitleDetailSize : kMenuTitleDetailSize)), + flex: 3, + child: Container( + //color: Colors.yellow, + constraints: BoxConstraints( + maxWidth: size.width * 0.3, + ), + child: Center( + child: HtmlWidget( + menuDTO.sections![index].title!.firstWhere((translation) => translation.language == appContext.getContext().language).value ?? "", + customStylesBuilder: (element) { + return {'text-align': 'center', 'font-family': "Roboto"}; + }, + textStyle: TextStyle(fontSize: 20),//calculateFontSize(constraints.maxWidth, constraints.maxHeight, kIsWeb ? kWebMenuTitleDetailSize : kMenuTitleDetailSize)), + ), ), ) ) diff --git a/lib/Screens/Puzzle/message_dialog.dart b/lib/Screens/Puzzle/message_dialog.dart index 61d86a6..9ba08de 100644 --- a/lib/Screens/Puzzle/message_dialog.dart +++ b/lib/Screens/Puzzle/message_dialog.dart @@ -49,7 +49,7 @@ void showMessage(TranslationAndResourceDTO translationAndResourceDTO, AppContext child: HtmlWidget( translationAndResourceDTO.value!, customStylesBuilder: (element) { - return {'text-align': 'center'}; + return {'text-align': 'center', 'font-family': "Roboto"}; }, textStyle: TextStyle(fontSize: kDescriptionSize), ),/*Text( diff --git a/lib/Screens/Quizz/quizz_view.dart b/lib/Screens/Quizz/quizz_view.dart index 75934a9..b088582 100644 --- a/lib/Screens/Quizz/quizz_view.dart +++ b/lib/Screens/Quizz/quizz_view.dart @@ -3,9 +3,11 @@ import 'dart:developer'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:confetti/confetti.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; import 'package:manager_api/api.dart'; import 'package:photo_view/photo_view.dart'; @@ -169,7 +171,7 @@ class _QuizzView extends State { levelToShow.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? levelToShow.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textStyle: TextStyle(fontSize: kIsWeb ? kWebDescriptionSize : kDescriptionSize), customStylesBuilder: (element) { - return {'text-align': 'center'}; + return {'text-align': 'center', 'font-family': "Roboto"}; }, ) : Text("No data"), @@ -331,7 +333,9 @@ class _QuizzView extends State { ), width: MediaQuery.of(context).size.width *0.70, child: Center( - child: SingleChildScrollView( + child: Container( + //color: Colors.yellow, + //height: size.height * 0.2, child: Row( children: [ if(i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).resourceId != null) @@ -348,14 +352,20 @@ class _QuizzView extends State { child: getElementForResource(context, appContext, i.label!.firstWhere((translation) => translation.language == appContext.getContext().language), true), ) ), - Padding( - padding: const EdgeInsets.all(10.0), - child: HtmlWidget( - i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", - textStyle: TextStyle(fontSize: kIsWeb ? kWebDescriptionSize : kDescriptionSize), - customStylesBuilder: (element) { - return {'text-align': 'center'}; - }, + SingleChildScrollView( + child: Container( + //color: Colors.green, + width: i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).resourceId == null ? size.width * 0.65 : size.width * 0.5, + child: Padding( + padding: const EdgeInsets.all(10.0), + child: HtmlWidget( + i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", + textStyle: TextStyle(fontSize: kIsWeb ? kWebDescriptionSize : kDescriptionSize), + customStylesBuilder: (element) { + return {'text-align': 'center', 'font-family': "Roboto"}; + }, + ), + ), ), ), ], @@ -422,15 +432,17 @@ class _QuizzView extends State { child: getElementForResource(context, appContext, i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language), true), ) ), - Container( - width: size.width * 0.1, - //color: Colors.yellow, - child: HtmlWidget( - i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", - textStyle: TextStyle(fontSize: kIsWeb ? kWebDescriptionSize : kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black), - customStylesBuilder: (element) { - return {'text-align': 'center'}; - }, + SingleChildScrollView( + child: Container( + width: i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).resourceId == null ? size.width * 0.3 : size.width * 0.13, + //color: Colors.yellow, + child: HtmlWidget( + i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", + textStyle: TextStyle(fontSize: kIsWeb ? kWebDescriptionSize : kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black), + customStylesBuilder: (element) { + return {'text-align': 'center', 'font-family': "Roboto"}; + }, + ), ), ), ], @@ -582,7 +594,7 @@ getElementForResource(BuildContext context, AppContext appContext, TranslationAn //color: kBackgroundLight, image: DecorationImage( image: ImageCustomProvider.getImageProvider(appContext, i.resourceId!, i.resourceUrl!), - fit: BoxFit.cover, + fit: BoxFit.contain, ), borderRadius: BorderRadius.all(Radius.circular(tabletAppContext.configuration!.roundedValue?.toDouble() ?? 15.0)), /*border: Border.all( diff --git a/lib/Screens/Quizz/showResponses.dart b/lib/Screens/Quizz/showResponses.dart index c05f598..cb6cea9 100644 --- a/lib/Screens/Quizz/showResponses.dart +++ b/lib/Screens/Quizz/showResponses.dart @@ -133,7 +133,7 @@ class _ShowReponsesWidget extends State { i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textStyle: TextStyle(fontSize: kIsWeb ? kWebDescriptionSize : kDescriptionSize), customStylesBuilder: (element) { - return {'text-align': 'center'}; + return {'text-align': 'center', 'font-family': "Roboto"}; }, ), ), @@ -171,7 +171,7 @@ class _ShowReponsesWidget extends State { i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.responsesSubDTO![index].label!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textStyle: TextStyle(fontSize: kIsWeb ? kWebDescriptionSize : kDescriptionSize, color: i.chosen == index ? Colors.white : Colors.black), customStylesBuilder: (element) { - return {'text-align': 'center'}; + return {'text-align': 'center', 'font-family': "Roboto"}; }, ), decoration: BoxDecoration( diff --git a/lib/Screens/Slider/slider_view.dart b/lib/Screens/Slider/slider_view.dart index c333cd0..6a3fa2c 100644 --- a/lib/Screens/Slider/slider_view.dart +++ b/lib/Screens/Slider/slider_view.dart @@ -154,7 +154,7 @@ class _SliderView extends State { i.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null ? i.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value! : "", textStyle: TextStyle(fontSize: kIsWeb ? kWebDescriptionSize : kDescriptionSize), customStylesBuilder: (element) { - return {'text-align': 'center'}; + return {'text-align': 'center', 'font-family': "Roboto"}; }, ), ), diff --git a/lib/Services/downloadService.dart b/lib/Services/downloadService.dart index d3330ba..70229db 100644 --- a/lib/Services/downloadService.dart +++ b/lib/Services/downloadService.dart @@ -84,7 +84,7 @@ class _DownloadConfigurationWidgetState extends State