Commit 391ba2ad authored by Manuel's avatar Manuel

Merge branch 'feature/dashboard' into develop

parents 72b17cf4 f389cb08
......@@ -18,4 +18,10 @@ src/modules/security/default_users.json
resources/
src/dashboard/.dart_tool/
src/dashboard/build/61d113a1f91ed254ee3636485549491e/
src/dashboard/build/
reports/
......@@ -35,6 +35,23 @@ def get_dockerfile_paths_and_names() -> Dict[str, str]:
return command_args
def is_flutter_project(path: str) -> bool:
test_file_path = f"{path}/pubspec.yaml"
return os.path.exists(test_file_path)
class cd:
"""Context manager for changing the current working directory"""
def __init__(self, newPath):
self.newPath = os.path.expanduser(newPath)
def __enter__(self):
self.savedPath = os.getcwd()
os.chdir(self.newPath)
def __exit__(self, etype, value, traceback):
os.chdir(self.savedPath)
if __name__ == '__main__':
p_image_name = None
......@@ -60,6 +77,11 @@ if __name__ == '__main__':
path = command_arg['path']
image_name = f"{DOCKERHUB_REPO_OWNER}/{command_arg['name']}"
if is_flutter_project(path):
with cd(path):
print(f"> flutter build web")
os.system(f"flutter build web")
# copy Dockerfile into root dir to have access to modules folder
shutil.copy2(os.path.join(path, DOCKER_BUILD_NAME), ROOT)
......
# This is a generated file; do not edit or check into version control.
integration_test=C:\\_libs\\flutter\\packages\\integration_test\\
path_provider=C:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider-2.0.2\\
path_provider_linux=C:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-2.0.0\\
path_provider_macos=C:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_macos-2.0.0\\
path_provider_windows=C:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-2.0.1\\
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"C:\\\\_libs\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\_libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.2\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\_libs\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\_libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.2\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\_libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\_libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\_libs\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.1\\\\","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-06-29 14:01:35.940460","version":"2.2.2"}
\ No newline at end of file
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Web related
lib/generated_plugin_registrant.dart
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: c5a4b4029c0798f37c4a39b479d7cb75daa7b05c
channel: stable
project_type: app
# This file is deprecated. Tools should instead consume
# `.dart_tools/package_config.json`.
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2021-06-29 14:01:12.963522.
animated_text_kit:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/animated_text_kit-4.2.1/lib/
archive:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/archive-3.1.2/lib/
async:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.6.1/lib/
boolean_selector:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-2.1.0/lib/
characters:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/characters-1.1.0/lib/
charcode:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.2.0/lib/
circlegraph:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/circlegraph-0.0.6/lib/
clock:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/clock-1.1.0/lib/
collection:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/collection-1.15.0/lib/
crypto:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/crypto-3.0.1/lib/
cupertino_icons:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/cupertino_icons-1.0.3/lib/
enhanced_future_builder:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/enhanced_future_builder-1.0.3/lib/
fake_async:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/fake_async-1.2.0/lib/
ffi:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-1.0.0/lib/
file:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/file-6.1.0/lib/
flutter:file:///C:/_libs/flutter/packages/flutter/lib/
flutter_driver:file:///C:/_libs/flutter/packages/flutter_driver/lib/
flutter_spinkit:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_spinkit-5.0.0/lib/
flutter_test:file:///C:/_libs/flutter/packages/flutter_test/lib/
fuchsia_remote_debug_protocol:file:///C:/_libs/flutter/packages/fuchsia_remote_debug_protocol/lib/
http:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.3/lib/
http_parser:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/http_parser-4.0.0/lib/
integration_test:file:///C:/_libs/flutter/packages/integration_test/lib/
intl:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.17.0/lib/
localstorage:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/localstorage-4.0.0+1/lib/
logger:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/logger-1.0.0/lib/
matcher:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/matcher-0.12.10/lib/
meta:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/meta-1.3.0/lib/
path:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/path-1.8.0/lib/
path_provider:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.2/lib/
path_provider_linux:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/lib/
path_provider_macos:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.0/lib/
path_provider_platform_interface:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_platform_interface-2.0.1/lib/
path_provider_windows:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.1/lib/
pedantic:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/pedantic-1.11.0/lib/
platform:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.0.0/lib/
plugin_platform_interface:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/plugin_platform_interface-2.0.0/lib/
process:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/process-4.2.1/lib/
sky_engine:file:///C:/_libs/flutter/bin/cache/pkg/sky_engine/lib/
source_span:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/source_span-1.8.1/lib/
stack_trace:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/stack_trace-1.10.0/lib/
stream_channel:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/stream_channel-2.1.0/lib/
string_scanner:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/string_scanner-1.1.0/lib/
sync_http:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/sync_http-0.3.0/lib/
term_glyph:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/term_glyph-1.2.0/lib/
test_api:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/test_api-0.3.0/lib/
typed_data:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/typed_data-1.3.0/lib/
vector_math:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/vector_math-2.1.0/lib/
vm_service:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/vm_service-6.2.0/lib/
webdriver:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/webdriver-3.0.0/lib/
win32:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0/lib/
xdg_directories:file:///C:/_libs/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.2.0/lib/
dashboard:lib/
FROM nginx:latest
EXPOSE 80
EXPOSE 443
ENV http_proxy http://proxy.uni-klu.ac.at:3128/
ENV https_proxy http://proxy.uni-klu.ac.at:3128/
COPY ./src/dashboard/deployment/nginx.conf /etc/nginx/conf.d/default.conf
COPY ./src/dashboard/build/web/ /usr/share/nginx/html/
\ No newline at end of file
# dashboard
A new Flutter project.
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 30
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "at.itec.articonf1.dashboard"
minSdkVersion 16
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="at.itec.articonf1.dashboard">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="at.itec.articonf1.dashboard">
<application
android:label="dashboard"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
package io.flutter.plugins;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import io.flutter.embedding.engine.FlutterEngine;
/**
* Generated file. Do not edit.
* This file is generated by the Flutter tool based on the
* plugins that support the Android platform.
*/
@Keep
public final class GeneratedPluginRegistrant {
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
flutterEngine.getPlugins().add(new dev.flutter.plugins.integration_test.IntegrationTestPlugin());
flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
}
}
package at.itec.articonf1.dashboard
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="at.itec.articonf1.dashboard">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/lib" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/.idea" />
<excludeFolder url="file://$MODULE_DIR$/.pub" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="project" />
<orderEntry type="library" name="Flutter Plugins" level="project" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: dashboard
spec:
type: LoadBalancer
selector:
app: dashboard
ports:
- name: http
port: 80
targetPort: 80
nodePort: 30468
protocol: TCP
- name: https
port: 443
targetPort: 443
nodePort: 30469
protocol: TCP
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dashboard
spec:
replicas: 1
selector:
matchLabels:
app: dashboard
template:
metadata:
labels:
app: dashboard
spec:
containers:
- name: dashboard
image: alexx882/dashboard
ports:
- containerPort: 443
imagePullPolicy: Always
volumeMounts:
- mountPath: /certs
name: articonf
volumes:
- name: articonf
hostPath:
path: /srv/articonf
type: Directory
\ No newline at end of file
server {
listen 443 ssl;
server_name demo;
ssl_certificate /certs/articonf1.crt;
ssl_certificate_key /certs/articonf1.key;
location / {
root /usr/share/nginx/html;
try_files $uri /index.html;
}
}
server {
listen 80;
server_name demo_http;
location / {
root /usr/share/nginx/html;
try_files $uri /index.html;
}
}
\ No newline at end of file
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
</dict>
</plist>
#include "Generated.xcconfig"
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
</resources>
</document>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>dashboard</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
#import "GeneratedPluginRegistrant.h"
class SchemaDemoConstants {
static final String post = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.";
}
class ServerConstants {
static const String host = "https://articonf1.itec.aau.at:30401/";
}
import 'dart:math';
import 'package:dashboard/data/post.dart';
import 'package:intl/intl.dart';
class Cluster {
final String label;
final int id;
final String layerName;
static final NumberFormat format = NumberFormat("##.00");
List<Post> nodes;
Cluster(this.label, this.id, this.layerName, this.nodes);
String getDisplayLabel() {
if (label == "noise") return label;
switch (layerName) {
case "Upvotes_Layer":
return "${label.substring(1, label.indexOf("."))} Upvotes";
break;
case "Percentage_Layer":
String trust = label.substring(0, label.indexOf(" "));
trust = trust.substring(0, min(6, trust.length));
double val = double.parse(trust) * 100;
return "${format.format(val)}% Trust";
break;
case "Engagement_Layer":
return "${label.substring(0, label.indexOf("."))} comments";
break;
case "Time_Layer":
int timestamp = int.parse(label.substring(0, label.indexOf(".")));
String date =
DateTime.fromMillisecondsSinceEpoch(timestamp * 1000).toString();
date = date.substring(0, date.indexOf(" "));
return "$date";
break;
default:
return "?";
break;
}
}
}
import 'package:intl/intl.dart';
import 'post.dart';
class Community {
Community(this.name, this.trust, this.posts);
final String name;
final double trust;
List<Post> posts;
String get formattedTrustScore {
NumberFormat format = NumberFormat("###.00");
return format.format(trust*100)+"%";
}
}
import 'community.dart';
import 'post.dart';
class CommunityGraphNodeData {
CommunityGraphNodeData.fromCommunity(this._community) {
this._post = null;
}
CommunityGraphNodeData.fromPost(this._post) {
this._community = null;
}
Community _community;
Post _post;
dynamic getData() {
if (hasCommunity()) {
return _community;
} else {
return _post;
}
}
bool hasCommunity() {
if (this._community != null)
return true;
else
return false;
}
}
import 'package:intl/intl.dart';
class Post {
Post(this.title, this.content, this.author, this.community, this.trust,
this.comments);
final String title;
final String content;
final String author;
final String community;
final double trust;
final int comments;
String get effectiveTitle {
if (title != null && title.isNotEmpty) return title;
return content;
}
String get effectiveContent {
if (content != null && content.isNotEmpty) return content;
return title;
}
String get formattedTrustScore {
NumberFormat format = NumberFormat("###.00");
return format.format(trust*100)+"%";
}
}
import 'post.dart';
class User {
User(this.username, this.id, this.trustScores, this.posts);
final String username;
final int id;
final Map<String, dynamic> trustScores;
final List<Post> posts;
}
import 'user.dart';
import 'post.dart';
class UserGraphNodeData {
UserGraphNodeData.fromUser(this._user) {
this._post = null;
}
UserGraphNodeData.fromPost(this._post) {
this._user = null;
}
User _user;
Post _post;
dynamic getData() {
if (hasUser()) {
return _user;
} else {
return _post;
}
}
bool hasUser() {
if (this._user != null)
return true;
else
return false;
}
}
class LoginException implements Exception {
final String message;
LoginException(this.message);
}
import 'package:dashboard/graphing/usergraph.dart';
import 'package:dashboard/ui/graphs/community/community_graph_view_page.dart';
import 'package:flutter/material.dart';
import '../data/post.dart';
import 'trustcolorcalculator.dart';
class PostNode extends StatelessWidget {
final Post post;
final Color trustColor;
PostNode(this.post)
: trustColor = TrustColorCalculator.calculateTrustColor(post.trust);
Widget build(BuildContext context) {
return GestureDetector(
onTap: () => redirectToPost(context),
child: Row(
children: [
Expanded(
child: Text(
post.title != "" ? post.title : post.content,
overflow: TextOverflow.ellipsis,
style:
TextStyle(fontWeight: FontWeight.bold, color: Colors.black),
),
),
Text(
(post.trust * 100).roundToDouble().toString() + "%",
style: TextStyle(fontWeight: FontWeight.bold, color: trustColor),
),
],
mainAxisAlignment: MainAxisAlignment.spaceBetween,
),
);
}
void redirectToPost(BuildContext context) {
showDialog(
context: context,
builder: (_) => new PostNodeDialog(post, trustColor),
);
}
}
class PostNodeDialog extends StatelessWidget {
PostNodeDialog(this.post, this.trustColor,
{this.width = 350, this.height = 400});
final Post post;
final Color trustColor;
final double titleSize = 22;
final double width;
final double height;
Widget build(BuildContext context) {
return AlertDialog(
titlePadding: EdgeInsets.all(0),
actions: [
TextButton.icon(
onPressed: () => redirectToCommunityGraph(context),
icon: Icon(Icons.group_work),
label: Text(post.community),
),
SizedBox(width: 16),
TextButton.icon(
onPressed: () => redirectToUserGraph(context),
icon: Icon(Icons.supervised_user_circle_rounded),
label: Text(post.author),
),
],
title: Container(
width: width,
decoration: BoxDecoration(
color: Colors.blue,
boxShadow: [BoxShadow(blurRadius: 0.2, spreadRadius: 0.2)],
),
padding: EdgeInsets.all(5),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
post.title != "" ? post.title : "Comment",
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: titleSize,
),
),
),
IconButton(
onPressed: () => Navigator.pop(context),
icon: Icon(
Icons.close,
color: Colors.white,
),
),
],
),
),
content: Container(
width: width,
height: height,
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Container(
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
child: Text(
post.effectiveContent,
overflow: TextOverflow.fade,
style: TextStyle(color: Colors.black, fontSize: 19),
),
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Trust: ${(post.trust * 100).roundToDouble()}%",
textAlign: TextAlign.left,
style: TextStyle(fontSize: 16),
),
Text(
post.title != "" ? "${post.comments} Comments" : "",
textAlign: TextAlign.right,
style: TextStyle(fontSize: 16),
),
],
)
],
mainAxisAlignment: MainAxisAlignment.spaceBetween,
),
),
);
}
void redirectToUserGraph(BuildContext context) {
// pop dialog
Navigator.of(context).pop();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => UserGraphViewPage(post.author),
));
}
void redirectToCommunityGraph(BuildContext context) {
// pop dialog
Navigator.of(context).pop();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => CommunityGraphViewPage(post.community),
),
);
}
}
import 'package:flutter/material.dart';
class TrustColorCalculator {
static Color calculateTrustColor(double trustValue) {
if (trustValue <= 0.25)
return Colors.red;
else if (trustValue <= 0.5)
return Colors.orange;
else if (trustValue <= 0.75)
return Colors.lime;
else
return Colors.lightGreen[200];
}
}
import 'package:circlegraph/circlegraph.dart';
import 'package:dashboard/loading.dart';
import 'package:dashboard/querying/communitygetter.dart';
import 'package:dashboard/ui/theme/color_holder.dart';
import 'package:dashboard/ui/util/logged_in_appbar.dart';
import 'package:enhanced_future_builder/enhanced_future_builder.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import '../data/post.dart';
import '../data/userGraphNodeData.dart';
import 'usernode.dart';
import 'postnode.dart';
import '../data/user.dart';
class UserGraph extends StatefulWidget {
UserGraph(this.user);
final User user;
@override
_UserGraphState createState() => _UserGraphState(user);
}
class _UserGraphState extends State<UserGraph> {
_UserGraphState(this.user);
final User user;
int nrPerPage = 15;
int pageNr = 0;
Widget build(BuildContext context) {
List<Post> nodes = [];
for (int i = pageNr * nrPerPage;
(i < pageNr * nrPerPage + nrPerPage) && i < user.posts.length;
i++) {
nodes.add(user.posts[i]);
}
return Container(
//constraints: BoxConstraints.expand(),
child: SingleChildScrollView(
child: Center(
child: CircleGraph(
root: _getUserNode(user),
children: [for (Post post in nodes) _getPostNode(post)],
edgeColor: Colors.black,
backgroundColor: ColorHolder.color3,
),
),
),
);
}
TreeNodeData<UserGraphNodeData> _getUserNode(User user) {
UserGraphNodeData data = UserGraphNodeData.fromUser(user);
return TreeNodeData(
child: UserNode(user.trustScores),
data: data,
backgroundColor: Colors.transparent);
}
TreeNodeData<UserGraphNodeData> _getPostNode(Post post) {
UserGraphNodeData data = UserGraphNodeData.fromPost(post);
return TreeNodeData(
child: PostNode(post),
data: data,
width: 250,
);
}
}
class UserGraphViewPage extends StatelessWidget {
UserGraphViewPage(this.username);
final String username;
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: ColorHolder.color3,
appBar: LoggedInAppBar("User: $username"),
body: Column(
mainAxisSize: MainAxisSize.max,
children: [
EnhancedFutureBuilder<User>(
future: DataGetter.getUser(username),
// future: DataGetter.getJson(
// "http://live.nope-api.systems:81/users/" +
// username.toString()),
rememberFutureResult: false,
whenDone: (result) => UserGraph(result),
whenNotDone: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SpinKitRotatingCircle(
color: ColorHolder.color2,
size: 200.0,
),
SizedBox(height: 16),
Text(
"Loading",
style: TextStyle(
color: ColorHolder.color2,
fontSize: 22,
),
),
],
),
),
),
],
));
}
}
import 'package:flutter/material.dart';
// import 'package:apex_flutter_sdk/apex_flutter_sdk.dart';
import 'trustcolorcalculator.dart';
class UserNode extends StatelessWidget {
final List<Widget> communities = [];
final Map<String, dynamic> trustScores;
UserNode(this.trustScores);
Widget build(BuildContext context) {
trustScores.forEach((community, trust) {
communities.add(Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
community,
textAlign: TextAlign.left,
style: TextStyle(color: Colors.black),
),
Text((trust * 100).toString() + "%",
textAlign: TextAlign.right,
style: TextStyle(
color: TrustColorCalculator.calculateTrustColor(trust),
fontWeight: FontWeight.bold,
)),
],
));
});
return SizedBox();
// return HoverTooltip(
// child: CircleAvatar(
// backgroundImage: AssetImage("assets/user.png"),
// radius: 30,
// ),
// tooltip: UserTooltip(this.communities),
// );
}
}
class UserTooltip extends StatelessWidget {
UserTooltip(this.communities);
final List<Widget> communities;
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
width: 300,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(color: Colors.grey[100] ?? Colors.grey, spreadRadius: 1)
],
),
child: Column(
children: communities,
));
}
}
import 'package:dashboard/ui/theme/color_holder.dart';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
class LoadingScreen extends StatelessWidget {
final String message;
LoadingScreen({this.message = "Loading..."});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: ColorHolder.color3,
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SpinKitRotatingCircle(
color: ColorHolder.color2,
size: 200.0,
),
SizedBox(height: 16),
Text(
message,
style: TextStyle(
color: ColorHolder.color2,
fontSize: 22,
),
),
],
),
),
);
}
}
import 'package:dashboard/exceptions/login_exception.dart';
import 'package:dashboard/loading.dart';
import 'package:dashboard/ui/graphs/community_meta/cluster_view_page.dart';
import 'package:dashboard/ui/schema/index.dart';
import 'package:dashboard/ui/sign_in/loginpage.dart';
import 'package:dashboard/util/loginhelper.dart';
import 'package:dashboard/util/user.dart';
import 'package:enhanced_future_builder/enhanced_future_builder.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
void main() {
runApp(ArticonfDashboardDemo());
}
class ArticonfDashboardDemo extends StatefulWidget {
@override
_ArticonfDashboardDemoState createState() => _ArticonfDashboardDemoState();
}
class _ArticonfDashboardDemoState extends State<ArticonfDashboardDemo> {
Future<BackendUser> _checkLoginStuff() async {
try {
return await LoginHelper().loggedInUser;
} on LoginException {
return null;
}
}
@override
Widget build(BuildContext context) {
// ClusterGetter().getClusters();
return MaterialApp(
home: EnhancedFutureBuilder<BackendUser>(
future: _checkLoginStuff(),
whenNotDone: LoadingScreen(),
rememberFutureResult: false,
whenDone: (BackendUser snapshotData) {
if (snapshotData == null) return LoginPage();
return ClusterViewPage();
},
),
);
}
}
class DemoWidget extends StatefulWidget {
@override
_DemoWidgetState createState() => _DemoWidgetState();
}
class _DemoWidgetState extends State<DemoWidget> {
String _url = "http://rest-gateway/api/users";
String _response;
void _call() async {
try {
http.Response response = await http.get(Uri.parse(_url));
setState(() {
_response = "${response.statusCode} - ${response.body}";
});
} catch (e, str) {
setState(() {
_response = "$e,\n\n $str";
});
}
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
TextFormField(
initialValue: _url,
onChanged: (value) => _url = value,
),
SizedBox(height: 8),
ElevatedButton(onPressed: _call, child: Text("Send Request")),
SizedBox(height: 8),
if (_url != null) Text(_response),
],
),
),
),
);
}
}
import 'package:dashboard/data/cluster.dart';
import 'package:dashboard/data/community.dart';
import 'package:dashboard/data/post.dart';
import 'package:dashboard/querying/communitygetter.dart';
import 'package:dashboard/querying/host_provider.dart';
import 'package:dashboard/util/loginhelper.dart';
import 'package:dashboard/util/user.dart';
import 'package:logger/logger.dart';
class ClusterGetter {
Map<String, List<Community>> clusterMap;
Future<List<Community>> getNodesfromLayer(String layerName) async {
String url =
"${HostProvider.articonfHost(30103)}/api/use-cases/reddit/tables/reddit/layers/$layerName/nodes";
Logger().i("calling $url");
BackendUser user = await LoginHelper().loggedInUser;
String token = user.token;
Map<String, dynamic> headers = {"Authorization": "Bearer $token"};
List<dynamic> nodeList =
await DataGetter.getJsonList(url, headers: headers);
List<Community> communityList = [];
for (Map<String, dynamic> entry in nodeList) {
bool communityExists = false;
Community community;
for (Community tmpCommunity in communityList) {
if (tmpCommunity.name == entry["subreddit"]) {
community = tmpCommunity;
communityExists = true;
break;
}
}
if (!communityExists) {
community = Community(entry["subreddit"], 1, []);
communityList.add(community);
}
community.posts.add(Post(
entry["title"],
entry["content"],
entry["user_id"],
entry["subreddit"],
entry["percentage_upvoted"],
entry["n_comments"]));
}
return communityList;
}
Future<Map<String, List<Community>>> getClustersFuture() async {
List<String> layers = [
"Upvotes_Layer",
"Percentage_Layer",
"Engagement_Layer",
"Time_Layer",
];
Map<String, List<Community>> clusterMap = {};
for (String layer in layers) {
clusterMap[layer] = await getNodesfromLayer(layer);
}
Logger().i(clusterMap.toString());
return clusterMap;
}
Future<List<Cluster>> getClustersFromLayer(String layerName) async {
String url =
"${HostProvider.articonfHost(30103)}/api/use-cases/reddit/tables/reddit/layers/$layerName/clusters";
Logger().i("calling $url");
BackendUser user = await LoginHelper().loggedInUser;
String token = user.token;
Map<String, dynamic> headers = {"Authorization": "Bearer $token"};
List<dynamic> clusterMapList =
await DataGetter.getJsonList(url, headers: headers);
List<Cluster> clusterList = [];
for (Map<String, dynamic> clusterMap in clusterMapList) {
Cluster cluster = Cluster(clusterMap["label"],
clusterMap["cluster_label"], clusterMap["layer_name"], []);
for (Map<String, dynamic> nodeMap in clusterMap["nodes"]) {
cluster.nodes.add(Post(
nodeMap["title"],
nodeMap["content"],
nodeMap["user_id"],
nodeMap["subreddit"],
nodeMap["percentage_upvoted"],
nodeMap["n_comments"]));
}
clusterList.add(cluster);
}
return clusterList;
}
Future<Cluster> getSpecificClusterFromLayer(String layerName, int id) async {
List<Cluster> clusterList = await getClustersFromLayer(layerName);
for (Cluster cluster in clusterList) {
if (cluster.label == id) return cluster;
}
return null;
}
}
import 'dart:convert';
import 'dart:io';
import 'package:dashboard/querying/host_provider.dart';
import 'package:dashboard/util/loginhelper.dart';
import 'package:dashboard/util/user.dart';
import 'package:http/http.dart' as http;
import 'package:logger/logger.dart';
import '../data/community.dart';
import '../data/post.dart';
import '../data/user.dart';
class DataGetter {
static Future<Map<String, dynamic>> getJson(String url,
{Map<String, dynamic> headers}) async {
http.Response response;
if (headers == null) {
response = await http.get(Uri.parse(url));
} else {
response = await http.get(Uri.parse(url), headers: headers);
}
if (response.statusCode != 200) {
Logger().e("Http request code != 200");
throw HttpException(
"Status code is not 200 but " + response.statusCode.toString());
}
return jsonDecode(response.body) as Map<String, dynamic>;
}
static Future<List<dynamic>> getJsonList(
String url, {
Map<String, dynamic> headers,
}) async {
BackendUser user = await LoginHelper().loggedInUser;
http.Response response = await http.get(
Uri.parse(url),
headers: {
HttpHeaders.authorizationHeader: "Bearer ${user.token}",
},
);
if (response.statusCode != 200) {
Logger().e("Http request code != 200\nActual:\t" +
response.statusCode.toString());
throw HttpException(
"Status code is not 200 but " + response.statusCode.toString());
}
return jsonDecode(response.body) as List<dynamic>;
}
static Future<Map<String, dynamic>> postJson(String url, String body,
{Map<String, dynamic> headers}) async {
http.Response response;
Logger().i("$url\n$headers\n$body");
if (headers == null) {
response = await http.post(Uri.parse(url), body: body);
} else {
response = await http.post(Uri.parse(url), body: body, headers: headers);
}
Logger().i("pls");
if (response.statusCode != 200) {
throw HttpException(
"Status code is not 200 but " + response.statusCode.toString());
}
Map<String, dynamic> jsonMap =
jsonDecode(response.body) as Map<String, dynamic>;
Logger().i(jsonMap.toString());
return jsonMap;
}
static Future<User> getUser(String username) async {
String url = "${HostProvider.manuelHost}/users/$username";
Map<String, dynamic> json = await getJson(url);
//getJson(url).then((value) => json = value);
int id = json["user"]["id"];
Map<String, dynamic> trustscores = json["trust_scores"];
Map<String, dynamic> postCommunityMap = json["posts"];
List<Post> postList = [];
postCommunityMap.forEach((community, postjson) {
List<dynamic> postMapList = postjson;
postList.addAll(_getPostListFromMapList(postMapList));
});
return User(username, id, trustscores, postList);
}
static Future<Community> getCommunity(String communityname) async {
String url = "${HostProvider.manuelHost}/communities/$communityname/posts";
Map<String, dynamic> json = await getJson(url);
double trust = json["trust"];
List<dynamic> postMapList = json["posts"];
List<Post> postList = _getPostListFromMapList(postMapList);
return Community(communityname, trust, postList);
}
static List<Post> _getPostListFromMapList(List<dynamic> postMapList) {
List<Post> postList = [];
for (Map<String, dynamic> postMap in postMapList) {
Post post = Post(
postMap["content"],
postMap["title"],
postMap["user_id"],
postMap["subreddit"],
postMap["percentage_upvoted"],
postMap["n_comments"]);
postList.add(post);
}
return postList;
}
static Future<List<Community>> getCommunities() async {
Map<String, dynamic> communities =
await DataGetter.getJson("${HostProvider.manuelHost}/communities");
List<Community> communityList = [];
for (var entry in communities.entries) {
Community results = await getCommunity(entry.key);
//Logger().i(results.toString());
communityList.add(results);
}
//await communities.forEach((community, value) async {
// Community results = await getCommunity(community);
// Logger().i(results.toString());
// communityList.add(results);
//});
//Logger().i(communityList.toString());
return communityList;
}
}
import 'package:flutter/foundation.dart';
class HostProvider {
static String _hostArticonfDebug = "https://articonf1.itec.aau.at";
static String _hostArticonfRelease = "https://articonf1.itec.aau.at";
static String _hostManuelDebug = "https://live.nope-api.systems:81";
static String _hostManuelRelease = "https://live.nope-api.systems:81";
static String articonfHost(int port) {
return kReleaseMode ? "$_hostArticonfRelease:$port" : "$_hostArticonfDebug:$port";
}
static String get manuelHost {
return kReleaseMode ? _hostManuelRelease : _hostManuelDebug;
}
}
import 'dart:math';
import 'package:circlegraph/circlegraph.dart';
import 'package:dashboard/graphing/trustcolorcalculator.dart';
import 'package:dashboard/ui/graphs/community/circle/node_community.dart';
import 'package:dashboard/ui/theme/color_holder.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import '../../../../data/community.dart';
import '../../../../data/communityGraphNodeData.dart';
import '../../../../data/post.dart';
import '../../../../graphing/postnode.dart';
class CommunityGraph extends StatefulWidget {
CommunityGraph(this.community, {this.offset = 0});
final Community community;
static const int postsPerPage = 21;
final int offset;
final double padding = 32;
final double postWidth = 200;
final double postHeight = 50;
_CommunityGraphState createState() => _CommunityGraphState(community);
}
class _CommunityGraphState extends State<CommunityGraph> {
_CommunityGraphState(this.community);
final Community community;
build(BuildContext context) {
var nodes = [];
int startPostIndex = widget.offset;
int endPostIndex = min(
startPostIndex + CommunityGraph.postsPerPage, community.posts.length);
for (int i = startPostIndex; i < endPostIndex; i++) {
nodes.add(community.posts[i]);
}
nodes.add(
Post("...", "", "", community.name, community.trust, 70),
);
return Container(
constraints: BoxConstraints.expand(),
color: ColorHolder.color3,
child: SingleChildScrollView(
child: CircleGraph(
backgroundColor: ColorHolder.color3,
root: _getCommunityNode(community),
children: [for (var node in nodes) _getPostNode(node)],
edgeColor: Color.fromRGBO(212, 228, 188, 1),
padding: EdgeInsets.zero,
circleLayout: [
Circle(10, 4),
Circle(100, 8),
Circle(220, -1),
],
),
),
);
}
TreeNodeData<CommunityGraphNodeData> _getCommunityNode(Community community) {
CommunityGraphNodeData data =
CommunityGraphNodeData.fromCommunity(community);
return TreeNodeData<CommunityGraphNodeData>(
child: TrustScoreNode(
community.name,
community.trust,
textColor: ColorHolder.color2,
icon: Icons.group_work,
),
data: data,
width: 150,
backgroundColor: ColorHolder.color1,
);
}
TreeNodeData<CommunityGraphNodeData> _getPostNode(Post post) {
CommunityGraphNodeData data = CommunityGraphNodeData.fromPost(post);
PostNode postNode = PostNode(post);
return TreeNodeData<CommunityGraphNodeData>(
// child: postNode,
child: TrustScoreNode(
post.effectiveTitle,
post.trust,
textColor: ColorHolder.color2,
icon: Icons.sticky_note_2,
),
data: data,
width: 200,
backgroundColor: ColorHolder.color1,
onNodeClick: _redirectToPost,
);
}
void _redirectToPost(TreeNodeData node, CommunityGraphNodeData data) {
showDialog(
context: context,
builder: (_) => new PostNodeDialog(data.getData(),
TrustColorCalculator.calculateTrustColor(data.getData().trust)));
}
}
import 'package:flutter/material.dart';
class TrustScoreNode extends StatelessWidget {
final String label;
final double trustValue;
final Color textColor;
final IconData icon;
TrustScoreNode(this.label, this.trustValue,
{this.textColor = Colors.black, this.icon});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
if (icon != null)
Icon(
icon,
color: textColor,
),
if (icon != null) SizedBox(width: 4),
Expanded(
child: Text(
label,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontWeight: FontWeight.bold,
color: textColor,
),
),
),
Text(
(trustValue * 100).roundToDouble().toString() + "%",
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.green,
),
),
],
mainAxisAlignment: MainAxisAlignment.spaceBetween,
),
);
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
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