Commit a2bf54cb authored by Luca Braun's avatar Luca Braun

Updated Post Dialog

parent bc6d5697
2021/03/10-16:08:21.507 968 Reusing MANIFEST C:\Users\Luca\AppData\Local\Temp\flutter_tools.b6d5c3cf\flutter_tools_chrome_device.f8891a83\Default\AutofillStrikeDatabase/MANIFEST-000001
2021/03/11-12:55:19.376 2318 Reusing MANIFEST C:\Users\Luca\AppData\Local\Temp\flutter_tools.c3c0a979\flutter_tools_chrome_device.3916f3a2\Default\AutofillStrikeDatabase/MANIFEST-000001
2021/03/11-12:55:19.376 2318 Recovering log #3
2021/03/11-12:55:19.376 2318 Reusing old log C:\Users\Luca\AppData\Local\Temp\flutter_tools.c3c0a979\flutter_tools_chrome_device.3916f3a2\Default\AutofillStrikeDatabase/000003.log
2021/03/10-16:08:21.423 347c Reusing MANIFEST C:\Users\Luca\AppData\Local\Temp\flutter_tools.b6d5c3cf\flutter_tools_chrome_device.f8891a83\Default\BudgetDatabase/MANIFEST-000001
2021/03/11-12:55:19.367 2318 Reusing MANIFEST C:\Users\Luca\AppData\Local\Temp\flutter_tools.c3c0a979\flutter_tools_chrome_device.3916f3a2\Default\BudgetDatabase/MANIFEST-000001
2021/03/11-12:55:19.367 2318 Recovering log #3
2021/03/11-12:55:19.367 2318 Reusing old log C:\Users\Luca\AppData\Local\Temp\flutter_tools.c3c0a979\flutter_tools_chrome_device.3916f3a2\Default\BudgetDatabase/000003.log
......@@ -45,7 +45,7 @@
},
{
"name": "circlegraph",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/circlegraph-0.0.5",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/circlegraph-0.0.6",
"packageUri": "lib/",
"languageVersion": "2.7"
},
......@@ -91,6 +91,12 @@
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "ffi",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/ffi-1.0.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "file",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file-6.0.0",
......@@ -109,6 +115,12 @@
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "flutter_spinkit",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_spinkit-5.0.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "flutter_test",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/packages/flutter_test",
......@@ -123,7 +135,7 @@
},
{
"name": "graphview",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/graphview-0.6.6",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/graphview-0.6.7",
"packageUri": "lib/",
"languageVersion": "2.7"
},
......@@ -145,6 +157,12 @@
"packageUri": "lib/",
"languageVersion": "2.10"
},
{
"name": "localstorage",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/localstorage-3.0.6+9",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
"name": "logger",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/logger-0.9.4",
......@@ -169,9 +187,39 @@
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "path_provider",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.27",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "path_provider_linux",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-0.0.1+2",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "path_provider_macos",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-0.0.4+8",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "path_provider_platform_interface",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_platform_interface-1.0.4",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "path_provider_windows",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-0.0.5",
"packageUri": "lib/",
"languageVersion": "2.11"
},
{
"name": "pedantic",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/pedantic-1.10.0",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/pedantic-1.11.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
......@@ -181,6 +229,12 @@
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "plugin_platform_interface",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/plugin_platform_interface-1.0.3",
"packageUri": "lib/",
"languageVersion": "2.1"
},
{
"name": "process",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/process-4.0.0",
......@@ -265,6 +319,18 @@
"packageUri": "lib/",
"languageVersion": "2.0"
},
{
"name": "win32",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/win32-2.0.0",
"packageUri": "lib/",
"languageVersion": "2.12"
},
{
"name": "xdg_directories",
"rootUri": "file:///C:/Users/Luca/Documents/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/xdg_directories-0.1.2",
"packageUri": "lib/",
"languageVersion": "2.3"
},
{
"name": "dashboard",
"rootUri": "../",
......@@ -272,7 +338,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-03-10T14:27:38.710395Z",
"generated": "2021-03-11T11:54:36.474922Z",
"generator": "pub",
"generatorVersion": "2.12.0"
}
# 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-1.6.27\\
path_provider_linux=C:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-0.0.1+2\\
path_provider_macos=C:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_macos-0.0.4+8\\
path_provider_windows=C:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-0.0.5\\
integration_test=C:\\Users\\Luca\\Documents\\flutter\\flutter_windows_1.22.5-stable\\flutter\\packages\\integration_test\\
path_provider=C:\\Users\\Luca\\Documents\\flutter\\flutter_windows_1.22.5-stable\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider-1.6.27\\
path_provider_linux=C:\\Users\\Luca\\Documents\\flutter\\flutter_windows_1.22.5-stable\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-0.0.1+2\\
path_provider_macos=C:\\Users\\Luca\\Documents\\flutter\\flutter_windows_1.22.5-stable\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_macos-0.0.4+8\\
path_provider_windows=C:\\Users\\Luca\\Documents\\flutter\\flutter_windows_1.22.5-stable\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-0.0.5\\
<<<<<<< Updated upstream
{"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":[]}],"android":[{"name":"integration_test","path":"C:\\\\Libs\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]}],"date_created":"2021-03-09 22:08:04.726748","version":"2.0.1"}
=======
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]}],"date_created":"2021-03-10 16:07:42.326854","version":"2.0.1"}
>>>>>>> Stashed changes
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.27\\\\","dependencies":[]}],"android":[{"name":"integration_test","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\packages\\\\integration_test\\\\","dependencies":[]},{"name":"path_provider","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.27\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-0.0.4+8\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"C:\\\\Users\\\\Luca\\\\Documents\\\\flutter\\\\flutter_windows_1.22.5-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-0.0.5\\\\","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-03-11 13:07:08.355404","version":"2.0.1"}
\ No newline at end of file
This diff is collapsed.
sdk.dir=C:\\Users\\Manuel\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\_libs\\flutter
\ No newline at end of file
sdk.dir=C:\\Users\\Luca\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\Users\\Luca\\Documents\\flutter\\flutter_windows_1.22.5-stable\\flutter
\ No newline at end of file
import 'package:apex_flutter_sdk/apex_flutter_sdk.dart';
import 'package:dashboard/main.dart';
import 'package:dashboard/graphing/usergraph.dart';
import 'package:dashboard/ui/util/logged_in_appbar.dart';
import 'package:flutter/material.dart';
import '../data/post.dart';
import 'trustcolorcalculator.dart';
......@@ -38,120 +39,142 @@ class PostNode extends StatelessWidget {
}
void redirectToPost(BuildContext context) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PostNodeTooltip(post, this.trustColor),
));
showDialog(
context: context, builder: (_) => new PostNodeDialog(post, trustColor));
//Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => PostNodeTooltip(post, this.trustColor),
// ));
}
}
class PostNodeTooltip extends StatelessWidget {
PostNodeTooltip(this.post, this.trustColor);
class PostNodeDialog extends StatelessWidget {
PostNodeDialog(this.post, this.trustColor);
final Post post;
final Color trustColor;
final double titleSize = 22;
Widget build(BuildContext context) {
return Scaffold(
body: Container(
padding: EdgeInsets.fromLTRB(12, 8, 12, 8),
constraints: BoxConstraints.expand(),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4),
boxShadow: [
BoxShadow(color: Colors.grey[100] ?? Colors.grey, spreadRadius: 1)
],
),
child: Column(
children: [
Row(
return AlertDialog(
titlePadding: EdgeInsets.all(0),
title: Container(
decoration: BoxDecoration(
color: Colors.blue,
boxShadow: [BoxShadow(blurRadius: 0.2, spreadRadius: 0.2)]),
padding: EdgeInsets.all(5),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Container(
child: Text(
post.title != "" ? post.title : "Comment",
overflow: TextOverflow.fade,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: titleSize,
),
),
//constraints: BoxConstraints.expand(),
),
],
),
Container(
margin: EdgeInsets.fromLTRB(10, 0, 5, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Container(
child: Text(
post.title != "" ? post.title : "Comment",
overflow: TextOverflow.fade,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: titleSize,
),
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 25, 0),
child: TextButton(
onPressed: () => redirectToUserGraph(context),
child: Text(
post.author,
style: TextStyle(
color: Colors.black,
fontSize: titleSize,
),
//constraints: BoxConstraints.expand(),
),
],
),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(0, 0, 25, 0),
child: TextButton(
onPressed: () => redirectToUserGraph(context),
child: Text(
post.author,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: titleSize,
),
),
Padding(
padding: const EdgeInsets.fromLTRB(25, 0, 25, 0),
child: TextButton(
onPressed: () => redirectToCommunityGraph(context),
child: Text(
post.community,
style: TextStyle(
color: Colors.black,
fontSize: titleSize,
),
),
Padding(
padding: const EdgeInsets.fromLTRB(25, 0, 25, 0),
child: TextButton(
onPressed: () => redirectToCommunityGraph(context),
child: Text(
post.community,
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black,
fontSize: titleSize,
),
),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(25, 0, 25, 0),
child: Text(
(post.trust * 100).toString() + "%",
style: TextStyle(
fontWeight: FontWeight.bold,
color: trustColor,
fontSize: titleSize,
),
),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(25, 0, 25, 0),
child: Text(
(post.trust * 100).toString() + "%",
style: TextStyle(
color: trustColor,
fontSize: titleSize,
),
Padding(
padding: const EdgeInsets.fromLTRB(25, 0, 0, 0),
child: Material(
color: Colors.red[400] ?? Colors.red,
child: IconButton(
onPressed: () => Navigator.pop(context),
icon: Icon(Icons.close),
),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(25, 0, 0, 0),
child: Material(
color: Colors.blue,
child: IconButton(
onPressed: () => Navigator.pop(context),
icon: Icon(
Icons.close,
color: Colors.white,
),
),
],
)
),
),
],
),
Container(
//constraints: BoxConstraints.expand(),
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
child: Text(
post.content,
overflow: TextOverflow.fade,
style: TextStyle(color: Colors.black, fontSize: 15),
)
],
),
),
content: Column(
children: [
Column(
children: [
SingleChildScrollView(
child: Container(
//constraints: BoxConstraints.expand(),
padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
child: Text(
post.content != ""
? post.content
: "There is nothing here :(",
overflow: TextOverflow.fade,
style: TextStyle(color: Colors.black, fontSize: 19),
),
),
),
],
)),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
post.title != "" ? post.comments.toString() + " Comments" : "",
textAlign: TextAlign.right,
style: TextStyle(fontSize: 16),
),
],
)
],
mainAxisAlignment: MainAxisAlignment.spaceBetween,
),
);
}
......
......@@ -93,8 +93,9 @@ class DataGetter {
for (Map<String, dynamic> postMap in postMapList) {
Post post = Post(
postMap[
"content"], // i think title and content got mixed up in the backend
postMap["title"],
postMap["content"],
postMap["user_id"],
postMap["subreddit"],
postMap["percentage_upvoted"],
......
import 'package:dashboard/sign_in/login_form.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:logger/logger.dart';
class LoginPage extends StatefulWidget {
LoginPage();
@override
_LoginPageState createState() => _LoginPageState();
}
class _LoginPageState extends State<LoginPage> {
String _error;
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: LoginForm(tryLogin, _error),
),
);
}
void tryLogin(String username, String password) async {
await Future.delayed(Duration(seconds: 1));
String json = "{\"username\":\"$username\",\"password\":\"$password\"}";
Future<Map<String, dynamic>> tokenJson = DataGetter.postJson(
"https://articonf1.itec.aau.at:30401/api/tokens", json);
tokenJson.then((value) => Logger().i(value.toString()));
setState(() {
_error = "Test fehlermeldung :)";
});
// tokenJson.then((value) {
// print("bruh");
// Credentials().token = value["token"] as String;
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => CommunityMetaGraphViewPage()));
// }).catchError(
// () {
// print("omegabruh");
// setState(
// () => error = "Wrong Credentials :(",
// );
// },
// );
}
}
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