Map working - (only google, mapContext issue on selected point)

This commit is contained in:
Thomas Fransolet 2025-06-19 16:50:28 +02:00
parent 4e9dc59df9
commit b20a112eb2
3 changed files with 255 additions and 325 deletions

View File

@ -38,7 +38,7 @@ class _FilterTree extends State<FilterTree> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return ListView.builder( return ListView.builder(
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return _buildNode(widget.data[index], EdgeInsets.all(0)); return _buildNode(widget.data[index], const EdgeInsets.all(0));
}, },
itemCount: widget.data.length, itemCount: widget.data.length,
); );
@ -65,11 +65,11 @@ class _FilterTree extends State<FilterTree> {
child: ExpansionTile( child: ExpansionTile(
iconColor: widget.checkBoxColor, iconColor: widget.checkBoxColor,
collapsedIconColor: widget.checkBoxColor, collapsedIconColor: widget.checkBoxColor,
tilePadding: EdgeInsets.fromLTRB(0, 0, 0, 0), tilePadding: const EdgeInsets.fromLTRB(0, 0, 0, 0),
initiallyExpanded: node.show, initiallyExpanded: node.show,
title: Container( title: Container(
margin: EdgeInsets.only(left: 0), margin: const EdgeInsets.only(left: 0),
padding: EdgeInsets.only(left: 0), padding: const EdgeInsets.only(left: 0),
child: Text( child: Text(
node.title, node.title,
style: TextStyle(color: widget.textColor ?? Colors.black), style: TextStyle(color: widget.textColor ?? Colors.black),
@ -86,7 +86,7 @@ class _FilterTree extends State<FilterTree> {
), ),
children: node.children children: node.children
.map((child) => _buildNode( .map((child) => _buildNode(
child, widget.childrenPadding ?? EdgeInsets.all(0))) child, widget.childrenPadding ?? const EdgeInsets.all(0)))
.toList(), .toList(),
), ),
), ),

View File

@ -14,14 +14,13 @@ import 'package:mymuseum_visitapp/app_context.dart';
import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:html/parser.dart' show parse; import 'package:html/parser.dart' show parse;
import 'package:qr_flutter/qr_flutter.dart';
import '../../../constants.dart'; import '../../../constants.dart';
import 'map_context.dart'; import 'map_context.dart';
class MarkerViewWidget extends StatefulWidget { class MarkerViewWidget extends StatefulWidget {
MarkerViewWidget(); const MarkerViewWidget({super.key});
@override @override
_MarkerInfoWidget createState() => _MarkerInfoWidget(); _MarkerInfoWidget createState() => _MarkerInfoWidget();
@ -54,21 +53,21 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
var language = visitAppContext.language; var language = visitAppContext.language;
GeoPointDTO? selectedPoint = mapContext.getSelectedPoint() as GeoPointDTO?; GeoPointDTO? selectedPoint = mapContext.getSelectedPoint() as GeoPointDTO?;
ScrollController scrollDescription = new ScrollController(); ScrollController scrollDescription = ScrollController();
ScrollController scrollPrice = new ScrollController(); ScrollController scrollPrice = ScrollController();
var isPointPrice = selectedPoint != null && selectedPoint.prices != null && selectedPoint.prices!.isNotEmpty && selectedPoint.prices!.any((d) => d.language == language) && selectedPoint.prices!.firstWhere((d) => d.language == language).value != null && selectedPoint.prices!.firstWhere((d) => d.language == language).value!.trim().length > 0; var isPointPrice = selectedPoint != null && selectedPoint.prices != null && selectedPoint.prices!.isNotEmpty && selectedPoint.prices!.any((d) => d.language == language) && selectedPoint.prices!.firstWhere((d) => d.language == language).value != null && selectedPoint.prices!.firstWhere((d) => d.language == language).value!.trim().isNotEmpty;
Color primaryColor = new Color(int.parse(visitAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16)); Color primaryColor = Color(int.parse(visitAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16));
Size sizeMarker = Size(size.width * 0.93, size.height * 0.83); Size sizeMarker = Size(size.width * 0.93, size.height * 0.8);
return Center( return Center(
child: Visibility( child: Visibility(
visible: selectedPoint != null, visible: selectedPoint != null,
child: Container( child: Container(
width: sizeMarker.width, width: sizeMarker.width,
height: sizeMarker.height, height: sizeMarker.height,
margin: EdgeInsets.symmetric(vertical: 3, horizontal: 4), margin: const EdgeInsets.symmetric(vertical: 3, horizontal: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: kBackgroundColor, // Colors.amberAccent //kBackgroundLight, color: kBackgroundColor, // Colors.amberAccent //kBackgroundLight,
//shape: BoxShape.rectangle, //shape: BoxShape.rectangle,
@ -84,336 +83,238 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
), ),
child: Stack( child: Stack(
children: <Widget> [ children: <Widget> [
Positioned(
right: 5,
top: 5,
child: InkWell(
onTap: () {
setState(() {
mapContext.setSelectedPoint(null);
mapContext.setSelectedPointForNavigate(null);
});
},
child: Container(
width: 50,
height: 50,
decoration: BoxDecoration(
color: kBackgroundGrey,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: kBackgroundGrey,
spreadRadius: 0.5,
blurRadius: 1.1,
offset: Offset(0, 1.1), // changes position of shadow
),
],
),
child: Icon(
Icons.close,
size: 25,
color: Colors.white,
),
),
),
),
if(selectedPoint != null) if(selectedPoint != null)
Row( ClipRRect(
children: [ borderRadius: BorderRadius.only(topLeft: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0), topRight: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
selectedPoint.imageResourceId != null && selectedPoint.imageUrl != null ? ClipRRect( child: Stack(
borderRadius: BorderRadius.only(topLeft: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0), bottomLeft: Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
child: Container(
child: Center(
child: Container(
decoration: BoxDecoration(
border: Border(right: BorderSide(width: 0.05, color: kMainGrey)),
color: Colors.grey,
),
width: size.width * 0.17,
height: size.height,
child: CachedNetworkImage(
imageUrl: selectedPoint.imageUrl!,
width: size.width,
fit: BoxFit.cover,
progressIndicatorBuilder: (context, url, downloadProgress) {
return Center(
child: SizedBox(
width: 50,
height: 50,
child: LoadingCommon(),
),
);
},
errorWidget: (context, url, error) => Icon(Icons.error),
),
),
)
),
): SizedBox(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Padding( Container(
padding: const EdgeInsets.only(top: 8.0, left: 15.0), decoration: BoxDecoration(
child: Container( boxShadow: const [
//color: Colors.green, BoxShadow(
height: size.height * 0.06, color: kMainGrey,
width: size.width * 0.65, spreadRadius: 0.5,
blurRadius: 5,
offset: Offset(0, 1), // changes position of shadow
),
],
gradient: const LinearGradient(
begin: Alignment.centerRight,
end: Alignment.centerLeft,
colors: [
kMainColor0,
kMainColor1,
kMainColor2,
],
),
border: const Border(right: BorderSide(width: 0.05, color: kMainGrey)),
color: Colors.grey,
image: selectedPoint.imageUrl != null ? DecorationImage(
fit: BoxFit.cover,
opacity: 0.4,
image: NetworkImage(
selectedPoint.imageUrl!,
),
): null
),
width: size.width,
height: 75,
child: Center(
child: HtmlWidget( child: HtmlWidget(
selectedPoint.title!.firstWhere((t) => t.language == language).value!, selectedPoint.title!.firstWhere((t) => t.language == language).value!,
textStyle: TextStyle(fontSize: 20.0), textStyle: const TextStyle(fontSize: 20.0),
customStylesBuilder: (element)
{
return {'text-align': 'center', 'font-family': "Roboto", '-webkit-line-clamp': "2"};
},
), ),
), ),
), ),
Row( ],
),
),
if(selectedPoint != null)
Padding(
padding: const EdgeInsets.only(top: 75),
child: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Column(
//mainAxisAlignment: MainAxisAlignment.center, //mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.only(left: 15), padding: const EdgeInsets.all(6),
child: Column( child: Container(
children: [ height: size.height * 0.4,
Container( width: size.width,
height: isPointPrice && selectedPoint.prices!.firstWhere((d) => d.language == language).value!.length > breakPointPrice ? size.height * 0.50 : size.height * 0.7, decoration: BoxDecoration(
width: size.width * 0.38, color: kBackgroundLight,
decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0))
color: kBackgroundLight, ),
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)) child: Padding(
), padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15),
child: Padding( child: Scrollbar(
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15), controller: scrollDescription,
child: Scrollbar( thumbVisibility: true,
controller: scrollDescription, thickness: 2.0,
thumbVisibility: true, child: SingleChildScrollView(
thickness: 2.0, controller: scrollDescription,
child: SingleChildScrollView(
controller: scrollDescription,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
if(selectedPoint.description!.any((d) => d.language == language) && selectedPoint.description!.firstWhere((d) => d.language == language).value != null && selectedPoint.description!.firstWhere((d) => d.language == language).value!.trim().length > 0)
HtmlWidget(
selectedPoint.description!.firstWhere((d) => d.language == language).value!,
customStylesBuilder: (element) {
return {'text-align': 'left', 'font-family': "Roboto"};
},
textStyle: TextStyle(fontSize: kDescriptionSize),
),
],
),
),
),
),
),
),
if(isPointPrice && selectedPoint.prices!.firstWhere((d) => d.language == language).value!.length > breakPointPrice)
Container(
height: size.height * 0.20,
width: size.width * 0.38,
decoration: BoxDecoration(
color: kBackgroundLight,
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0))
),
child: Padding( child: Padding(
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15), padding: const EdgeInsets.all(8.0),
child: Scrollbar(
controller: scrollPrice,
thumbVisibility: true,
thickness: 2.0,
child: SingleChildScrollView(
controller: scrollPrice,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
//crossAxisAlignment: CrossAxisAlignment.center,
//mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Center(child: Padding(
padding: const EdgeInsets.all(5.0),
child: Icon(Icons.price_change_outlined, color: primaryColor, size: 25),
)),
HtmlWidget(
selectedPoint.prices!.firstWhere((d) => d.language == language).value!,
customStylesBuilder: (element) {
return {'text-align': 'left', 'font-family': "Roboto"};
},
textStyle: TextStyle(fontSize: kDescriptionSize),
),
],
),
),
),
),
),
),
],
),
),
SizedBox(
width: size.width * 0.32,
height: size.height * 0.7,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
//color: Colors.green,
height: size.height * 0.35,
child: CarouselSlider(
carouselController: sliderController,
options: CarouselOptions(
onPageChanged: (int index, CarouselPageChangedReason reason) {
currentIndex.value = index + 1;
},
height: size.height *0.33,
enlargeCenterPage: true,
pageSnapping: true,
reverse: false,
),
items: selectedPoint.contents!.map<Widget>((ContentDTO i) {
return Builder(
builder: (BuildContext context) {
AppContext appContext = Provider.of<AppContext>(context);
var resourcetoShow = getElementForResource(context, appContext, i, true);
return resourcetoShow;
},
);
}).toList(),
),
),
Container(
//color: Colors.yellow,
height: size.height * 0.33,
child: Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
/*if(isPointPrice && selectedPoint.prices!.firstWhere((d) => d.language == language).value!.length > breakPointPrice) if(selectedPoint.description!.any((d) => d.language == language) && selectedPoint.description!.firstWhere((d) => d.language == language).value != null && selectedPoint.description!.firstWhere((d) => d.language == language).value!.trim().isNotEmpty)
Container( HtmlWidget(
height: size.height * 0.1, selectedPoint.description!.firstWhere((d) => d.language == language).value!,
width: size.width * 0.38, customStylesBuilder: (element) {
decoration: BoxDecoration( return {'text-align': 'left', 'font-family': "Roboto"};
color: kBackgroundLight, },
borderRadius: BorderRadius.all(Radius.circular(tabletAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)) textStyle: const TextStyle(fontSize: kMenuDescriptionDetailSize),
),
child: Padding(
padding: EdgeInsets.all(5),
child: Scrollbar(
thumbVisibility: true,
thickness: 2.0,
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(5.0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.start,
children: [
// todo add width ?
Padding(
padding: const EdgeInsets.all(5.0),
child: Icon(Icons.price_change_outlined, color: primaryColor, size: 13),
),
HtmlWidget(
selectedPoint.prices!.firstWhere((d) => d.language == language).value!,
customStylesBuilder: (element) {
return {'text-align': 'left', 'font-family': "Roboto"};
},
textStyle: TextStyle(fontSize: 12),
),
],
),
),
),
),
),
),*/
if(isPointPrice && selectedPoint.prices!.firstWhere((d) => d.language == language).value!.length <= breakPointPrice)
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.price_change_outlined, color: primaryColor, size: 13),
Padding(
padding: const EdgeInsets.all(4.0),
child: HtmlWidget(
selectedPoint.prices!.firstWhere((d) => d.language == language).value!,
customStylesBuilder: (element) {
return {'text-align': 'left', 'font-family': "Roboto"};
},
textStyle: TextStyle(fontSize: 12),
),
)
],
), ),
selectedPoint.phone != null && selectedPoint.phone!.isNotEmpty && selectedPoint.phone!.any((d) => d.language == language) && selectedPoint.phone!.firstWhere((d) => d.language == language).value != null && selectedPoint.phone!.firstWhere((d) => d.language == language).value!.trim().length > 0 ? Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.phone, color: primaryColor, size: 13),
Padding(
padding: const EdgeInsets.all(4.0),
child: Text(parse(selectedPoint.phone!.firstWhere((p) => p.language == language).value!).documentElement!.text, style: TextStyle(fontSize: 12)),
)
],
): SizedBox(),
selectedPoint.email != null && selectedPoint.email!.isNotEmpty && selectedPoint.email!.any((d) => d.language == language) && selectedPoint.email!.firstWhere((d) => d.language == language).value != null && selectedPoint.email!.firstWhere((d) => d.language == language).value!.trim().length > 0 ? Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.email, color: primaryColor, size: 13),
Padding(
padding: const EdgeInsets.all(4.0),
child: SizedBox(
width: size.width*0.25,
child: AutoSizeText(parse(selectedPoint.email!.firstWhere((p) => p.language == language).value!).documentElement!.text, style: TextStyle(fontSize: 12), maxLines: 3)
),
)
],
): SizedBox(),
selectedPoint.site != null && selectedPoint.site!.isNotEmpty && selectedPoint.site!.any((d) => d.language == language) && selectedPoint.site!.firstWhere((d) => d.language == language).value != null && selectedPoint.site!.firstWhere((d) => d.language == language).value!.trim().length > 0 ? Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.public, color: primaryColor, size: 13),
Padding(
padding: const EdgeInsets.all(4.0),
child: SizedBox(
width: size.width*0.25,
child: AutoSizeText(parse(selectedPoint.site!.firstWhere((p) => p.language == language).value!).documentElement!.text, style: TextStyle(fontSize: 12), maxLines: 3)
),
)
],
): SizedBox(),
selectedPoint.site != null && selectedPoint.site!.isNotEmpty && selectedPoint.site!.any((d) => d.language == language) && selectedPoint.site!.firstWhere((d) => d.language == language).value != null && selectedPoint.site!.firstWhere((d) => d.language == language).value!.trim().length > 0 ? Expanded(
child: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: size.width *0.1,
height: 120,
child: QrImageView(
padding: EdgeInsets.only(left: 5.0, top: 5.0, bottom: 5.0, right: 5.0),
data: parse(selectedPoint.site!.firstWhere((p) => p.language == language).value!).documentElement!.text,
version: QrVersions.auto,
size: 50.0,
),
),
),
),
): SizedBox(),
], ],
), ),
), ),
), ),
], ),
), ),
), ),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
height: size.height * 0.2,
child: CarouselSlider(
carouselController: sliderController,
options: CarouselOptions(
onPageChanged: (int index, CarouselPageChangedReason reason) {
currentIndex.value = index + 1;
},
height: size.height *0.33,
enlargeCenterPage: true,
pageSnapping: true,
reverse: false,
),
items: selectedPoint.contents!.map<Widget>((ContentDTO i) {
return Builder(
builder: (BuildContext context) {
AppContext appContext = Provider.of<AppContext>(context);
var resourcetoShow = getElementForResource(context, appContext, i, true);
return resourcetoShow;
},
);
}).toList(),
),
),
Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Column(
children: [
if(isPointPrice && selectedPoint.prices!.firstWhere((d) => d.language == language).value!.length > breakPointPrice)
Padding(
padding: const EdgeInsets.only(top: 8.0, bottom: 8.0),
child: Container(
height: size.height * 0.18,
width: size.width,
decoration: BoxDecoration(
color: kBackgroundLight,
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0))
),
child: Padding(
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15),
child: Scrollbar(
controller: scrollPrice,
thumbVisibility: true,
thickness: 2.0,
child: SingleChildScrollView(
controller: scrollPrice,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
//crossAxisAlignment: CrossAxisAlignment.center,
//mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Center(child: Padding(
padding: const EdgeInsets.all(5.0),
child: Icon(Icons.price_change_outlined, color: primaryColor, size: 25),
)),
HtmlWidget(
selectedPoint.prices!.firstWhere((d) => d.language == language).value!,
customStylesBuilder: (element) {
return {'text-align': 'left', 'font-family': "Roboto"};
},
textStyle: const TextStyle(fontSize: kMenuDescriptionDetailSize),
),
],
),
),
),
),
),
),
),
if(isPointPrice && selectedPoint.prices!.firstWhere((d) => d.language == language).value!.length <= breakPointPrice)
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(Icons.price_change_outlined, color: primaryColor, size: 13),
Padding(
padding: const EdgeInsets.all(4.0),
child: HtmlWidget(
selectedPoint.prices!.firstWhere((d) => d.language == language).value!,
customStylesBuilder: (element) {
return {'text-align': 'left', 'font-family': "Roboto"};
},
textStyle: const TextStyle(fontSize: 12),
),
)
],
),
selectedPoint.phone != null && selectedPoint.phone!.isNotEmpty && selectedPoint.phone!.any((d) => d.language == language) && selectedPoint.phone!.firstWhere((d) => d.language == language).value != null && selectedPoint.phone!.firstWhere((d) => d.language == language).value!.trim().isNotEmpty ? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.phone, color: primaryColor, size: 13),
Padding(
padding: const EdgeInsets.all(4.0),
child: Text(parse(selectedPoint.phone!.firstWhere((p) => p.language == language).value!).documentElement!.text, style: const TextStyle(fontSize: 18)),
)
],
): const SizedBox(),
selectedPoint.email != null && selectedPoint.email!.isNotEmpty && selectedPoint.email!.any((d) => d.language == language) && selectedPoint.email!.firstWhere((d) => d.language == language).value != null && selectedPoint.email!.firstWhere((d) => d.language == language).value!.trim().isNotEmpty ? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.email, color: primaryColor, size: 13),
Padding(
padding: const EdgeInsets.all(4.0),
child: AutoSizeText(parse(selectedPoint.email!.firstWhere((p) => p.language == language).value!).documentElement!.text, style: const TextStyle(fontSize: 18), maxLines: 3),
)
],
): const SizedBox(),
selectedPoint.site != null && selectedPoint.site!.isNotEmpty && selectedPoint.site!.any((d) => d.language == language) && selectedPoint.site!.firstWhere((d) => d.language == language).value != null && selectedPoint.site!.firstWhere((d) => d.language == language).value!.trim().isNotEmpty ? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.public, color: primaryColor, size: 13),
Padding(
padding: const EdgeInsets.all(4.0),
child: AutoSizeText(parse(selectedPoint.site!.firstWhere((p) => p.language == language).value!).documentElement!.text, style: const TextStyle(fontSize: 18), maxLines: 3),
)
],
): const SizedBox(),
],
),
),
],
),
) )
], ],
) ),
], ),
), ),
], ),
),
/*Align( /*Align(
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
child: Padding( child: Padding(
@ -560,6 +461,31 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
), ),
), ),
),*/ ),*/
Positioned(
right: 6.5,
top: 12.5,
child: GestureDetector(
onTap: () {
setState(() {
mapContext.setSelectedPoint(null);
mapContext.setSelectedPointForNavigate(null);
});
},
child: Container(
width: 50,
height: 50,
decoration: BoxDecoration(
color: primaryColor,
shape: BoxShape.circle,
),
child: const Icon(
Icons.close,
size: 25,
color: Colors.white,
),
),
),
),
]) ])
), ),
), ),
@ -592,8 +518,9 @@ getElementForResource(BuildContext context, AppContext appContext, ContentDTO i,
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)), borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
color: kBackgroundColor, color: kBackgroundColor,
), ),
height: size.height * 0.8, constraints: const BoxConstraints(minWidth: 250, minHeight: 250, maxHeight: 350),
width: size.width * 0.8, height: size.height * 0.6,
width: size.width * 0.85,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
//color: Colors.yellow, //color: Colors.yellow,
@ -653,8 +580,9 @@ getElementForResource(BuildContext context, AppContext appContext, ContentDTO i,
borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)), borderRadius: BorderRadius.all(Radius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 20.0)),
color: kBackgroundColor, color: kBackgroundColor,
), ),
height: size.height * 0.8, constraints: const BoxConstraints(minWidth: 250, minHeight: 250, maxHeight: 350),
width: size.width * 0.8, height: size.height * 0.6,
width: size.width * 0.85,
child: Center(child: showElementForResource(ResourceDTO(id: i.resourceId, url: i.resource?.url, type: i.resource?.type), appContext, false, true)), child: Center(child: showElementForResource(ResourceDTO(id: i.resourceId, url: i.resource?.url, type: i.resource?.type), appContext, false, true)),
), ),
); );
@ -666,7 +594,6 @@ getElementForResource(BuildContext context, AppContext appContext, ContentDTO i,
ignoring: i.resource!.type != ResourceType.Audio, ignoring: i.resource!.type != ResourceType.Audio,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.yellow,
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 15.0), borderRadius: BorderRadius.circular(visitAppContext.configuration!.roundedValue?.toDouble() ?? 15.0),
), ),

View File

@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_beacon/flutter_beacon.dart'; import 'package:flutter_beacon/flutter_beacon.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:mapbox_maps_flutter/mapbox_maps_flutter.dart';
import 'package:mymuseum_visitapp/Helpers/requirement_state_controller.dart'; import 'package:mymuseum_visitapp/Helpers/requirement_state_controller.dart';
import 'package:mymuseum_visitapp/Models/articleRead.dart'; import 'package:mymuseum_visitapp/Models/articleRead.dart';
import 'package:mymuseum_visitapp/Screens/Home/home.dart'; import 'package:mymuseum_visitapp/Screens/Home/home.dart';
@ -26,6 +27,8 @@ void main() async {
Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationDocumentsDirectory() : await getDownloadsDirectory(); Directory? appDocumentsDirectory = Platform.isIOS ? await getApplicationDocumentsDirectory() : await getDownloadsDirectory();
String localPath = appDocumentsDirectory!.path; String localPath = appDocumentsDirectory!.path;
MapboxOptions.setAccessToken("pk.eyJ1IjoidGZyYW5zb2xldCIsImEiOiJjbHRpcGNvZDYwYWhkMnFxdmF0ampveW10In0.7xHN0NGvUfQu5ThS3RGJRw"); // TODO put in json file or resource file
if(localContext != null) { if(localContext != null) {
print("we've got an local db !"); print("we've got an local db !");
print(localContext); print(localContext);