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. # This is a generated file; do not edit or check into version control.
integration_test=C:\\_libs\\flutter\\packages\\integration_test\\ integration_test=C:\\Users\\Luca\\Documents\\flutter\\flutter_windows_1.22.5-stable\\flutter\\packages\\integration_test\\
path_provider=C:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider-1.6.27\\ 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:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_linux-0.0.1+2\\ 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:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_macos-0.0.4+8\\ 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:\\_libs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider_windows-0.0.5\\ 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 sdk.dir=C:\\Users\\Luca\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\_libs\\flutter flutter.sdk=C:\\Users\\Luca\\Documents\\flutter\\flutter_windows_1.22.5-stable\\flutter
\ No newline at end of file \ No newline at end of file
import 'package:dashboard/graphing/usergraph.dart'; 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 'package:flutter/material.dart';
import '../data/post.dart'; import '../data/post.dart';
import 'trustcolorcalculator.dart'; import 'trustcolorcalculator.dart';
...@@ -35,35 +35,32 @@ class PostNode extends StatelessWidget { ...@@ -35,35 +35,32 @@ class PostNode extends StatelessWidget {
} }
void redirectToPost(BuildContext context) { void redirectToPost(BuildContext context) {
Navigator.push( showDialog(
context, context: context, builder: (_) => new PostNodeDialog(post, trustColor));
MaterialPageRoute( //Navigator.push(
builder: (context) => PostNodeTooltip(post, this.trustColor), // context,
)); // MaterialPageRoute(
// builder: (context) => PostNodeTooltip(post, this.trustColor),
// ));
} }
} }
class PostNodeTooltip extends StatelessWidget { class PostNodeDialog extends StatelessWidget {
PostNodeTooltip(this.post, this.trustColor); PostNodeDialog(this.post, this.trustColor);
final Post post; final Post post;
final Color trustColor; final Color trustColor;
final double titleSize = 22; final double titleSize = 22;
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return AlertDialog(
body: Container( titlePadding: EdgeInsets.all(0),
padding: EdgeInsets.fromLTRB(12, 8, 12, 8), title: Container(
constraints: BoxConstraints.expand(),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4), color: Colors.blue,
boxShadow: [ boxShadow: [BoxShadow(blurRadius: 0.2, spreadRadius: 0.2)]),
BoxShadow(color: Colors.grey[100] ?? Colors.grey, spreadRadius: 1) padding: EdgeInsets.all(5),
], child: Row(
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
...@@ -82,7 +79,9 @@ class PostNodeTooltip extends StatelessWidget { ...@@ -82,7 +79,9 @@ class PostNodeTooltip extends StatelessWidget {
), ),
], ],
), ),
Row( Container(
margin: EdgeInsets.fromLTRB(10, 0, 5, 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Padding( Padding(
...@@ -92,7 +91,6 @@ class PostNodeTooltip extends StatelessWidget { ...@@ -92,7 +91,6 @@ class PostNodeTooltip extends StatelessWidget {
child: Text( child: Text(
post.author, post.author,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: titleSize, fontSize: titleSize,
), ),
...@@ -106,7 +104,6 @@ class PostNodeTooltip extends StatelessWidget { ...@@ -106,7 +104,6 @@ class PostNodeTooltip extends StatelessWidget {
child: Text( child: Text(
post.community, post.community,
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.black, color: Colors.black,
fontSize: titleSize, fontSize: titleSize,
), ),
...@@ -118,7 +115,6 @@ class PostNodeTooltip extends StatelessWidget { ...@@ -118,7 +115,6 @@ class PostNodeTooltip extends StatelessWidget {
child: Text( child: Text(
(post.trust * 100).toString() + "%", (post.trust * 100).toString() + "%",
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.bold,
color: trustColor, color: trustColor,
fontSize: titleSize, fontSize: titleSize,
), ),
...@@ -127,28 +123,54 @@ class PostNodeTooltip extends StatelessWidget { ...@@ -127,28 +123,54 @@ class PostNodeTooltip extends StatelessWidget {
Padding( Padding(
padding: const EdgeInsets.fromLTRB(25, 0, 0, 0), padding: const EdgeInsets.fromLTRB(25, 0, 0, 0),
child: Material( child: Material(
color: Colors.red[400] ?? Colors.red, color: Colors.blue,
child: IconButton( child: IconButton(
onPressed: () => Navigator.pop(context), onPressed: () => Navigator.pop(context),
icon: Icon(Icons.close), icon: Icon(
Icons.close,
color: Colors.white,
),
), ),
), ),
), ),
], ],
),
) )
], ],
), ),
Container( ),
content: Column(
children: [
Column(
children: [
SingleChildScrollView(
child: Container(
//constraints: BoxConstraints.expand(), //constraints: BoxConstraints.expand(),
padding: EdgeInsets.fromLTRB(0, 10, 0, 0), padding: EdgeInsets.fromLTRB(0, 10, 0, 0),
child: Text( child: Text(
post.content, post.content != ""
? post.content
: "There is nothing here :(",
overflow: TextOverflow.fade, overflow: TextOverflow.fade,
style: TextStyle(color: Colors.black, fontSize: 15), 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 { ...@@ -93,8 +93,9 @@ class DataGetter {
for (Map<String, dynamic> postMap in postMapList) { for (Map<String, dynamic> postMap in postMapList) {
Post post = Post( Post post = Post(
postMap[
"content"], // i think title and content got mixed up in the backend
postMap["title"], postMap["title"],
postMap["content"],
postMap["user_id"], postMap["user_id"],
postMap["subreddit"], postMap["subreddit"],
postMap["percentage_upvoted"], 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