mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 08:31:19 +00:00
Fix localisation bug
This commit is contained in:
parent
1db1c78538
commit
2428d22558
@ -18,7 +18,7 @@ class RoundedButton extends StatelessWidget {
|
|||||||
this.text,
|
this.text,
|
||||||
this.press,
|
this.press,
|
||||||
this.icon,
|
this.icon,
|
||||||
this.color = kMainRed,
|
this.color = kTestSecondColor,
|
||||||
this.textColor = Colors.white,
|
this.textColor = Colors.white,
|
||||||
this.fontSize,
|
this.fontSize,
|
||||||
this.vertical,
|
this.vertical,
|
||||||
@ -37,7 +37,7 @@ class RoundedButton extends StatelessWidget {
|
|||||||
backgroundColor: MaterialStateColor.resolveWith((states) => color!),
|
backgroundColor: MaterialStateColor.resolveWith((states) => color!),
|
||||||
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
|
||||||
RoundedRectangleBorder(
|
RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(tabletAppContext.configuration!.roundedValue?.toDouble() ?? 20.0),
|
borderRadius: BorderRadius.circular(tabletAppContext.configuration?.roundedValue?.toDouble() ?? 20.0),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|||||||
@ -71,8 +71,7 @@ class _LoadingCommonState extends State<LoadingCommon> with TickerProviderStateM
|
|||||||
print("not a local loader succck");
|
print("not a local loader succck");
|
||||||
return CachedNetworkImage(
|
return CachedNetworkImage(
|
||||||
imageUrl: tabletAppContext.configuration!.loaderImageUrl!,
|
imageUrl: tabletAppContext.configuration!.loaderImageUrl!,
|
||||||
progressIndicatorBuilder: (context, url, downloadProgress) =>
|
progressIndicatorBuilder: (context, url, downloadProgress) => CircularProgressIndicator(value: downloadProgress.progress, color: primaryColor),
|
||||||
CircularProgressIndicator(value: downloadProgress.progress, color: primaryColor),
|
|
||||||
errorWidget: (context, url, error) => Icon(Icons.error),
|
errorWidget: (context, url, error) => Icon(Icons.error),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class RoundedInputField extends StatelessWidget {
|
|||||||
this.icon,
|
this.icon,
|
||||||
this.color = kBackgroundGrey,
|
this.color = kBackgroundGrey,
|
||||||
this.textColor = kMainGrey,
|
this.textColor = kMainGrey,
|
||||||
this.iconColor = kMainRed,
|
this.iconColor = kTestSecondColor,
|
||||||
this.onChanged,
|
this.onChanged,
|
||||||
this.maxLength, // 50
|
this.maxLength, // 50
|
||||||
this.isString = true,
|
this.isString = true,
|
||||||
|
|||||||
@ -58,14 +58,14 @@ class _SectionPageDetailState extends State<SectionPageDetail> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
height: size.height,
|
height: size.height,
|
||||||
width: size.width,
|
width: size.width,
|
||||||
color: widget.configurationDTO.imageId == null ? widget.configurationDTO.secondaryColor != null ? new Color(int.parse(widget.configurationDTO.secondaryColor!.split('(0x')[1].split(')')[0], radix: 16)): kBackgroundGrey : null,
|
/*color: widget.configurationDTO.imageId == null ? widget.configurationDTO.secondaryColor != null ? new Color(int.parse(widget.configurationDTO.secondaryColor!.split('(0x')[1].split(')')[0], radix: 16)): kBackgroundGrey : null,
|
||||||
decoration: widget.configurationDTO.imageId != null ? BoxDecoration(
|
decoration: widget.configurationDTO.imageId != null ? BoxDecoration(
|
||||||
image: new DecorationImage(
|
image: new DecorationImage(
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
colorFilter: new ColorFilter.mode(Colors.white.withOpacity(0.8), BlendMode.lighten),
|
colorFilter: new ColorFilter.mode(Colors.white.withOpacity(0.8), BlendMode.lighten),
|
||||||
image: ImageCustomProvider.getImageProvider(appContext, widget.configurationDTO.imageId!, widget.configurationDTO.imageSource!),
|
image: ImageCustomProvider.getImageProvider(appContext, widget.configurationDTO.imageId!, widget.configurationDTO.imageSource!),
|
||||||
),
|
),
|
||||||
) : null,
|
) : null,*/
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'dart:math';
|
||||||
//import 'package:animated_tree_view/animated_tree_view.dart';
|
//import 'package:animated_tree_view/animated_tree_view.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -69,8 +70,11 @@ class _GeoPointFilterState extends State<GeoPointFilter> {
|
|||||||
// Pour chaque point sans categorie, créer un noeud
|
// Pour chaque point sans categorie, créer un noeud
|
||||||
for(var pointWithoutCat in geoPoints.where((gp) => gp.categorieId == null && gp.categorie == null))
|
for(var pointWithoutCat in geoPoints.where((gp) => gp.categorieId == null && gp.categorie == null))
|
||||||
{
|
{
|
||||||
|
|
||||||
TreeNode nodeWithoutCat = TreeNode(
|
TreeNode nodeWithoutCat = TreeNode(
|
||||||
id: int.parse(pointWithoutCat.latitude!.substring(0,10).replaceAll(".", "")+pointWithoutCat.longitude!.substring(0,10).replaceAll(".", "")),
|
id: int.parse(
|
||||||
|
(pointWithoutCat.latitude ?? '').substring(0, min(pointWithoutCat.latitude!.length, 10)).replaceAll(".", "") + (pointWithoutCat.longitude ?? '').substring(0, min(pointWithoutCat.longitude!.length, 10)).replaceAll(".", "")
|
||||||
|
),
|
||||||
title: parse(pointWithoutCat.title!.firstWhere((l) => l.language == widget.language).value!).documentElement!.text,
|
title: parse(pointWithoutCat.title!.firstWhere((l) => l.language == widget.language).value!).documentElement!.text,
|
||||||
children: [],
|
children: [],
|
||||||
checked: true, // default true
|
checked: true, // default true
|
||||||
@ -97,7 +101,9 @@ class _GeoPointFilterState extends State<GeoPointFilter> {
|
|||||||
for (var geoPoint in geoPoints.where((gp) => gp.categorie != null || gp.categorieId != null)) {
|
for (var geoPoint in geoPoints.where((gp) => gp.categorie != null || gp.categorieId != null)) {
|
||||||
if (geoPoint.categorieId == category.id) {
|
if (geoPoint.categorieId == category.id) {
|
||||||
TreeNode geoPointNode = TreeNode(
|
TreeNode geoPointNode = TreeNode(
|
||||||
id: int.parse(geoPoint.latitude!.substring(0,10).replaceAll(".", "")+geoPoint.longitude!.substring(0,10).replaceAll(".", "")),
|
id: int.parse(
|
||||||
|
(geoPoint.latitude ?? '').substring(0, min(geoPoint.latitude!.length, 10)).replaceAll(".", "") + (geoPoint.longitude ?? '').substring(0, min(geoPoint.longitude!.length, 10)).replaceAll(".", "")
|
||||||
|
),
|
||||||
title: parse(geoPoint.title!.firstWhere((l) => l.language == widget.language).value!).documentElement!.text,
|
title: parse(geoPoint.title!.firstWhere((l) => l.language == widget.language).value!).documentElement!.text,
|
||||||
checked: true, // default true
|
checked: true, // default true
|
||||||
show: false,
|
show: false,
|
||||||
@ -139,12 +145,16 @@ class _GeoPointFilterState extends State<GeoPointFilter> {
|
|||||||
if (node.children.isNotEmpty) {
|
if (node.children.isNotEmpty) {
|
||||||
for (var childNode in node.children) {
|
for (var childNode in node.children) {
|
||||||
if (childNode.checked) {
|
if (childNode.checked) {
|
||||||
checkedGeoPoints.add(widget.geoPoints.firstWhere((point) => int.parse(point.latitude!.substring(0,10).replaceAll(".", "")+point.longitude!.substring(0,10).replaceAll(".", "")) == childNode.id));
|
checkedGeoPoints.add(widget.geoPoints.firstWhere((point) => int.parse(
|
||||||
|
(point.latitude ?? '').substring(0, min(point.latitude!.length, 10)).replaceAll(".", "") + (point.longitude ?? '').substring(0, min(point.longitude!.length, 10)).replaceAll(".", "")
|
||||||
|
) == childNode.id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(node.checked) {
|
if(node.checked) {
|
||||||
checkedGeoPoints.add(widget.geoPoints.firstWhere((point) => int.parse(point.latitude!.substring(0,10).replaceAll(".", "")+point.longitude!.substring(0,10).replaceAll(".", "")) == node.id));
|
checkedGeoPoints.add(widget.geoPoints.firstWhere((point) => int.parse(
|
||||||
|
(point.latitude ?? '').substring(0, min(point.latitude!.length, 10)).replaceAll(".", "") + (point.longitude ?? '').substring(0, min(point.longitude!.length, 10)).replaceAll(".", "")
|
||||||
|
) == node.id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -157,7 +167,15 @@ class _GeoPointFilterState extends State<GeoPointFilter> {
|
|||||||
List<TreeNode> filteredNodes = [];
|
List<TreeNode> filteredNodes = [];
|
||||||
for (var node in buildTreeNodes(widget.categories, widget.geoPoints)) {
|
for (var node in buildTreeNodes(widget.categories, widget.geoPoints)) {
|
||||||
if (_nodeOrChildrenContainsText(node, searchText)) {
|
if (_nodeOrChildrenContainsText(node, searchText)) {
|
||||||
filteredNodes.add(node);
|
if(node.children.isNotEmpty) {
|
||||||
|
for (var childNode in node.children) {
|
||||||
|
if (_nodeOrChildrenContainsText(childNode, searchText)) {
|
||||||
|
filteredNodes.add(childNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
filteredNodes.add(node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return filteredNodes;
|
return filteredNodes;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user