Setup last things + enum fix + layout + readme

This commit is contained in:
Fransolet Thomas 2023-01-27 21:13:16 +01:00
parent e728bdd315
commit 6266f79500
5 changed files with 61 additions and 39 deletions

View File

@ -14,3 +14,22 @@ A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter, view our For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials, [online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference. samples, guidance on mobile development, and a full API reference.
# OPENAPI Generation cmd
flutter pub run build_runner build --delete-conflicting-outputs
Le fichier est dans le projet.
# Publication sur docker - WEB DEMO
docker build -t demo-manager .
Pour tester en local :
docker run -d -p 8080:80 name demo-manager demo-manager
Image tag:
docker image tag demo-manager registry.unov.be/mymuseum/demo:latest
Docker push:
docker image push registry.unov.be/mymuseum/demo:latest

View File

@ -120,21 +120,22 @@ class _MainViewWidget extends State<MainViewWidget> {
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: AutoSizeText( child: AutoSizeText(
sectionSelected!.title!.firstWhere((translation) => translation.language == appContext.getContext().language).value!, sectionSelected!.title!.firstWhere((translation) => translation.language == appContext.getContext().language).value!,
style: new TextStyle(fontSize: kSectionTitleDetailSize), style: new TextStyle(fontSize: kIsWeb ? kWebSectionTitleDetailSize : kSectionTitleDetailSize),
maxLines: 1, maxLines: 1,
), ),
) )
), ),
Expanded( if(sectionSelected!.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null && sectionSelected!.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value!.trim().isNotEmpty)
child: Align( Expanded(
alignment: Alignment.centerLeft, child: Align(
child: AutoSizeText( alignment: Alignment.centerLeft,
sectionSelected!.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value!, child: AutoSizeText(
style: new TextStyle(fontSize: kIsWeb? kWebSectionDescriptionDetailSize : kSectionDescriptionDetailSize), sectionSelected!.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value!,
maxLines: 2, style: new TextStyle(fontSize: kIsWeb? kWebSectionDescriptionDetailSize : kSectionDescriptionDetailSize),
), maxLines: 2,
),
)
) )
)
], ],
), ),
) )
@ -306,7 +307,7 @@ boxDecoration(SectionDTO section, bool isSelected) {
borderRadius: BorderRadius.circular(30.0), borderRadius: BorderRadius.circular(30.0),
image: section.imageSource != null ? new DecorationImage( image: section.imageSource != null ? new DecorationImage(
fit: !isSelected || kIsWeb ? BoxFit.cover : BoxFit.contain, fit: !isSelected || kIsWeb ? BoxFit.cover : BoxFit.contain,
colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.3), BlendMode.dstATop) : null, colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(kIsWeb ? 0.3 : 0.5), BlendMode.dstATop) : null,
image: new NetworkImage( image: new NetworkImage(
section.imageSource!, section.imageSource!,
), ),

View File

@ -96,31 +96,33 @@ class _GoogleMapViewState extends State<GoogleMapView> {
//print(mapTypeApp.toString()); //print(mapTypeApp.toString());
MapType type = MapType.hybrid; MapType type = MapType.hybrid;
if(widget.mapDTO!.mapType != null) { if(kIsWeb) {
switch(widget.mapDTO!.mapType!.value) { if(widget.mapDTO!.mapType != null) {
case 0: switch(widget.mapDTO!.mapType!.value) {
type = MapType.none; case 0:
break; type = MapType.none;
case 1: break;
type = MapType.normal; case 1:
break; type = MapType.normal;
case 2: break;
type = MapType.satellite; case 2:
break; type = MapType.satellite;
case 3: break;
type = MapType.terrain; case 3:
break; type = MapType.terrain;
case 4: break;
type = MapType.hybrid; case 4:
break; type = MapType.hybrid;
break;
}
} }
} else {
type = EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString()) != null ? EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString())! : MapType.hybrid;
} }
//MapType type = EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString()) != null ? EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString())! : MapType.hybrid; //MapType type = EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString()) != null ? EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString())! : MapType.hybrid;
return GoogleMap( return GoogleMap(
mapType: type, mapType: type, // widget.mapDTO!.mapType != null ? EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString())!: MapType.hybrid,
mapToolbarEnabled: false, mapToolbarEnabled: false,
initialCameraPosition: CameraPosition( initialCameraPosition: CameraPosition(
target: LatLng(50.465503, 4.865105), // MDLF 50.416639, 4.879169 / Namur 50.465503, 4.865105 target: LatLng(50.465503, 4.865105), // MDLF 50.416639, 4.879169 / Namur 50.465503, 4.865105

View File

@ -104,7 +104,7 @@ class _MenuViewWidget extends State<MenuViewWidget> {
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.only(bottom: 20, right: 20), padding: const EdgeInsets.only(bottom: kIsWeb ? 5: 20, right: kIsWeb ? 5: 20),
child: Align( child: Align(
alignment: Alignment.bottomRight, alignment: Alignment.bottomRight,
child: InkWell( child: InkWell(
@ -156,11 +156,11 @@ class _MenuViewWidget extends State<MenuViewWidget> {
child: Container( child: Container(
decoration: boxDecoration(menuDTO.sections![index], false), decoration: boxDecoration(menuDTO.sections![index], false),
padding: const EdgeInsets.all(25), padding: const EdgeInsets.all(25),
margin: EdgeInsets.symmetric(vertical: 25, horizontal: 25), margin: EdgeInsets.symmetric(vertical: kIsWeb ? 15 : 25, horizontal: kIsWeb ? 15 : 25),
child: Align( child: Align(
alignment: Alignment.bottomRight, alignment: Alignment.bottomRight,
child: FractionallySizedBox( child: FractionallySizedBox(
heightFactor: 0.4, heightFactor: kIsWeb ? 0.3 : 0.4,
child: Column( child: Column(
children: [ children: [
Align( Align(
@ -198,8 +198,8 @@ boxDecoration(SectionDTO section, bool isSelected) {
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(30.0), borderRadius: BorderRadius.circular(30.0),
image: section.imageSource != null ? new DecorationImage( image: section.imageSource != null ? new DecorationImage(
fit: BoxFit.contain, fit: kIsWeb ? BoxFit.cover : BoxFit.contain,
colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop) : null, colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(kIsWeb ? 0.3 : 0.5), BlendMode.dstATop) : null,
image: new NetworkImage( image: new NetworkImage(
section.imageSource!, section.imageSource!,
), ),

View File

@ -77,9 +77,9 @@ class SectionTypeTypeTransformer {
/// and users are still using an old app with the old code. /// and users are still using an old app with the old code.
SectionType? decode(dynamic data, {bool allowNull = true}) { SectionType? decode(dynamic data, {bool allowNull = true}) {
if (data != null) { if (data != null) {
print("data.toString()"); /*print("data.toString()");
print(data.toString()); print(data.toString());
print(data.runtimeType); print(data.runtimeType);*/
if(data.runtimeType == String) { if(data.runtimeType == String) {
switch (data.toString()) { switch (data.toString()) {
case r'Map': return SectionType.map; case r'Map': return SectionType.map;
@ -96,7 +96,7 @@ class SectionTypeTypeTransformer {
} }
} else { } else {
if(data.runtimeType == int) { if(data.runtimeType == int) {
print("HELLOWWWWW INT"); //print("HELLOWWWWW INT");
switch (data) { switch (data) {
case 0: case 0:
print("RETURN MAP"); print("RETURN MAP");