Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
3279a264
Commit
3279a264
authored
Mar 22, 2021
by
Manuel Herold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finished schema demo
parent
babcc349
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
814 additions
and
91 deletions
+814
-91
main.dart
src/dashboard/lib/main.dart
+1
-1
index.dart
src/dashboard/lib/ui/schema/index.dart
+10
-2
index.dart
src/dashboard/lib/ui/schema/page1/index.dart
+30
-2
index.dart
src/dashboard/lib/ui/schema/page2/index.dart
+28
-67
index.dart
src/dashboard/lib/ui/schema/page3/index.dart
+75
-0
clustered_data.dart
src/dashboard/lib/ui/schema/page4/clustered_data.dart
+79
-0
index.dart
src/dashboard/lib/ui/schema/page4/index.dart
+87
-0
trace_small.dart
src/dashboard/lib/ui/schema/page4/trace_small.dart
+20
-0
unclustered_data.dart
src/dashboard/lib/ui/schema/page4/unclustered_data.dart
+79
-0
bottom_sheet.dart
src/dashboard/lib/ui/schema/util/bottom_sheet.dart
+25
-0
fab.dart
src/dashboard/lib/ui/schema/util/fab.dart
+18
-0
layers.dart
src/dashboard/lib/ui/schema/util/layers.dart
+15
-0
node.dart
src/dashboard/lib/ui/schema/util/node.dart
+66
-0
node_small_raw.dart
src/dashboard/lib/ui/schema/util/node_small_raw.dart
+25
-0
post_written.dart
src/dashboard/lib/ui/schema/util/post_written.dart
+2
-0
single_layer_card.dart
src/dashboard/lib/ui/schema/util/single_layer_card.dart
+65
-0
trace_table.dart
src/dashboard/lib/ui/schema/util/trace_table.dart
+85
-0
traces_list.dart
src/dashboard/lib/ui/schema/util/traces_list.dart
+57
-0
login_form.dart
src/dashboard/lib/ui/sign_in/login_form.dart
+45
-17
color_holder.dart
src/dashboard/lib/ui/theme/color_holder.dart
+2
-2
No files found.
src/dashboard/lib/main.dart
View file @
3279a264
import
'package:dashboard/exceptions/login_exception.dart'
;
import
'package:dashboard/exceptions/login_exception.dart'
;
import
'package:dashboard/loading.dart'
;
import
'package:dashboard/loading.dart'
;
import
'package:dashboard/ui/graphs/community_meta/cluster_view_page.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/ui/sign_in/loginpage.dart'
;
import
'package:dashboard/util/loginhelper.dart'
;
import
'package:dashboard/util/loginhelper.dart'
;
import
'package:dashboard/util/user.dart'
;
import
'package:dashboard/util/user.dart'
;
...
@@ -29,7 +30,6 @@ class _ArticonfDashboardDemoState extends State<ArticonfDashboardDemo> {
...
@@ -29,7 +30,6 @@ class _ArticonfDashboardDemoState extends State<ArticonfDashboardDemo> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
// ClusterGetter().getClusters();
// ClusterGetter().getClusters();
return
MaterialApp
(
return
MaterialApp
(
home:
EnhancedFutureBuilder
<
BackendUser
>(
home:
EnhancedFutureBuilder
<
BackendUser
>(
future:
_checkLoginStuff
(),
future:
_checkLoginStuff
(),
...
...
src/dashboard/lib/ui/schema/index.dart
View file @
3279a264
import
'package:dashboard/ui/schema/page1/index.dart'
;
import
'package:dashboard/ui/schema/page1/index.dart'
;
import
'package:dashboard/ui/schema/page2/index.dart'
;
import
'package:dashboard/ui/schema/page2/index.dart'
;
import
'package:dashboard/ui/schema/page3/index.dart'
;
import
'package:dashboard/ui/schema/page4/index.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
enum
Phase
{
WRITE
,
DETAILS
}
enum
Phase
{
WRITE
,
DETAILS
,
LAYERS
,
LAYERING
}
class
SchemaDemo
extends
StatefulWidget
{
class
SchemaDemo
extends
StatefulWidget
{
@override
@override
...
@@ -14,7 +16,7 @@ class SchemaDemo extends StatefulWidget {
...
@@ -14,7 +16,7 @@ class SchemaDemo extends StatefulWidget {
}
}
class
_SchemaDemoState
extends
State
<
SchemaDemo
>
{
class
_SchemaDemoState
extends
State
<
SchemaDemo
>
{
Phase
_phase
=
Phase
.
WRITE
;
Phase
_phase
;
@override
@override
void
initState
()
{
void
initState
()
{
...
@@ -31,6 +33,12 @@ class _SchemaDemoState extends State<SchemaDemo> {
...
@@ -31,6 +33,12 @@ class _SchemaDemoState extends State<SchemaDemo> {
case
Phase
.
DETAILS
:
case
Phase
.
DETAILS
:
return
SchemaDemoPage2
();
return
SchemaDemoPage2
();
case
Phase
.
LAYERS
:
return
SchemaDemoPage3
();
case
Phase
.
LAYERING
:
return
SchemaDemoPage4
();
default
:
default
:
return
Text
(
"Unknown Phase
$_phase
"
);
return
Text
(
"Unknown Phase
$_phase
"
);
}
}
...
...
src/dashboard/lib/ui/schema/page1/index.dart
View file @
3279a264
import
'package:dashboard/ui/schema/index.dart'
;
import
'package:dashboard/ui/schema/index.dart'
;
import
'package:dashboard/ui/schema/util/bottom_sheet.dart'
;
import
'package:dashboard/ui/schema/util/fab.dart'
;
import
'package:dashboard/ui/schema/util/post_written.dart'
;
import
'package:dashboard/ui/schema/util/post_written.dart'
;
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
...
@@ -22,10 +24,36 @@ class _SchemaDemoPage1State extends State<SchemaDemoPage1> {
...
@@ -22,10 +24,36 @@ class _SchemaDemoPage1State extends State<SchemaDemoPage1> {
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
backgroundColor:
ColorHolder
.
color
2
,
backgroundColor:
ColorHolder
.
color
1
,
body:
Center
(
body:
Center
(
child:
WrittenPost
(
_next
),
child:
Row
(
children:
[
SizedBox
(
width:
16
),
CustomFloatingActionButton
(
Icons
.
close
,
"right-
${DateTime.now()}
"
,
()
=>
Navigator
.
of
(
context
).
pop
(),
),
Expanded
(
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
WrittenPost
(()
{}),
],
),
),
CustomFloatingActionButton
(
Icons
.
arrow_right
,
"right-
${DateTime.now()}
"
,
_next
,
),
SizedBox
(
width:
16
),
],
),
),
),
bottomSheet:
ExplainingBottomSheet
(
"1. A user writes a post at a service that is connected to Articonf SMART."
),
);
);
}
}
}
}
src/dashboard/lib/ui/schema/page2/index.dart
View file @
3279a264
import
'package:dashboard/constants/schema_demo_constants.dart'
;
import
'package:dashboard/ui/schema/index.dart'
;
import
'package:dashboard/ui/schema/util/bottom_sheet.dart'
;
import
'package:dashboard/ui/schema/util/fab.dart'
;
import
'package:dashboard/ui/schema/util/trace_table.dart'
;
import
'package:dashboard/ui/schema/util/post_written.dart'
;
import
'package:dashboard/ui/schema/util/post_written.dart'
;
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
...
@@ -13,18 +16,26 @@ class _SchemaDemoPage2State extends State<SchemaDemoPage2> {
...
@@ -13,18 +16,26 @@ class _SchemaDemoPage2State extends State<SchemaDemoPage2> {
Navigator
.
of
(
context
).
pop
();
Navigator
.
of
(
context
).
pop
();
}
}
void
_next
()
{
Navigator
.
of
(
context
).
push
(
MaterialPageRoute
(
builder:
(
context
)
=>
SchemaDemo
(
phase:
Phase
.
LAYERS
,
),
));
}
@override
@override
Widget
build
(
BuildContext
context
)
{
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
return
Scaffold
(
backgroundColor:
ColorHolder
.
color
2
,
backgroundColor:
ColorHolder
.
color
1
,
body:
Center
(
body:
Center
(
child:
Row
(
child:
Row
(
children:
[
children:
[
SizedBox
(
width:
16
),
SizedBox
(
width:
16
),
FloatingActionButton
(
Custom
FloatingActionButton
(
onPressed:
_previous
,
Icons
.
arrow_back
,
child:
Icon
(
Icons
.
arrow_back
)
,
"left-
${DateTime.now()}
"
,
heroTag:
"left-
${DateTime.now()}
"
,
_previous
,
),
),
Expanded
(
Expanded
(
child:
Row
(
child:
Row
(
...
@@ -37,79 +48,29 @@ class _SchemaDemoPage2State extends State<SchemaDemoPage2> {
...
@@ -37,79 +48,29 @@ class _SchemaDemoPage2State extends State<SchemaDemoPage2> {
],
],
),
),
),
),
Icon
(
Icons
.
arrow_right
),
Icon
(
Icons
.
arrow_right
,
color:
ColorHolder
.
color2
,
),
Expanded
(
Expanded
(
child:
Row
(
child:
Row
(
mainAxisSize:
MainAxisSize
.
min
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
children:
[
SizedBox
(
PostTable
(),
width:
350
,
child:
Card
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
DataTable
(
columnSpacing:
16
,
dataRowHeight:
48
,
headingTextStyle:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
black
,
fontSize:
24
,
),
columns:
[
DataColumn
(
label:
Text
(
"Field"
)),
DataColumn
(
label:
Text
(
"Value"
)),
],
rows:
[
DataRow
(
cells:
[
DataCell
(
Text
(
"Author"
)),
DataCell
(
Text
(
"u/SomeUserOnReddit"
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Timestamp"
)),
DataCell
(
Text
(
"
${DateTime.now().toIso8601String()}
"
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Content"
)),
DataCell
(
Text
(
SchemaDemoConstants
.
post
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Upvotes"
)),
DataCell
(
Text
(
"198"
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Percentage Upvoted"
)),
DataCell
(
Text
(
"0.96"
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Number of Comments"
)),
DataCell
(
Text
(
"0"
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Subreddit"
)),
DataCell
(
Text
(
"r/Example"
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Id"
)),
DataCell
(
Text
(
"a8bf26"
)),
]),
],
),
),
),
),
],
],
),
),
),
),
FloatingActionButton
(
Custom
FloatingActionButton
(
onPressed:
()
{}
,
Icons
.
arrow_forward
,
child:
Icon
(
Icons
.
arrow_forward
)
,
"right-
${DateTime.now()}
"
,
heroTag:
"right-
${DateTime.now()}
"
,
_next
,
),
),
SizedBox
(
width:
16
),
SizedBox
(
width:
16
),
],
],
),
),
),
),
bottomSheet:
ExplainingBottomSheet
(
"2. The raw data gets gathered by the Articonf SMART backend according to a schema and is converted to a Trace."
),
);
);
}
}
}
}
src/dashboard/lib/ui/schema/page3/index.dart
0 → 100644
View file @
3279a264
import
'package:dashboard/ui/schema/index.dart'
;
import
'package:dashboard/ui/schema/util/bottom_sheet.dart'
;
import
'package:dashboard/ui/schema/util/fab.dart'
;
import
'package:dashboard/ui/schema/util/layers.dart'
;
import
'package:dashboard/ui/schema/util/trace_table.dart'
;
import
'package:dashboard/ui/schema/util/traces_list.dart'
;
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:flutter/material.dart'
;
class
SchemaDemoPage3
extends
StatefulWidget
{
@override
_SchemaDemoPage3State
createState
()
=>
_SchemaDemoPage3State
();
}
class
_SchemaDemoPage3State
extends
State
<
SchemaDemoPage3
>
{
void
_previous
()
{
Navigator
.
of
(
context
).
pop
();
}
void
_next
()
{
Navigator
.
of
(
context
).
push
(
MaterialPageRoute
(
builder:
(
context
)
=>
SchemaDemo
(
phase:
Phase
.
LAYERING
,
),
));
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
backgroundColor:
ColorHolder
.
color1
,
body:
Stack
(
children:
[
Center
(
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SizedBox
(
width:
16
),
CustomFloatingActionButton
(
Icons
.
arrow_back
,
"left-
${DateTime.now()}
"
,
_previous
,
),
Expanded
(
child:
SizedBox
()),
PostTable
(),
Icon
(
Icons
.
add
,
size:
30
,
color:
ColorHolder
.
color2
,
),
LayerInformation
(),
Icon
(
Icons
.
arrow_right
,
size:
30
,
color:
ColorHolder
.
color2
,
),
TracesList
(),
Expanded
(
child:
SizedBox
()),
CustomFloatingActionButton
(
Icons
.
arrow_forward
,
"right-
${DateTime.now()}
"
,
_next
,
),
SizedBox
(
width:
16
),
],
),
)
],
),
bottomSheet:
ExplainingBottomSheet
(
"3. The trace gets split into several nodes according to the layer information stored in the schema."
),
);
}
}
src/dashboard/lib/ui/schema/page4/clustered_data.dart
0 → 100644
View file @
3279a264
import
'package:dashboard/ui/schema/page4/trace_small.dart'
;
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:flutter/material.dart'
;
class
ClusteredData
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Container
(
width:
400
,
height:
200
,
decoration:
BoxDecoration
(
color:
Colors
.
blue
[
50
],
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
10
)),
border:
Border
.
all
(
color:
Colors
.
black
,
width:
3
,
)),
child:
Stack
(
children:
[
TraceSmall
(
10
,
10
,
Colors
.
blue
[
100
]),
TraceSmall
(
10
,
100
,
Colors
.
blue
[
100
]),
TraceSmall
(
45
,
60
,
Colors
.
blue
[
100
]),
TraceSmall
(
60
,
110
,
Colors
.
blue
[
100
]),
TraceSmall
(
90
,
40
,
Colors
.
blue
[
100
]),
TraceSmall
(
230
,
10
,
Colors
.
blue
[
100
]),
TraceSmall
(
284
,
10
,
Colors
.
blue
[
100
]),
TraceSmall
(
250
,
60
,
Colors
.
blue
[
100
]),
TraceSmall
(
290
,
90
,
Colors
.
blue
[
100
]),
TraceSmall
(
250
,
120
,
Colors
.
blue
[
100
]),
TraceSmall
(
320
,
50
,
Colors
.
blue
[
100
]),
],
),
),
Text
(
"Traces in the Upvotes Layer (Clustered)"
,
style:
TextStyle
(
color:
ColorHolder
.
color2
,
),
),
SizedBox
(
height:
16
),
Container
(
width:
400
,
height:
200
,
decoration:
BoxDecoration
(
color:
Colors
.
red
[
50
],
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
10
)),
border:
Border
.
all
(
color:
Colors
.
black
,
width:
3
,
)),
child:
Stack
(
children:
[
TraceSmall
(
100
,
30
,
Colors
.
red
[
100
]),
TraceSmall
(
100
,
80
,
Colors
.
red
[
100
]),
TraceSmall
(
100
,
140
,
Colors
.
red
[
100
]),
TraceSmall
(
55
,
55
,
Colors
.
red
[
100
]),
TraceSmall
(
145
,
55
,
Colors
.
red
[
100
]),
TraceSmall
(
145
,
105
,
Colors
.
red
[
100
]),
TraceSmall
(
280
,
80
,
Colors
.
red
[
100
]),
TraceSmall
(
315
,
115
,
Colors
.
red
[
100
]),
TraceSmall
(
245
,
45
,
Colors
.
red
[
100
]),
TraceSmall
(
328
,
50
,
Colors
.
red
[
100
]),
TraceSmall
(
300
,
4
,
Colors
.
red
[
100
]),
],
),
),
Text
(
"Traces in the Engagement Layer (Clustered)"
,
style:
TextStyle
(
color:
ColorHolder
.
color2
,
),
),
],
);
}
}
src/dashboard/lib/ui/schema/page4/index.dart
0 → 100644
View file @
3279a264
import
'dart:ui'
;
import
'package:dashboard/ui/schema/index.dart'
;
import
'package:dashboard/ui/schema/page4/clustered_data.dart'
;
import
'package:dashboard/ui/schema/page4/unclustered_data.dart'
;
import
'package:dashboard/ui/schema/util/bottom_sheet.dart'
;
import
'package:dashboard/ui/schema/util/fab.dart'
;
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:flutter/material.dart'
;
class
SchemaDemoPage4
extends
StatefulWidget
{
@override
_SchemaDemoPage4State
createState
()
=>
_SchemaDemoPage4State
();
}
class
_SchemaDemoPage4State
extends
State
<
SchemaDemoPage4
>
{
void
_previous
()
{
Navigator
.
of
(
context
).
pop
();
}
void
_next
()
{
Navigator
.
of
(
context
).
push
(
MaterialPageRoute
(
builder:
(
context
)
=>
SchemaDemo
(
phase:
Phase
.
LAYERS
,
),
));
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
backgroundColor:
ColorHolder
.
color1
,
body:
Stack
(
children:
[
Center
(
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
SizedBox
(
width:
16
),
CustomFloatingActionButton
(
Icons
.
arrow_back
,
"left-
${DateTime.now()}
"
,
_previous
,
),
Expanded
(
child:
SizedBox
()),
UnclusteredData
(),
SizedBox
(
width:
48
),
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Padding
(
padding:
const
EdgeInsets
.
only
(
right:
80.0
),
child:
Text
(
"Clustering"
,
style:
TextStyle
(
fontSize:
22
,
color:
ColorHolder
.
color2
,
),
),
),
Image
.
asset
(
"assets/drawn/arrow.png"
,
width:
200
,
),
],
),
SizedBox
(
width:
48
),
ClusteredData
(),
Expanded
(
child:
SizedBox
()),
// CustomFloatingActionButton(
// Icons.arrow_forward,
// "right-${DateTime.now()}",
// _next,
// ),
SizedBox
(
width:
16
),
],
),
)
],
),
bottomSheet:
ExplainingBottomSheet
(
"4. Similar nodes get clustered to form communities."
,
),
);
}
}
src/dashboard/lib/ui/schema/page4/trace_small.dart
0 → 100644
View file @
3279a264
import
'package:dashboard/ui/schema/util/node_small_raw.dart'
;
import
'package:flutter/material.dart'
;
class
TraceSmall
extends
StatelessWidget
{
final
double
x
;
final
double
y
;
final
Color
color
;
final
int
n
;
TraceSmall
(
this
.
x
,
this
.
y
,
this
.
color
,
{
this
.
n
=
0
});
@override
Widget
build
(
BuildContext
context
)
{
return
Positioned
(
top:
y
,
left:
x
,
child:
TraceSmallRaw
(
color
),
);
}
}
src/dashboard/lib/ui/schema/page4/unclustered_data.dart
0 → 100644
View file @
3279a264
import
'package:dashboard/ui/schema/page4/trace_small.dart'
;
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:flutter/material.dart'
;
class
UnclusteredData
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Container
(
width:
400
,
height:
200
,
decoration:
BoxDecoration
(
color:
Colors
.
blue
[
50
],
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
10
)),
border:
Border
.
all
(
color:
Colors
.
black
,
width:
3
,
)),
child:
Stack
(
children:
[
TraceSmall
(
10
,
10
,
Colors
.
blue
[
100
]),
TraceSmall
(
10
,
100
,
Colors
.
blue
[
100
]),
TraceSmall
(
80
,
90
,
Colors
.
blue
[
100
]),
TraceSmall
(
150
,
110
,
Colors
.
blue
[
100
]),
TraceSmall
(
110
,
40
,
Colors
.
blue
[
100
]),
TraceSmall
(
160
,
10
,
Colors
.
blue
[
100
]),
TraceSmall
(
300
,
10
,
Colors
.
blue
[
100
]),
TraceSmall
(
230
,
50
,
Colors
.
blue
[
100
]),
TraceSmall
(
190
,
140
,
Colors
.
blue
[
100
]),
TraceSmall
(
250
,
130
,
Colors
.
blue
[
100
]),
TraceSmall
(
310
,
100
,
Colors
.
blue
[
100
]),
],
),
),
Text
(
"Traces in the Upvotes Layer (Unclustered)"
,
style:
TextStyle
(
color:
ColorHolder
.
color2
,
),
),
SizedBox
(
height:
16
),
Container
(
width:
400
,
height:
200
,
decoration:
BoxDecoration
(
color:
Colors
.
red
[
50
],
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
10
)),
border:
Border
.
all
(
color:
Colors
.
black
,
width:
3
,
)),
child:
Stack
(
children:
[
TraceSmall
(
340
,
10
,
Colors
.
red
[
100
]),
TraceSmall
(
340
,
100
,
Colors
.
red
[
100
]),
TraceSmall
(
280
,
90
,
Colors
.
red
[
100
]),
TraceSmall
(
210
,
110
,
Colors
.
red
[
100
]),
TraceSmall
(
250
,
40
,
Colors
.
red
[
100
]),
TraceSmall
(
190
,
10
,
Colors
.
red
[
100
]),
TraceSmall
(
50
,
10
,
Colors
.
red
[
100
]),
TraceSmall
(
120
,
50
,
Colors
.
red
[
100
]),
TraceSmall
(
160
,
140
,
Colors
.
red
[
100
]),
TraceSmall
(
100
,
130
,
Colors
.
red
[
100
]),
TraceSmall
(
40
,
120
,
Colors
.
red
[
100
]),
],
),
),
Text
(
"Traces in the Engagement Layer (Unclustered)"
,
style:
TextStyle
(
color:
ColorHolder
.
color2
,
),
),
],
);
}
}
src/dashboard/lib/ui/schema/util/bottom_sheet.dart
0 → 100644
View file @
3279a264
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:flutter/material.dart'
;
class
ExplainingBottomSheet
extends
StatelessWidget
{
final
String
message
;
ExplainingBottomSheet
(
this
.
message
);
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
color:
ColorHolder
.
color4
,
height:
100
,
width:
double
.
infinity
,
alignment:
Alignment
.
center
,
child:
Text
(
message
,
style:
TextStyle
(
fontSize:
30
,
color:
ColorHolder
.
color2
,
),
),
);
}
}
src/dashboard/lib/ui/schema/util/fab.dart
0 → 100644
View file @
3279a264
import
'package:flutter/material.dart'
;
class
CustomFloatingActionButton
extends
StatelessWidget
{
final
IconData
icon
;
final
Function
onClick
;
final
String
tag
;
CustomFloatingActionButton
(
this
.
icon
,
this
.
tag
,
this
.
onClick
);
@override
Widget
build
(
BuildContext
context
)
{
return
FloatingActionButton
(
onPressed:
onClick
,
child:
Icon
(
icon
),
heroTag:
"
$tag
-
${DateTime.now()}
"
,
);
}
}
src/dashboard/lib/ui/schema/util/layers.dart
0 → 100644
View file @
3279a264
import
'package:dashboard/ui/schema/util/single_layer_card.dart'
;
import
'package:flutter/material.dart'
;
class
LayerInformation
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
SingleLayerCard
(
"Upvotes Layer"
,
"Upvotes, Percentage Upvoted"
),
SingleLayerCard
(
"Engagement Layer"
,
"Number of Comments"
),
],
);
}
}
src/dashboard/lib/ui/schema/util/node.dart
0 → 100644
View file @
3279a264
import
'package:flutter/material.dart'
;
class
Node
extends
StatelessWidget
{
final
String
layerName
;
final
Color
color
;
final
List
<
String
>
fields
;
final
List
<
String
>
values
;
Node
(
this
.
layerName
,
this
.
fields
,
this
.
values
,
this
.
color
)
{
if
(
fields
.
length
!=
values
.
length
)
throw
Exception
(
"fields must have the same length as values"
);
if
(
fields
.
length
==
0
)
throw
Exception
(
"there must be at least one field provided"
);
}
@override
Widget
build
(
BuildContext
context
)
{
return
// upvote trace
SizedBox
(
width:
350
,
child:
Card
(
color:
color
,
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
22
),
child:
Text
(
"Node (
$layerName
)"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
black
,
fontSize:
28
,
),
),
),
DataTable
(
columnSpacing:
16
,
dataRowHeight:
48
,
headingTextStyle:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
black
,
fontSize:
20
,
),
columns:
[
DataColumn
(
label:
Text
(
"Field"
)),
DataColumn
(
label:
Text
(
"Value"
)),
],
rows:
fields
.
map
(
(
field
)
=>
DataRow
(
cells:
[
DataCell
(
Text
(
field
)),
DataCell
(
Text
(
values
[
fields
.
indexOf
(
field
)]))
]),
)
.
toList
()),
],
),
),
),
);
}
}
src/dashboard/lib/ui/schema/util/node_small_raw.dart
0 → 100644
View file @
3279a264
import
'package:flutter/material.dart'
;
class
TraceSmallRaw
extends
StatelessWidget
{
final
Color
color
;
TraceSmallRaw
(
this
.
color
);
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
height:
50
,
width:
50
,
decoration:
BoxDecoration
(
color:
color
,
shape:
BoxShape
.
circle
,
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
"N"
),
],
),
);
}
}
src/dashboard/lib/ui/schema/util/post_written.dart
View file @
3279a264
import
'package:animated_text_kit/animated_text_kit.dart'
;
import
'package:animated_text_kit/animated_text_kit.dart'
;
import
'package:dashboard/constants/schema_demo_constants.dart'
;
import
'package:dashboard/constants/schema_demo_constants.dart'
;
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
enum
PostStatus
{
WRITING
,
SENDING
,
DONE
}
enum
PostStatus
{
WRITING
,
SENDING
,
DONE
}
...
@@ -54,6 +55,7 @@ class _WrittenPostState extends State<WrittenPost> {
...
@@ -54,6 +55,7 @@ class _WrittenPostState extends State<WrittenPost> {
height:
270
,
height:
270
,
width:
400
,
width:
400
,
child:
Card
(
child:
Card
(
color:
ColorHolder
.
color2
,
child:
Padding
(
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Column
(
child:
Column
(
...
...
src/dashboard/lib/ui/schema/util/single_layer_card.dart
0 → 100644
View file @
3279a264
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:flutter/material.dart'
;
class
SingleLayerCard
extends
StatelessWidget
{
final
String
layerName
;
final
String
layerProperties
;
SingleLayerCard
(
this
.
layerName
,
this
.
layerProperties
);
@override
Widget
build
(
BuildContext
context
)
{
return
SizedBox
(
width:
350
,
child:
Card
(
color:
ColorHolder
.
color2
,
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
22
),
child:
Text
(
layerName
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
black
,
fontSize:
28
,
),
),
),
DataTable
(
columnSpacing:
16
,
dataRowHeight:
48
,
headingTextStyle:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
black
,
fontSize:
20
,
),
columns:
[
DataColumn
(
label:
Text
(
"Field"
)),
DataColumn
(
label:
Text
(
"Value"
)),
],
rows:
[
DataRow
(
cells:
[
DataCell
(
Text
(
"Layer Name"
)),
DataCell
(
Text
(
layerName
)),
],
),
DataRow
(
cells:
[
DataCell
(
Text
(
"Cluster Properties"
)),
DataCell
(
Text
(
layerProperties
)),
],
),
],
),
],
),
),
),
);
}
}
src/dashboard/lib/ui/schema/util/trace_table.dart
0 → 100644
View file @
3279a264
import
'package:dashboard/constants/schema_demo_constants.dart'
;
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:flutter/material.dart'
;
class
PostTable
extends
StatelessWidget
{
@override
Widget
build
(
BuildContext
context
)
{
return
Hero
(
tag:
"post_table"
,
child:
SizedBox
(
width:
350
,
child:
Card
(
color:
ColorHolder
.
color2
,
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
8.0
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Container
(
padding:
EdgeInsets
.
only
(
left:
22
),
child:
Text
(
"Trace Data"
,
style:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
black
,
fontSize:
28
,
),
),
),
DataTable
(
columnSpacing:
16
,
dataRowHeight:
48
,
headingTextStyle:
TextStyle
(
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
black
,
fontSize:
20
,
),
columns:
[
DataColumn
(
label:
Text
(
"Field"
)),
DataColumn
(
label:
Text
(
"Value"
)),
],
rows:
[
DataRow
(
cells:
[
DataCell
(
Text
(
"Author"
)),
DataCell
(
Text
(
"u/SomeUserOnReddit"
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Timestamp"
)),
DataCell
(
Text
(
"
${DateTime.now().toIso8601String()}
"
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Content"
)),
DataCell
(
Text
(
SchemaDemoConstants
.
post
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Upvotes"
)),
DataCell
(
Text
(
"198"
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Percentage Upvoted"
)),
DataCell
(
Text
(
"0.96"
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Number of Comments"
)),
DataCell
(
Text
(
"0"
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Subreddit"
)),
DataCell
(
Text
(
"r/Example"
)),
]),
DataRow
(
cells:
[
DataCell
(
Text
(
"Id"
)),
DataCell
(
Text
(
"a8bf26"
)),
]),
],
),
],
),
),
),
),
);
}
}
src/dashboard/lib/ui/schema/util/traces_list.dart
0 → 100644
View file @
3279a264
import
'package:dashboard/ui/schema/page4/trace_small.dart'
;
import
'package:dashboard/ui/schema/util/node.dart'
;
import
'package:dashboard/ui/schema/util/node_small_raw.dart'
;
import
'package:dashboard/ui/theme/color_holder.dart'
;
import
'package:flutter/material.dart'
;
class
TracesList
extends
StatelessWidget
{
final
bool
small
;
TracesList
({
this
.
small
=
false
});
@override
Widget
build
(
BuildContext
context
)
{
return
Hero
(
tag:
"traces_list"
,
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Node
(
"Upvotes"
,
[
"Upvotes"
,
"Percentage Upvoted"
],
[
"198"
,
"0.96"
],
Colors
.
blue
[
100
],
),
if
(!
small
)
Icon
(
Icons
.
chevron_right
,
color:
ColorHolder
.
color2
,
),
if
(!
small
)
TraceSmallRaw
(
Colors
.
blue
[
100
]),
],
),
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Node
(
"Engagement"
,
[
"Number of Comments"
],
[
"0"
],
Colors
.
red
[
100
],
),
if
(!
small
)
Icon
(
Icons
.
chevron_right
,
color:
ColorHolder
.
color2
,
),
if
(!
small
)
TraceSmallRaw
(
Colors
.
red
[
100
]),
],
),
],
),
);
}
}
src/dashboard/lib/ui/sign_in/login_form.dart
View file @
3279a264
import
'package:dashboard/constants/schema_demo_constants.dart'
;
import
'package:dashboard/ui/schema/index.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/material.dart'
;
class
LoginForm
extends
StatefulWidget
{
class
LoginForm
extends
StatefulWidget
{
...
@@ -84,23 +86,49 @@ class _LoginFormState extends State<LoginForm> {
...
@@ -84,23 +86,49 @@ class _LoginFormState extends State<LoginForm> {
),
),
// login button
// login button
SizedBox
(
height:
16
),
SizedBox
(
height:
16
),
TextButton
.
icon
(
Row
(
onPressed:
_submit
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
icon:
Icon
(
children:
[
Icons
.
login
,
TextButton
.
icon
(
size:
32
,
onPressed:
_submit
,
color:
Colors
.
white
,
icon:
Icon
(
),
Icons
.
login
,
label:
Text
(
size:
32
,
"Sign In"
,
color:
Colors
.
white
,
style:
TextStyle
(
fontSize:
20
,
color:
Colors
.
white
),
),
),
label:
Text
(
style:
TextButton
.
styleFrom
(
"Sign In"
,
backgroundColor:
widget
.
isBusy
style:
TextStyle
(
fontSize:
20
,
color:
Colors
.
white
),
?
Colors
.
grey
),
:
Theme
.
of
(
context
).
primaryColor
,
style:
TextButton
.
styleFrom
(
padding:
EdgeInsets
.
all
(
18
),
backgroundColor:
widget
.
isBusy
),
?
Colors
.
grey
:
Theme
.
of
(
context
).
primaryColor
,
padding:
EdgeInsets
.
all
(
18
),
),
),
SizedBox
(
width:
16
),
TextButton
.
icon
(
onPressed:
()
=>
Navigator
.
of
(
context
).
push
(
MaterialPageRoute
(
builder:
(
context
)
=>
SchemaDemo
(),
),
),
icon:
Icon
(
Icons
.
help
,
size:
32
,
color:
Colors
.
white
,
),
label:
Text
(
"How does it work?"
,
style:
TextStyle
(
fontSize:
20
,
color:
Colors
.
white
),
),
style:
TextButton
.
styleFrom
(
backgroundColor:
Theme
.
of
(
context
).
primaryColor
,
padding:
EdgeInsets
.
all
(
18
),
),
),
],
),
),
],
],
),
),
...
...
src/dashboard/lib/ui/theme/color_holder.dart
View file @
3279a264
...
@@ -17,9 +17,9 @@ class ColorHolder {
...
@@ -17,9 +17,9 @@ class ColorHolder {
static
Color
get
color3
=>
Color
.
fromRGBO
(
55
,
57
,
46
,
1
);
static
Color
get
color3
=>
Color
.
fromRGBO
(
55
,
57
,
46
,
1
);
///
///
///
royal blue dark
///
material blue
///
///
static
Color
get
color4
=>
Color
.
fromRGBO
(
34
,
42
,
104
,
1
)
;
static
Color
get
color4
=>
Color
s
.
blue
;
///
///
/// royal blue dark
/// royal blue dark
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment