Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add initial home screen #15

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common/route/route_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class RouteGenerator {
return MaterialPageRoute(builder: (_) => LandingPage());
case Routes.dashboard:
return MaterialPageRoute(builder: (_) => DashboardPage());
case Routes.search:
case Routes.search:
return MaterialPageRoute(builder: (_) => SearchRpiScreen());
default:
return MaterialPageRoute(builder: (_) => SplashPage());
Expand Down
5 changes: 3 additions & 2 deletions lib/common/widget/gradient_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class GradientCard extends StatefulWidget {
final String type;
final bool highlighted;
final Function? func;
GradientCard(this.colors, this.sizes, this.icon, this.type, this.highlighted, [this.func]);
//Colors takes two colors for gradient, sizes takes two numbers: width and height
GradientCard(this.colors, this.sizes, this.icon, this.type, {this.highlighted = false, this.func});
@override
State<GradientCard> createState() => _GradientCard();
}
Expand Down Expand Up @@ -42,7 +43,7 @@ class _GradientCard extends State<GradientCard> {
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(widget.icon, color: Colors.white, size: 50),
Icon(widget.icon, color: Colors.white, size: widget.sizes[1]/2.8),
Text(widget.type, style: TextStyle(fontSize: 20, color: Colors.white))
],
)
Expand Down
1 change: 1 addition & 0 deletions lib/feature/dashboard/screen/dashboard_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:treehousesble/feature/settings/screen/settings_screen.dart';
import 'package:treehousesble/feature/system/screen/system_screen.dart';
import 'package:treehousesble/feature/terminal/screen/terminal_screen.dart';

import 'home_screen.dart';
class FindDevicesScreen extends StatefulWidget {
@override
State<FindDevicesScreen> createState() => _FindDevicesScreenState();
Expand Down
95 changes: 95 additions & 0 deletions lib/feature/dashboard/screen/home_screen.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import 'package:flutter/material.dart';
import 'package:treehousesble/common/navigation/nav.dart';
import 'package:treehousesble/common/route/routes.dart';
import 'package:treehousesble/common/widget/gradient_card.dart';
import 'package:treehousesble/feature/dashboard/screen/search_screen.dart';


class HomeScreen extends StatefulWidget {
@override
State<HomeScreen> createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
static const double padding = 15;
@override
Widget build(BuildContext context) {
return Scaffold(
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: <Widget> [
Padding(
padding: const EdgeInsets.all(padding),
child: GradientCard(
[Color(0xFFFF5F6D), Color(0xFFFFC371)],
[MediaQuery.of(context).size.width, 140],
Icons.apps,
"Services",
highlighted: false,
func: (){
Navigator.of(context).pushNamed(Routes.search);
}
),
),
]
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
GradientCard(
[Color(0xFF662D8C), Color(0xFFED1E79)],
[160, 140],
Icons.exit_to_app,
"SSH"
),
GradientCard(
[Color(0xFF11998E), Color(0xFF38EF7D)],
[160, 140],
Icons.open_in_browser,
"Tunnel"
),
],
),
SizedBox(height: padding),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
GradientCard(
[Color(0xFFF12711), Color(0xFFF5AF19)],
[160, 140],
Icons.desktop_windows,
"System"
),
GradientCard(
[Color(0xFF690808), Color(0xFFFF6b6b)],
[160, 140],
Icons.insights,
"Status"
),
],
),
Column(
children: [
Padding(
padding: const EdgeInsets.all(padding),
child: GradientCard(
[Color(0xFF005C97), Color(0xFF363795)],
[MediaQuery.of(context).size.width, 50],
Icons.people,
"Community"
),
),
],
),
],
)
)
);
}

//returnPage() => Navigator.of(context).pushNamed(Routes.search);

}
4 changes: 2 additions & 2 deletions lib/feature/network/widget/network_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class _NetWorkCard extends State<NetWorkCard> {
[140, 140],
widget.icon,
widget.type,
widget.networkMode == widget.cardNum,
() => widget.setNetworkMode(widget.cardNum)
highlighted: widget.networkMode == widget.cardNum,
func:() => widget.setNetworkMode(widget.cardNum)
),
);
}
Expand Down
34 changes: 17 additions & 17 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.1"
version: "2.7.0"
bloc:
dependency: "direct main"
description:
Expand Down Expand Up @@ -195,7 +195,7 @@ packages:
name: freezed_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.2"
version: "0.14.3"
http:
dependency: "direct main"
description:
Expand Down Expand Up @@ -237,14 +237,14 @@ packages:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.1"
version: "4.1.0"
logger:
dependency: "direct main"
description:
name: logger
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
version: "1.1.0"
matcher:
dependency: transitive
description:
Expand All @@ -258,7 +258,7 @@ packages:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.4.0"
nested:
dependency: transitive
description:
Expand Down Expand Up @@ -300,7 +300,7 @@ packages:
name: path_provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.3"
path_provider_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -342,14 +342,14 @@ packages:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "4.1.0"
version: "4.2.0"
platform:
dependency: transitive
description:
name: platform
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0"
version: "3.0.2"
plugin_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -391,7 +391,7 @@ packages:
name: shared_preferences
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.6"
version: "2.0.7"
shared_preferences_linux:
dependency: transitive
description:
Expand Down Expand Up @@ -419,7 +419,7 @@ packages:
name: shared_preferences_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.0.2"
shared_preferences_windows:
dependency: transitive
description:
Expand Down Expand Up @@ -473,7 +473,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
version: "0.4.0"
typed_data:
dependency: transitive
description:
Expand All @@ -487,21 +487,21 @@ packages:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.9"
version: "6.0.10"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.0.2"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.0.2"
url_launcher_platform_interface:
dependency: transitive
description:
Expand All @@ -515,14 +515,14 @@ packages:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.2"
version: "2.0.4"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
version: "2.0.2"
vector_math:
dependency: transitive
description:
Expand All @@ -536,7 +536,7 @@ packages:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.5"
version: "2.2.9"
xdg_directories:
dependency: transitive
description:
Expand Down