Commit cb1eaf83 authored by Koen van der Veen's avatar Koen van der Veen
Browse files

Merge branch 'dev' of gitlab.memri.io:memri/flutter-app into release/0.0.2

parents 22363c6e f11d5515
Pipeline #6398 passed with stages
in 9 minutes and 2 seconds
Showing with 555 additions and 297 deletions
+555 -297
.labellingAnnotation {
additional: {
HStack {
alignment: left
padding: 50
Button {
onPress: [
openView
{
item: {{.~labellingTask.~dataset}}
viewArguments: {
pageLabel: "~main"
selectedProject: {{.}}
}
viewName: "project-overview"
}
]
styleName: primaryButton
Text {
text: "Finish labelling"
textalign: bottom
}
Image {
alignment: center
bundleImage: "ico_arrow"
isVector: true
padding: 0 0 0 15
}
}
}
}
cols: 9
defaultRenderer: labelAnnotation
emptyResultText: "There are no annotations here yet"
......@@ -59,7 +26,7 @@
Text {
font: headline2
padding: 0 0 30 0
text: {{labellingTask.~labellingTask.datasetType.name}}
text: {{labellingTask.~labellingTask.name}}
}
SubView {
......@@ -247,6 +214,38 @@
}
}
}
HStack {
alignment: left
padding: 10 0 0 0
Button {
onPress: [
openView
{
item: {{labellingTask.~labellingTask.~dataset}}
viewArguments: {
pageLabel: "~main"
selectedProject: {{.}}
}
viewName: "project-overview"
}
]
styleName: primaryButton
Text {
text: "Continue"
textalign: bottom
}
Image {
alignment: center
bundleImage: "ico_arrow"
isVector: true
padding: 0 0 0 15
}
}
}
}
}
}
......
......@@ -91,14 +91,14 @@
}
.labellingAnnotationPreview {
cols: 6
cols: 8
defaultRenderer: labelAnnotation
emptyResultText: "There are no annotations here yet"
inPreviewMode: true
}
.labellingPreview {
cols: 10
cols: 12
defaultRenderer: scene
name: "labellingPreview"
title: "Preview labelling editor"
......@@ -116,7 +116,10 @@
.labellingCVUEditor {
cols: 4
customDefinition: {{labellingTask.view.definition}}
defaultRenderer: cvuEditor
mode: customLocation
viewArguments: {
labellingTask: {{labellingTask}}
customDefinition: {{labellingTask.view.definition}}
}
}
\ No newline at end of file
......@@ -15,34 +15,6 @@
}
.inbox-channels {
additional: {
Button {
onPress: noop
HStack {
alignment: left
padding: 13 0 7 0
Image {
bundleImage: "plus"
color: #FE570F
cornerRadius: 50
isVector: true
maxHeight: 30
maxWidth: 30
minHeight: 30
minWidth: 30
sizingMode: fill
}
Text {
color: #FE570F
font: 12 regular
text: "Compose"
}
}
}
}
cols: 4
defaultRenderer: list
emptyResult: {
......
.GmailImporterRun {
defaultRenderer: singleItem
showSearchBar: false
showContextualBottomBar: false
showBottomBar: false
showContextualBottomBar: false
showSearchBar: false
title: "Connect Gmail account"
[renderer = singleItem]{
[renderer = singleItem] {
}
Plugin > singleItem {
......@@ -15,242 +14,359 @@
padding: 60 30 0 30
Text {
text: "Authenticate your Gmail account"
color: #333333
font: headline3
padding: 0 0 60 0
text: "Authenticate your Gmail account"
}
Text {
text: "Step 1"
font: link
padding: 0 0
text: "Step 1"
}
Text {
text: "Enable two-factor authentication"
font: headline1
text: "Enable two-factor authentication"
}
HStack {
alignment: left
Image {
alignment: center
bundleImage: "arrow-right-circle"
color: #989898
font: 20
isVector: true
alignment: center
resizable: true
sizingMode: fit
color: #989898
font: 20
}
Text {
text: "Log in to your Google Account."
font: bodyText2
RichText {
color: #737373
font: bodyText2
spans: [
{
text: "Log in to your "
}
{
color: #E9500F
onPress: [
openLink
{
link: "https://myaccount.google.com/"
}
]
text: "Google Account"
}
]
}
}
HStack {
alignment: left
Image {
alignment: center
bundleImage: "arrow-right-circle"
color: #989898
font: 20
isVector: true
alignment: center
resizable: true
sizingMode: fit
color: #989898
font: 20
}
Text {
text: "In the navigation panel, select Security."
font: bodyText2
RichText {
color: #737373
font: bodyText2
spans: [
{
text: "In the navigation panel, select "
}
{
color: #E9500F
onPress: [
openLink
{
link: "https://myaccount.google.com/security"
}
]
text: "Security"
}
]
}
}
HStack {
alignment: left
Image {
alignment: center
bundleImage: "arrow-right-circle"
color: #989898
font: 20
isVector: true
alignment: center
resizable: true
sizingMode: fit
color: #989898
font: 20
}
Text {
text: "Under “Signing in to Google,” select 2-Step Verification and then Get started."
font: bodyText2
RichText {
color: #737373
font: bodyText2
spans: [
{
text: "Under “Signing in to Google,” select "
}
{
font: 12 bold
text: "2-Step Verification"
}
{
text: " and "
}
{
font: 12 bold
text: "Get started."
}
]
}
}
HStack {
alignment: left
padding: 0 0 25 0
Image {
alignment: center
bundleImage: "arrow-right-circle"
color: #989898
font: 20
isVector: true
alignment: center
resizable: true
sizingMode: fit
color: #989898
font: 20
}
Text {
text: "Follow the on-screen steps."
font: bodyText2
color: #737373
font: bodyText2
text: "Follow the on-screen steps."
}
}
Text {
text: "Step 2"
font: link
padding: 60 0 0
text: "Step 2"
}
Text {
text: "Enable IMAP forwarding"
font: headline1
text: "Enable IMAP forwarding"
}
HStack {
alignment: left
Image {
alignment: center
bundleImage: "arrow-right-circle"
color: #989898
font: 20
isVector: true
alignment: center
resizable: true
sizingMode: fit
color: #989898
font: 20
}
Text {
text: "Go to your Google Account and select Security."
font: bodyText2
RichText {
color: #737373
font: bodyText2
spans: [
{
text: "Go to your Google Account and select "
}
{
color: #E9500F
onPress: [
openLink
{
link: "https://myaccount.google.com/security"
}
]
text: "Security"
}
]
}
}
HStack {
alignment: left
Image {
alignment: center
bundleImage: "arrow-right-circle"
color: #989898
font: 20
isVector: true
alignment: center
resizable: true
sizingMode: fit
color: #989898
font: 20
}
Text {
text: 'Under "Signing in to Google," select App Passwords. You may need to sign in.'
font: bodyText2
RichText {
color: #737373
font: bodyText2
spans: [
{
text: "Under \"Signing in to Google,\" select "
}
{
color: #E9500F
onPress: [
openLink
{
link: "https://myaccount.google.com/apppasswords"
}
]
text: "App Passwords."
}
{
text: " You may need to sign in."
}
]
}
}
HStack {
alignment: left
Image {
alignment: center
bundleImage: "arrow-right-circle"
color: #989898
font: 20
isVector: true
alignment: center
resizable: true
sizingMode: fit
color: #989898
font: 20
}
Text {
text: "For Select App select Mail."
font: bodyText2
RichText {
color: #737373
font: bodyText2
spans: [
{
text: "For Select App select "
}
{
font: 12 bold
text: "Mail."
}
]
}
}
HStack {
alignment: left
Image {
alignment: center
bundleImage: "arrow-right-circle"
color: #989898
font: 20
isVector: true
alignment: center
resizable: true
sizingMode: fit
color: #989898
font: 20
}
Text {
text: "For Device select Other."
font: bodyText2
RichText {
color: #737373
font: bodyText2
spans: [
{
text: "For Device select "
}
{
font: 12 bold
text: "Other."
}
]
}
}
HStack {
alignment: left
Image {
alignment: center
bundleImage: "arrow-right-circle"
color: #989898
font: 20
isVector: true
alignment: center
resizable: true
sizingMode: fit
color: #989898
font: 20
}
Text {
text: "For Name type Memri."
font: bodyText2
RichText {
color: #737373
font: bodyText2
spans: [
{
text: "For Name type "
}
{
font: 12 bold
text: "Memri."
}
]
}
}
HStack {
alignment: left
Image {
alignment: center
bundleImage: "arrow-right-circle"
color: #989898
font: 20
isVector: true
alignment: center
resizable: true
sizingMode: fit
color: #989898
font: 20
}
Text {
text: "Tap Generate."
font: bodyText2
RichText {
color: #737373
font: bodyText2
spans: [
{
text: "Tap "
}
{
font: 12 bold
text: "Generate."
}
]
}
}
HStack {
alignment: left
padding: 0 0 25 0
Image {
alignment: center
bundleImage: "arrow-right-circle"
color: #989898
font: 20
isVector: true
alignment: center
resizable: true
sizingMode: fit
color: #989898
font: 20
}
Text {
text: "Save the generated password for the next step."
font: bodyText2
color: #737373
font: bodyText2
text: "Save the generated password for the next step."
}
}
......@@ -258,40 +374,39 @@
alignment: left
Button {
styleName: primaryButton
Text {
text: "Oke."
}
onPress: [
openView {
viewName: "pluginRunWait"
openView
{
clearStack: true
viewArguments {
viewArguments: {
}
viewName: "pluginRunWait"
}
pluginRun {
name: {{.name}}
pluginRun
{
container: {{.containerImage}}
name: {{.name}}
pluginId: {{.id}}
pluginModule: {{.pluginModule}}
pluginName: {{.pluginName}}
pluginId: {{.id}}
}
]
]
styleName: primaryButton
Text {
text: "Oke."
}
}
Button {
onPress: back
padding: 0 0 0 20
Text {
text: "Cancel"
font: button_label
color: #333333
font: button_label
text: "Cancel"
}
onPress: back
}
}
}
......
......@@ -186,6 +186,7 @@
maxHeight: 300
maxWidth: 300
src: {{.~account.authUrl}}
reload: true
}
HStack {
......
......@@ -3,49 +3,52 @@ EmailMessage > list {
VStack {
alignment: topleft
padding: 20
HStack {
alignment: left
Image {
image: {{.sender.owner.profilePicture or "assets/images/person.png"}}
sizingMode: fill
minHeight: 30
maxHeight: 30
minWidth: 30
maxWidth: 30
cornerRadius: 50
Circle {
color: {{.generaterandom("string", "color")}}
height: 30
width: 30
}
Text {
text: {{.sender.owner.fullName() ? .sender.owner.fullName() : .sender.identifier }}
font: 12 regular
color: #737373
VStack {
alignment: topleft
padding: 0 0 0 15
Text {
color: #333333
font: 13 regular
text: {{.sender.displayName OR .sender.identifier}}
}
Text {
color: #999999
font: body_tiny
show: {{.sender.displayName}}
text: {{.sender.identifier}}
}
}
Spacer
Text {
text: "{.dateSent}"
color: #989898
font: 10 regular
padding: 0 19 0 0
}
Image {
systemName: "ellipsis"
color: #DFDEDE
font: 24 light
padding: 5 0 5 0
VStack {
Text {
color: #989898
font: body_tiny
text: "{.dateSent.format('dd MMMM yyyy')}"
}
}
}
HTMLView {
maxHeight: 550
content: {{.content}}
Text {
color: #333333
font: headline3
padding: 20 0 0 0
text: {{.subject}}
}
}
}
......@@ -85,60 +88,77 @@ EmailMessage > timeline {
EmailMessage {
defaultRenderer: singleitem
[renderer = singleItem] {
edgeInset: 42 30 50 42
scrollable: false
}
}
EmailMessage > singleItem {
VStack {
alignment: topleft
Button {
onPress: back
padding: 0 0 0 0
Text {
color: #FE570F
font: tab_list
text: "< Back"
}
}
Text {
text: "{.subject}"
font: headline2
color: #333333
padding: 0 0 27 0
font: headline2
padding: 67 0 0 0
text: "{.subject}"
}
Divider
HStack {
alignment: left
padding: 32 0 12 5
Image {
image: {{.sender.owner.profilePicture}}
sizingMode: fill
minHeight: 30
maxHeight: 30
minWidth: 30
maxWidth: 30
cornerRadius: 50
Circle {
color: {{.generaterandom("string", "color")}}
height: 30
width: 30
}
Text {
text: "{.sender.owner.firstName} {.sender.owner.lastName}"
font: 12 regular
color: #737373
VStack {
alignment: topleft
padding: 0 0 0 15
Text {
color: #333333
font: 13 regular
text: {{.sender.displayName OR .sender.identifier}}
}
Text {
color: #999999
font: body_tiny
show: {{.sender.displayName}}
text: {{.sender.identifier}}
}
}
Spacer
Text {
text: "{.dateSent}"
color: #989898
font: 10 regular
padding: 0 19 0 0
}
Image {
systemName: "ellipsis"
color: #DFDEDE
font: 24 light
padding: 5 0 5 0
VStack {
Text {
color: #989898
font: body_tiny
text: "{.dateSent.format('dd MMMM yyyy')}"
}
}
}
HTMLView {
content: {{.content}}
maxHeight: 300
}
}
}
......@@ -40,79 +40,152 @@ MessageChannel {
}
.messageChannelView {
cols: 8
defaultRenderer: {{channel.~messageChannel[limit: 3].count() = 2 AND channel.~messageChannel.type != "Message" ? "singleItem" : "list"}}
item: {{.~messageChannel}}
showTopBar: false
defaultRenderer: list
title: {{channel.~messageChannel[sort: 'dateSent DESC', limit: 1].first().subject or channel.receiver.owner.fullname() or channel.name or channel.topic}}
cols: 6
titleActionButton: openView {
item: {{channel}}
}
title: {{channel.~messageChannel[sort: 'dateSent DESC', limit: 1].first().subject OR channel.receiver.owner.fullname() OR channel.name OR channel.topic}}
[datasource = pod] {
query: Message EmailMessage
filter: {
edgeTargets: {
messageChannel: {{channelUID}}
}
}
sortProperty: dateSent
query: Message EmailMessage
sortAscending: false
sortProperty: dateSent
}
[renderer = list] {
edgeInset: 0
hideSeparators: {{channel.~messageChannel.itemtype() = "Message" ? true : false}}
isReverse: true
hideSeparators: true
}
Message > list {
onPress: noop
}
Message > timeline {
onPress: noop
}
EmailMessage > list {
onPress: [
openView
{
renderer: singleItem
}
]
}
EmailMessage > singleItem {
onPress: noop
}
[renderer = singleItem] {
scrollable: false
}
MessageChannel > singleItem {
onPress: noop
scrollable: false
VStack {
SubView {
initialItem: {{.~messageChannel}}
view: {
defaultRenderer: singleItem
[renderer = singleItem] {
scrollable: false
}
}
}
}
}
}
MessageChannel > list {
onPress: [
openView
{
clearStack: true
viewArguments: {
channel: {{.}}
channelUID: {{.uid}}
pageLabel: "inboxData"
readOnly: true
}
viewName: messageChannelView
}
]
VStack {
alignment: topleft
HStack {
alignment: left
Image {
cornerRadius: 50
image: {{.~messageChannel.sender.owner.profilePicture OR .photo OR .receiver.profilePicture OR .receiver.owner.profilePicture OR .~messageChannel.sender.profilePicture OR "assets/images/person.png"}}
maxHeight: 30
maxWidth: 30
minHeight: 30
minWidth: 30
sizingMode: fill
}
Text {
color: #737373
font: 12 regular
text: {{.receiver.owner.fullName() OR .name OR .~messageChannel.sender.identifier}}
}
}
}
onPress: [
openView
{
clearStack: true
viewArguments: {
addPageIfMissing: true
channel: {{.}}
channelUID: {{.uid}}
pageLabel: "inboxData"
readOnly: true
}
viewName: messageChannelView
}
]
HStack {
alignment: left
padding: 10 0 10 0
VStack {
alignment: topleft
Circle {
color: {{.generaterandom("string", "color")}}
height: 30
show: {{.~messageChannel.itemType() = "EmailMessage"}}
width: 30
}
Image {
cornerRadius: 50
image: {{.~messageChannel.sender.owner.profilePicture OR .photo OR .receiver.profilePicture OR .receiver.owner.profilePicture OR .~messageChannel.sender.profilePicture OR "assets/images/person.png"}}
maxHeight: 30
maxWidth: 30
minHeight: 30
minWidth: 30
show: {{.~messageChannel.itemType() != "EmailMessage"}}
sizingMode: fill
}
}
VStack {
alignment: topleft
padding: 0 0 0 15
Text {
color: #333333
font: 13 regular
text: {{.~messageChannel.sender.displayName OR .~messageChannel.sender.identifier}}
}
Text {
color: #999999
font: body_tiny
show: {{.~messageChannel.sender.displayName}}
text: {{.~messageChannel.sender.identifier}}
}
}
Spacer
VStack {
padding: 0 19 0 0
Text {
color: #989898
font: body_tiny
text: "{.~messageChannel.last().dateSent.format('dd MMMM yyyy')}"
}
}
Image {
color: #DFDEDE
font: 24 light
padding: 5 0 5 0
systemName: "ellipsis"
}
}
}
.allMessageChannels {
......@@ -148,4 +221,4 @@ MessageChannel > timeline {
title: {{.receiver.owner.fullName()}}
text: {{.~messageChannel[sort: 'dateSent DESC', limit: 1].first().content.plainString() or "No messages"}}
}
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -2,12 +2,12 @@ import 'package:flutter/material.dart';
import 'package:memri/constants/cvu/cvu_font.dart';
final ButtonStyle primaryButtonStyle = TextButton.styleFrom(
backgroundColor: Color(0xff333333),
primary: Color(0xffF5F5F5),
textStyle: CVUFont.buttonLabel,
minimumSize: Size.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
padding: const EdgeInsets.all(10),
);
backgroundColor: Color(0xff333333),
primary: Color(0xffF5F5F5),
textStyle: CVUFont.buttonLabel,
minimumSize: Size.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
padding: const EdgeInsets.all(10),
onSurface: Colors.white);
final Map<String, ButtonStyle> buttonStyles = {"primaryButton": primaryButtonStyle};
......@@ -20,6 +20,7 @@ final lightTheme = ThemeData(
minimumSize: Size.zero,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
padding: const EdgeInsets.all(10.0))),
scrollbarTheme: const ScrollbarThemeData(isAlwaysShown: true),
pageTransitionsTheme: PageTransitionsTheme(builders: {
TargetPlatform.macOS: FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.iOS: FadeUpwardsPageTransitionsBuilder(),
......
......@@ -636,28 +636,60 @@ class CVULookupController {
if (type == null) {
return null;
}
var propertyExp = nodeType.args.asMap()[1];
String? property;
if (propertyExp != null) {
property = await resolve<String>(expression: propertyExp, context: context, db: db);
}
//TODO: other types if we will need this
switch (type.toLowerCase()) {
case "string":
currentValue = LookupStepValues([
PropertyDatabaseValueString(
MockDataGenerator.generateMockData(valueType: SchemaValueType.string))
PropertyDatabaseValueString(MockDataGenerator.generateMockData(
valueType: SchemaValueType.string, property: property))
]);
break;
case "int":
currentValue = LookupStepValues([
PropertyDatabaseValueInt(
MockDataGenerator.generateMockData(valueType: SchemaValueType.int))
PropertyDatabaseValueInt(MockDataGenerator.generateMockData(
valueType: SchemaValueType.int, property: property))
]);
break;
default:
currentValue = LookupStepValues([
PropertyDatabaseValueString(
MockDataGenerator.generateMockData(valueType: SchemaValueType.string))
PropertyDatabaseValueString(MockDataGenerator.generateMockData(
valueType: SchemaValueType.string, property: property))
]);
break;
}
break;
case "format":
if (currentValue == null) {
return null;
}
if (currentValue is LookupStepValues) {
var exp = nodeType.args.asMap()[0];
String? dateFormat;
if (exp != null) {
dateFormat = await resolve<String>(expression: exp, context: context, db: db);
}
var newDate = currentValue.values.first.asDate()?.formatDate(dateFormat: dateFormat);
if (newDate == null) {
return null;
}
currentValue = LookupStepValues([PropertyDatabaseValueString(newDate)]);
} else {
return null;
}
break;
case "itemtype":
if (currentValue is! LookupStepItems || currentValue.items.length == 0) {
return null;
}
currentValue =
LookupStepValues([PropertyDatabaseValueString(currentValue.items[0].type)]);
break;
default:
return null;
}
......
......@@ -252,7 +252,7 @@ class DatabaseQueryConfig extends ChangeNotifier with EquatableMixin {
// Property and edges conditions
List<List<int>> allConditionsItemsRowIds = [];
List<List<int>> edgeConditionsItemsRowIds = [];
await Future.forEach(conditions, (DatabaseQueryCondition condition) async {
for (var condition in conditions) {
var info, query;
List<Variable<dynamic>> binding = [];
......@@ -286,7 +286,8 @@ class DatabaseQueryConfig extends ChangeNotifier with EquatableMixin {
.whereType<int>()
.toList());
}
});
}
if (edgeConditionsItemsRowIds.isNotEmpty) {
if (edgeTargetsOperator == ConditionOperator.or) {
var uniqueRowIds = <int>{};
......
......@@ -1510,7 +1510,11 @@ class CVUActionCreateLabellingTask extends CVUAction {
for (var feature in featureItems) {
var propertyName = (await feature.propertyValue("propertyName", db))?.value;
if (propertyName != null) {
cvu += '\nText {\n text: "{.${propertyName}}"\n font: headline1 \n}';
if (itemType == "EmailMessage" && propertyName == "content") {
cvu += '\nHTMLView {\n maxHeight: 400\n content: {{.content}}\n}';
} else {
cvu += '\nText {\n text: "{.${propertyName}}"\n font: headline1 \n}';
}
}
}
cvu += '\n}\n}\n}';
......
......@@ -172,7 +172,8 @@ class DemoData {
record.rowId = recordRowID;
await record.setPropertyValue("label", PropertyDatabaseValueString("Friend"),
db: databaseController);
await record.setPropertyValue("value", PropertyDatabaseValueInt(Random().nextInt(10000)),
await record.setPropertyValue(
"proximityValue", PropertyDatabaseValueInt(Random().nextInt(10000)),
db: databaseController);
var edge =
ItemEdgeRecord(sourceRowID: meRowId, name: "relationship", targetRowID: recordRowID);
......
......@@ -54,10 +54,15 @@ extension FormattedDate on DateTime {
// Compare against 36 hours ago
if (DateTime.now().subtract(Duration(hours: 36)).millisecondsSinceEpoch >
this.millisecondsSinceEpoch) {
var dateFormatter = DateFormat(dateFormat, "en_US");
return dateFormatter.format(this);
return formatDate(dateFormat: dateFormat);
} else {
return timestampString ?? "";
}
}
String formatDate({String? dateFormat}) {
dateFormat ??= "yyyy/MM/dd HH:mm";
var dateFormatter = DateFormat(dateFormat, "en_US");
return dateFormatter.format(this);
}
}
......@@ -18,6 +18,8 @@ class MockDataGenerator {
return faker.lorem.sentences(2).join();
case "title":
return faker.lorem.sentence();
case "color":
return '#' + Random().nextInt(1000000).toRadixString(16).padLeft(6, '0');
default:
return faker.food.dish().split(" ")[0] + '-' + faker.sport.name().split(" ")[0];
}
......
......@@ -12,6 +12,9 @@ class AceEditor extends StatelessWidget {
@override
Widget build(BuildContext context) {
return HtmlView(src: "assets/assets/cvuAceEditorDist/index.html");
return HtmlView(
src: "assets/assets/cvuAceEditorDist/index.html",
reload: false,
);
}
}
......@@ -23,10 +23,15 @@ class _CVUButtonState extends State<CVUButton> {
bool isLink = false;
ButtonStyle? style;
late ValueNotifier<bool> _isDisabled;
set isDisabled(bool isDisabled) => _isDisabled.value = isDisabled;
late Future _init;
@override
initState() {
_isDisabled = ValueNotifier(false);
super.initState();
_init = init();
}
......@@ -42,6 +47,7 @@ class _CVUButtonState extends State<CVUButton> {
if (actions == null) {
return;
}
isDisabled = true;
try {
for (var action in actions) {
if (action is CVUActionOpenPopup) {
......@@ -61,6 +67,7 @@ class _CVUButtonState extends State<CVUButton> {
throw e;
}
}
isDisabled = false;
}
openPopup(Map<String, dynamic> settings) {
......@@ -120,18 +127,21 @@ class _CVUButtonState extends State<CVUButton> {
return FutureBuilder(
future: _init,
builder: (BuildContext builder, snapshot) {
return isLink
? InkWell(
onTap: onPress,
child: widget.nodeResolver.childrenInForEachWithWrap(centered: true),
)
: TextButton(
onPressed: onPress,
child: widget.nodeResolver.childrenInForEachWithWrap(centered: true),
style: TextButton.styleFrom(
textStyle: resolvedTextProperties?.textStyle ?? TextStyle())
.merge(style),
);
return ValueListenableBuilder(
valueListenable: _isDisabled,
builder: (BuildContext context, bool isDisabled, Widget? child) => isLink
? InkWell(
onTap: isDisabled ? null : onPress,
child: widget.nodeResolver.childrenInForEachWithWrap(centered: true),
)
: TextButton(
onPressed: isDisabled ? null : onPress,
child: widget.nodeResolver.childrenInForEachWithWrap(centered: true),
style: TextButton.styleFrom(
textStyle: resolvedTextProperties?.textStyle ?? TextStyle())
.merge(style),
),
);
});
}
}
......@@ -18,6 +18,7 @@ class CVUHTMLView extends StatefulWidget {
class _CVUHTMLViewState extends State<CVUHTMLView> {
late String? _content;
late String? src;
late bool reload;
late Future _init;
......@@ -36,6 +37,7 @@ class _CVUHTMLViewState extends State<CVUHTMLView> {
init() async {
src = await widget.nodeResolver.propertyResolver.string("src");
_content = await widget.nodeResolver.propertyResolver.string("content");
reload = (await widget.nodeResolver.propertyResolver.boolean("reload", false))!;
}
@override
......@@ -45,7 +47,11 @@ class _CVUHTMLViewState extends State<CVUHTMLView> {
builder: (BuildContext builder, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (_content != null || src != null) {
return HtmlView(html: _content, src: src);
return HtmlView(
html: _content,
src: src,
reload: reload,
);
}
}
return Empty();
......
......@@ -138,6 +138,7 @@ class _CVUSubViewState extends State<CVUSubView> {
context: newContext,
datasource: datasource,
databaseController: AppController.shared.databaseController);
queryConfig!.pageSize = 0;
var config = ViewContext(
viewName: viewName,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment