mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 16:41:19 +00:00
Update price layout in marker view
This commit is contained in:
parent
89aeb4086f
commit
da557503fc
@ -46,6 +46,8 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
int breakPointPrice = 40;
|
||||||
|
|
||||||
Size size = MediaQuery.of(context).size;
|
Size size = MediaQuery.of(context).size;
|
||||||
final mapContext = Provider.of<MapContext>(context);
|
final mapContext = Provider.of<MapContext>(context);
|
||||||
final appContext = Provider.of<AppContext>(context);
|
final appContext = Provider.of<AppContext>(context);
|
||||||
@ -53,6 +55,9 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
var language = tabletAppContext.language;
|
var language = tabletAppContext.language;
|
||||||
GeoPointDTO? selectedPoint = mapContext.getSelectedPoint() as GeoPointDTO?;
|
GeoPointDTO? selectedPoint = mapContext.getSelectedPoint() as GeoPointDTO?;
|
||||||
|
|
||||||
|
ScrollController scrollDescription = new ScrollController();
|
||||||
|
ScrollController scrollPrice = new 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().length > 0;
|
||||||
|
|
||||||
Color primaryColor = new Color(int.parse(tabletAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16));
|
Color primaryColor = new Color(int.parse(tabletAppContext.configuration!.primaryColor!.split('(0x')[1].split(')')[0], radix: 16));
|
||||||
@ -153,7 +158,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
//color: Colors.green,
|
//color: Colors.green,
|
||||||
height: size.height * 0.06,
|
height: size.height * 0.06,
|
||||||
width: size.width * 0.75,
|
width: size.width * 0.65,
|
||||||
child: HtmlWidget(
|
child: HtmlWidget(
|
||||||
selectedPoint.title!.firstWhere((t) => t.language == language).value!,
|
selectedPoint.title!.firstWhere((t) => t.language == language).value!,
|
||||||
textStyle: TextStyle(fontSize: 23.0),
|
textStyle: TextStyle(fontSize: 23.0),
|
||||||
@ -168,7 +173,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
height: isPointPrice ? size.height * 0.45 : size.height * 0.7,
|
height: isPointPrice && selectedPoint.prices!.firstWhere((d) => d.language == language).value!.length > breakPointPrice ? size.height * 0.45 : size.height * 0.7,
|
||||||
width: size.width * 0.38,
|
width: size.width * 0.38,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: kBackgroundLight,
|
color: kBackgroundLight,
|
||||||
@ -177,9 +182,11 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15),
|
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15),
|
||||||
child: Scrollbar(
|
child: Scrollbar(
|
||||||
|
controller: scrollDescription,
|
||||||
thumbVisibility: true,
|
thumbVisibility: true,
|
||||||
thickness: 2.0,
|
thickness: 2.0,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
controller: scrollDescription,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -201,7 +208,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if(isPointPrice)
|
if(isPointPrice && selectedPoint.prices!.firstWhere((d) => d.language == language).value!.length > breakPointPrice)
|
||||||
Container(
|
Container(
|
||||||
height: size.height * 0.25,
|
height: size.height * 0.25,
|
||||||
width: size.width * 0.38,
|
width: size.width * 0.38,
|
||||||
@ -212,9 +219,11 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15),
|
padding: const EdgeInsets.only(left: 20, right: 10, bottom: 10, top: 15),
|
||||||
child: Scrollbar(
|
child: Scrollbar(
|
||||||
|
controller: scrollPrice,
|
||||||
thumbVisibility: true,
|
thumbVisibility: true,
|
||||||
thickness: 2.0,
|
thickness: 2.0,
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
|
controller: scrollPrice,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -226,7 +235,7 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
child: Icon(Icons.price_change_outlined, color: primaryColor, size: 25),
|
child: Icon(Icons.price_change_outlined, color: primaryColor, size: 25),
|
||||||
)),
|
)),
|
||||||
HtmlWidget(
|
HtmlWidget(
|
||||||
selectedPoint.prices!.firstWhere((d) => d.language == language).value!+"sdsdsdsdsdsdsdsdsdsdsdsdsdsdsdsdsdsdsd sdkljsdkj sdklj sldkj klsdj klsdj klsd",
|
selectedPoint.prices!.firstWhere((d) => d.language == language).value!,
|
||||||
customStylesBuilder: (element) {
|
customStylesBuilder: (element) {
|
||||||
return {'text-align': 'left', 'font-family': "Roboto"};
|
return {'text-align': 'left', 'font-family': "Roboto"};
|
||||||
},
|
},
|
||||||
@ -282,6 +291,62 @@ class _MarkerInfoWidget extends State<MarkerViewWidget> {
|
|||||||
padding: const EdgeInsets.only(top: 10.0),
|
padding: const EdgeInsets.only(top: 10.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
/*if(isPointPrice && selectedPoint.prices!.firstWhere((d) => d.language == language).value!.length > breakPointPrice)
|
||||||
|
Container(
|
||||||
|
height: size.height * 0.1,
|
||||||
|
width: size.width * 0.38,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: kBackgroundLight,
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(tabletAppContext.configuration!.roundedValue?.toDouble() ?? 20.0))
|
||||||
|
),
|
||||||
|
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(
|
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,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user