updated new flutter version
This commit is contained in:
@@ -275,20 +275,40 @@ class CheckOptionsState extends OptionsBaseState<CheckOptions> {
|
||||
}
|
||||
}
|
||||
|
||||
var disabledRule = Rule.getRule(extraJson, Rule.RULE_DISABLED_IF_FIELD_EQUALS_TO);
|
||||
var disabledRule =
|
||||
Rule.getRule(extraJson, Rule.RULE_DISABLED_IF_FIELD_EQUALS_TO);
|
||||
if (disabledRule != null) {
|
||||
if (disabledRule is List) {
|
||||
for (var i = 0; i < (disabledRule as List).length; i++) {
|
||||
Map<String, dynamic> disabledRule1 = disabledRule[i];
|
||||
List<String> attValues = Utils.getSelectedAttributeValue(selections, disabledRule1[Rule.RULE_KEY_FIELD_KEY]);
|
||||
if (attValues.length > 0 && disabledRule1.containsKey(attValues[0])) {
|
||||
List<String> attValues = Utils.getSelectedAttributeValue(
|
||||
selections, disabledRule1[Rule.RULE_KEY_FIELD_KEY]);
|
||||
if (attValues.length > 0 &&
|
||||
disabledRule1.containsKey(attValues[0])) {
|
||||
disabled = true;
|
||||
}
|
||||
if (attValues.length > 0) {
|
||||
for (String s in attValues) {
|
||||
if (disabledRule1.containsKey(s) && disabledRule1[s]) {
|
||||
disabled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (disabled) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<String> attValues = Utils.getSelectedAttributeValue(selections, disabledRule[Rule.RULE_KEY_FIELD_KEY]);
|
||||
if (attValues.length > 0 && disabledRule.containsKey(attValues[0])) {
|
||||
disabled = true;
|
||||
List<String> attValues = Utils.getSelectedAttributeValue(
|
||||
selections, disabledRule[Rule.RULE_KEY_FIELD_KEY]);
|
||||
if (attValues.length > 0) {
|
||||
for (String s in attValues) {
|
||||
if (disabledRule.containsKey(s) && disabledRule[s]) {
|
||||
disabled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,20 +283,40 @@ class QtyOptionsState extends OptionsBaseState<QtyOptions> {
|
||||
}
|
||||
}
|
||||
|
||||
var disabledRule = Rule.getRule(extraJson, Rule.RULE_DISABLED_IF_FIELD_EQUALS_TO);
|
||||
var disabledRule =
|
||||
Rule.getRule(extraJson, Rule.RULE_DISABLED_IF_FIELD_EQUALS_TO);
|
||||
if (disabledRule != null) {
|
||||
if (disabledRule is List) {
|
||||
for (var i = 0; i < (disabledRule as List).length; i++) {
|
||||
Map<String, dynamic> disabledRule1 = disabledRule[i];
|
||||
List<String> attValues = Utils.getSelectedAttributeValue(selections, disabledRule1[Rule.RULE_KEY_FIELD_KEY]);
|
||||
if (attValues.length > 0 && disabledRule1.containsKey(attValues[0])) {
|
||||
List<String> attValues = Utils.getSelectedAttributeValue(
|
||||
selections, disabledRule1[Rule.RULE_KEY_FIELD_KEY]);
|
||||
if (attValues.length > 0 &&
|
||||
disabledRule1.containsKey(attValues[0])) {
|
||||
disabled = true;
|
||||
}
|
||||
if (attValues.length > 0) {
|
||||
for (String s in attValues) {
|
||||
if (disabledRule1.containsKey(s) && disabledRule1[s]) {
|
||||
disabled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (disabled) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<String> attValues = Utils.getSelectedAttributeValue(selections, disabledRule[Rule.RULE_KEY_FIELD_KEY]);
|
||||
if (attValues.length > 0 && disabledRule.containsKey(attValues[0])) {
|
||||
disabled = true;
|
||||
List<String> attValues = Utils.getSelectedAttributeValue(
|
||||
selections, disabledRule[Rule.RULE_KEY_FIELD_KEY]);
|
||||
if (attValues.length > 0) {
|
||||
for (String s in attValues) {
|
||||
if (disabledRule.containsKey(s) && disabledRule[s]) {
|
||||
disabled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,20 +187,40 @@ class RadioOptionsState extends OptionsBaseState<RadioOptions> {
|
||||
}
|
||||
}
|
||||
|
||||
var disabledRule = Rule.getRule(extraJson, Rule.RULE_DISABLED_IF_FIELD_EQUALS_TO);
|
||||
var disabledRule =
|
||||
Rule.getRule(extraJson, Rule.RULE_DISABLED_IF_FIELD_EQUALS_TO);
|
||||
if (disabledRule != null) {
|
||||
if (disabledRule is List) {
|
||||
for (var i = 0; i < (disabledRule as List).length; i++) {
|
||||
Map<String, dynamic> disabledRule1 = disabledRule[i];
|
||||
List<String> attValues = Utils.getSelectedAttributeValue(selections, disabledRule1[Rule.RULE_KEY_FIELD_KEY]);
|
||||
if (attValues.length > 0 && disabledRule1.containsKey(attValues[0])) {
|
||||
List<String> attValues = Utils.getSelectedAttributeValue(
|
||||
selections, disabledRule1[Rule.RULE_KEY_FIELD_KEY]);
|
||||
if (attValues.length > 0 &&
|
||||
disabledRule1.containsKey(attValues[0])) {
|
||||
disabled = true;
|
||||
}
|
||||
if (attValues.length > 0) {
|
||||
for (String s in attValues) {
|
||||
if (disabledRule1.containsKey(s) && disabledRule1[s]) {
|
||||
disabled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (disabled) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<String> attValues = Utils.getSelectedAttributeValue(selections, disabledRule[Rule.RULE_KEY_FIELD_KEY]);
|
||||
if (attValues.length > 0 && disabledRule.containsKey(attValues[0])) {
|
||||
disabled = true;
|
||||
List<String> attValues = Utils.getSelectedAttributeValue(
|
||||
selections, disabledRule[Rule.RULE_KEY_FIELD_KEY]);
|
||||
if (attValues.length > 0) {
|
||||
for (String s in attValues) {
|
||||
if (disabledRule.containsKey(s) && disabledRule[s]) {
|
||||
disabled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import "package:universal_html/html.dart";
|
||||
|
||||
import '../../constants.dart';
|
||||
import '../../generated/l10n.dart';
|
||||
@@ -22,7 +23,7 @@ class DownloadItem extends StatefulWidget {
|
||||
}
|
||||
|
||||
class DownloadItemState extends State<DownloadItem> {
|
||||
final double buttonWidth = 114.0;
|
||||
final double buttonWidth = 122.0;
|
||||
final double iconWidth = 48.0;
|
||||
|
||||
@override
|
||||
@@ -275,8 +276,14 @@ class DownloadItemState extends State<DownloadItem> {
|
||||
],
|
||||
),
|
||||
onPressed: () async {
|
||||
if (await canLaunch(downloadUrl)) {
|
||||
await launch('$downloadUrl');
|
||||
if (kIsWeb) {
|
||||
AnchorElement anchorElement = new AnchorElement(href: downloadUrl);
|
||||
anchorElement.download = downloadUrl;
|
||||
anchorElement.click();
|
||||
} else {
|
||||
if (!await launchUrl(Uri.parse('$downloadUrl'))) {
|
||||
throw 'Could not launch $downloadUrl';
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user