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
[online documentation](https://flutter.dev/docs), which offers tutorials,
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,
child: AutoSizeText(
sectionSelected!.title!.firstWhere((translation) => translation.language == appContext.getContext().language).value!,
style: new TextStyle(fontSize: kSectionTitleDetailSize),
style: new TextStyle(fontSize: kIsWeb ? kWebSectionTitleDetailSize : kSectionTitleDetailSize),
maxLines: 1,
),
)
),
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: AutoSizeText(
sectionSelected!.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value!,
style: new TextStyle(fontSize: kIsWeb? kWebSectionDescriptionDetailSize : kSectionDescriptionDetailSize),
maxLines: 2,
),
if(sectionSelected!.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value != null && sectionSelected!.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value!.trim().isNotEmpty)
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: AutoSizeText(
sectionSelected!.description!.firstWhere((translation) => translation.language == appContext.getContext().language).value!,
style: new TextStyle(fontSize: kIsWeb? kWebSectionDescriptionDetailSize : kSectionDescriptionDetailSize),
maxLines: 2,
),
)
)
)
],
),
)
@ -306,7 +307,7 @@ boxDecoration(SectionDTO section, bool isSelected) {
borderRadius: BorderRadius.circular(30.0),
image: section.imageSource != null ? new DecorationImage(
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(
section.imageSource!,
),

View File

@ -96,31 +96,33 @@ class _GoogleMapViewState extends State<GoogleMapView> {
//print(mapTypeApp.toString());
MapType type = MapType.hybrid;
if(widget.mapDTO!.mapType != null) {
switch(widget.mapDTO!.mapType!.value) {
case 0:
type = MapType.none;
break;
case 1:
type = MapType.normal;
break;
case 2:
type = MapType.satellite;
break;
case 3:
type = MapType.terrain;
break;
case 4:
type = MapType.hybrid;
break;
if(kIsWeb) {
if(widget.mapDTO!.mapType != null) {
switch(widget.mapDTO!.mapType!.value) {
case 0:
type = MapType.none;
break;
case 1:
type = MapType.normal;
break;
case 2:
type = MapType.satellite;
break;
case 3:
type = MapType.terrain;
break;
case 4:
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;
return GoogleMap(
mapType: type,
mapType: type, // widget.mapDTO!.mapType != null ? EnumToString.fromString(MapType.values, widget.mapDTO!.mapType.toString())!: MapType.hybrid,
mapToolbarEnabled: false,
initialCameraPosition: CameraPosition(
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: const EdgeInsets.only(bottom: 20, right: 20),
padding: const EdgeInsets.only(bottom: kIsWeb ? 5: 20, right: kIsWeb ? 5: 20),
child: Align(
alignment: Alignment.bottomRight,
child: InkWell(
@ -156,11 +156,11 @@ class _MenuViewWidget extends State<MenuViewWidget> {
child: Container(
decoration: boxDecoration(menuDTO.sections![index], false),
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(
alignment: Alignment.bottomRight,
child: FractionallySizedBox(
heightFactor: 0.4,
heightFactor: kIsWeb ? 0.3 : 0.4,
child: Column(
children: [
Align(
@ -198,8 +198,8 @@ boxDecoration(SectionDTO section, bool isSelected) {
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(30.0),
image: section.imageSource != null ? new DecorationImage(
fit: BoxFit.contain,
colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop) : null,
fit: kIsWeb ? BoxFit.cover : BoxFit.contain,
colorFilter: !isSelected? new ColorFilter.mode(Colors.black.withOpacity(kIsWeb ? 0.3 : 0.5), BlendMode.dstATop) : null,
image: new NetworkImage(
section.imageSource!,
),

View File

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