Skip to content

Commit

Permalink
Added some styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhi-Gautam committed Aug 23, 2020
1 parent 4886453 commit 7d487b3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
14 changes: 14 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"program": "lib/main.dart",
"request": "launch",
"type": "dart"
}
]
}
15 changes: 11 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class MyApp extends StatelessWidget {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
scaffoldBackgroundColor: Color(0xFF2e294e),
primarySwatch: Colors.blue,
),
home: MyHomePage(),
Expand Down Expand Up @@ -139,7 +140,7 @@ class MyHomePageState extends State<MyHomePage> {
key: scaffoldKey,
appBar: AppBar(
title: Text(getTitle()),
backgroundColor: Color(0xFF0E4D64),
backgroundColor: Color(0xFF182043),
actions: <Widget>[
PopupMenuButton<String>(
initialValue: currentSortAlgo,
Expand Down Expand Up @@ -189,6 +190,7 @@ class MyHomePageState extends State<MyHomePage> {
),
),
bottomNavigationBar: BottomAppBar(
color: Color(0xFF011638),
child: Row(
children: <Widget>[
Expanded(
Expand All @@ -199,16 +201,21 @@ class MyHomePageState extends State<MyHomePage> {
reset();
setSortAlgo(currentSortAlgo);
},
child: Text("RESET"))),
child: Text(
"RESET",
style: TextStyle(color: Colors.white),
))),
Expanded(
child: FlatButton(
onPressed: isSorting ? null : sort, child: Text("SORT"))),
onPressed: isSorting ? null : sort,
child:
Text("SORT", style: TextStyle(color: Colors.white)))),
Expanded(
child: FlatButton(
onPressed: isSorting ? null : changeSpeed,
child: Text(
"${speed + 1}x",
style: TextStyle(fontSize: 20),
style: TextStyle(fontSize: 20, color: Colors.white),
))),
],
),
Expand Down
11 changes: 10 additions & 1 deletion lib/paints/bars.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ class BarPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
Paint paint = Paint();
paint.color = Color(0xFF1D9A6C);
if (value < 500 * .20)
paint.color = Color(0xFFfb8f67);
else if (value < 500 * .40)
paint.color = Color(0xFFf38375);
else if (value < 500 * .60)
paint.color = Color(0xFFf7a399);
else if (value < 500 * .80)
paint.color = Color(0xFFfbc3bc);
else
paint.color = Color(0xFFffe3e0);
paint.strokeWidth = width;
paint.strokeCap = StrokeCap.round;

Expand Down
2 changes: 1 addition & 1 deletion lib/paints/platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Platform extends CustomPainter {
final p1 = Offset(0, 600);
final p2 = Offset(width, 600);
final paint = Paint()
..color = Colors.black
..color = Color(0xFF011638)
..strokeWidth = 4;
canvas.drawLine(p1, p2, paint);
}
Expand Down

0 comments on commit 7d487b3

Please sign in to comment.