Commit 42576ac8 authored by Manuel's avatar Manuel

Merge remote-tracking branch 'origin/feature/dashboard' into feature/dashboard

parents 98a145c3 a2bf54cb
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
# 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\\
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:dashboard/graphing/usergraph.dart';
import 'package:dashboard/ui/graphs/community/index.dart';
import 'package:dashboard/ui/util/logged_in_appbar.dart';
import 'package:flutter/material.dart';
import '../data/post.dart';
import 'trustcolorcalculator.dart';
......@@ -35,120 +35,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"],
......
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