mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 16:41: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.press,
|
||||
this.icon,
|
||||
this.color = kMainRed,
|
||||
this.color = kTestSecondColor,
|
||||
this.textColor = Colors.white,
|
||||
this.fontSize,
|
||||
this.vertical,
|
||||
@ -37,7 +37,7 @@ class RoundedButton extends StatelessWidget {
|
||||
backgroundColor: MaterialStateColor.resolveWith((states) => color!),
|
||||
shape: MaterialStateProperty.all<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");
|
||||
return CachedNetworkImage(
|
||||
imageUrl: tabletAppContext.configuration!.loaderImageUrl!,
|
||||
progressIndicatorBuilder: (context, url, downloadProgress) =>
|
||||
CircularProgressIndicator(value: downloadProgress.progress, color: primaryColor),
|
||||
progressIndicatorBuilder: (context, url, downloadProgress) => CircularProgressIndicator(value: downloadProgress.progress, color: primaryColor),
|
||||
errorWidget: (context, url, error) => Icon(Icons.error),
|
||||
);
|
||||
} else {
|
||||
|
||||
@ -17,7 +17,7 @@ class RoundedInputField extends StatelessWidget {
|
||||
this.icon,
|
||||
this.color = kBackgroundGrey,
|
||||
this.textColor = kMainGrey,
|
||||
this.iconColor = kMainRed,
|
||||
this.iconColor = kTestSecondColor,
|
||||
this.onChanged,
|
||||
this.maxLength, // 50
|
||||
this.isString = true,
|
||||
|
||||
@ -58,14 +58,14 @@ class _SectionPageDetailState extends State<SectionPageDetail> {
|
||||
child: Container(
|
||||
height: size.height,
|
||||
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(
|
||||
image: new DecorationImage(
|
||||
fit: BoxFit.cover,
|
||||
colorFilter: new ColorFilter.mode(Colors.white.withOpacity(0.8), BlendMode.lighten),
|
||||
image: ImageCustomProvider.getImageProvider(appContext, widget.configurationDTO.imageId!, widget.configurationDTO.imageSource!),
|
||||
),
|
||||
) : null,
|
||||
) : null,*/
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'dart:math';
|
||||
//import 'package:animated_tree_view/animated_tree_view.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -69,8 +70,11 @@ class _GeoPointFilterState extends State<GeoPointFilter> {
|
||||
// Pour chaque point sans categorie, créer un noeud
|
||||
for(var pointWithoutCat in geoPoints.where((gp) => gp.categorieId == null && gp.categorie == null))
|
||||
{
|
||||
|
||||
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,
|
||||
children: [],
|
||||
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)) {
|
||||
if (geoPoint.categorieId == category.id) {
|
||||
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,
|
||||
checked: true, // default true
|
||||
show: false,
|
||||
@ -139,12 +145,16 @@ class _GeoPointFilterState extends State<GeoPointFilter> {
|
||||
if (node.children.isNotEmpty) {
|
||||
for (var childNode in node.children) {
|
||||
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 {
|
||||
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,9 +167,17 @@ class _GeoPointFilterState extends State<GeoPointFilter> {
|
||||
List<TreeNode> filteredNodes = [];
|
||||
for (var node in buildTreeNodes(widget.categories, widget.geoPoints)) {
|
||||
if (_nodeOrChildrenContainsText(node, searchText)) {
|
||||
if(node.children.isNotEmpty) {
|
||||
for (var childNode in node.children) {
|
||||
if (_nodeOrChildrenContainsText(childNode, searchText)) {
|
||||
filteredNodes.add(childNode);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
filteredNodes.add(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
return filteredNodes;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user