Initial commit
This commit is contained in:
44
lib/config/routes/router.dart
Normal file
44
lib/config/routes/router.dart
Normal file
@@ -0,0 +1,44 @@
|
||||
import 'package:fluro/fluro.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:thingsboard_app/core/auth/login/login_page.dart';
|
||||
import 'package:thingsboard_app/core/context/tb_context.dart';
|
||||
import 'package:thingsboard_app/core/init/init_app.dart';
|
||||
import 'package:thingsboard_app/modules/device/devices_page.dart';
|
||||
import 'package:thingsboard_app/modules/home/home_page.dart';
|
||||
import 'package:thingsboard_app/modules/profile/profile_page.dart';
|
||||
|
||||
class ThingsboardAppRouter {
|
||||
final router = FluroRouter();
|
||||
final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>();
|
||||
late final _tbContext = TbContext(router, routeObserver);
|
||||
|
||||
late var initHandler = Handler(handlerFunc: (BuildContext? context, Map<String, dynamic> params) {
|
||||
return ThingsboardInitApp(tbContext);
|
||||
});
|
||||
|
||||
late var loginHandler = Handler(handlerFunc: (BuildContext? context, Map<String, dynamic> params) {
|
||||
return LoginPage(_tbContext);
|
||||
});
|
||||
|
||||
late var homeHandler = Handler(handlerFunc: (BuildContext? context, Map<String, dynamic> params) {
|
||||
return HomePage(_tbContext);
|
||||
});
|
||||
|
||||
late var profileHandler = Handler(handlerFunc: (BuildContext? context, Map<String, dynamic> params) {
|
||||
return ProfilePage(_tbContext);
|
||||
});
|
||||
|
||||
late var devicesHandler = Handler(handlerFunc: (BuildContext? context, Map<String, dynamic> params) {
|
||||
return DevicesPage(_tbContext);
|
||||
});
|
||||
|
||||
ThingsboardAppRouter() {
|
||||
router.define("/", handler: initHandler);
|
||||
router.define("/login", handler: loginHandler);
|
||||
router.define("/home", handler: homeHandler);
|
||||
router.define("/profile", handler: profileHandler);
|
||||
router.define("/devices", handler: devicesHandler);
|
||||
}
|
||||
|
||||
TbContext get tbContext => _tbContext;
|
||||
}
|
||||
46
lib/config/themes/tb_theme.dart
Normal file
46
lib/config/themes/tb_theme.dart
Normal file
@@ -0,0 +1,46 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
const int _tbPrimaryColor = 0xFF305680;
|
||||
const int _tbSecondaryColor = 0xFF527dad;
|
||||
const int _tbDarkPrimaryColor = 0xFF9fa8da;
|
||||
|
||||
const tbMatIndigo = MaterialColor(
|
||||
_tbPrimaryColor,
|
||||
<int, Color>{
|
||||
50: Color(0xFFE8EAF6),
|
||||
100: Color(0xFFC5CAE9),
|
||||
200: Color(0xFF9FA8DA),
|
||||
300: Color(0xFF7986CB),
|
||||
400: Color(0xFF5C6BC0),
|
||||
500: Color(_tbPrimaryColor),
|
||||
600: Color(_tbSecondaryColor),
|
||||
700: Color(0xFF303F9F),
|
||||
800: Color(0xFF283593),
|
||||
900: Color(0xFF1A237E),
|
||||
},);
|
||||
|
||||
const tbDarkMatIndigo = MaterialColor(
|
||||
_tbPrimaryColor,
|
||||
<int, Color>{
|
||||
50: Color(0xFFE8EAF6),
|
||||
100: Color(0xFFC5CAE9),
|
||||
200: Color(0xFF9FA8DA),
|
||||
300: Color(0xFF7986CB),
|
||||
400: Color(0xFF5C6BC0),
|
||||
500: Color(_tbDarkPrimaryColor),
|
||||
600: Color(_tbSecondaryColor),
|
||||
700: Color(0xFF303F9F),
|
||||
800: Color(_tbPrimaryColor),
|
||||
900: Color(0xFF1A237E),
|
||||
},);
|
||||
|
||||
ThemeData tbTheme = ThemeData(
|
||||
primarySwatch: tbMatIndigo,
|
||||
accentColor: Colors.deepOrange
|
||||
);
|
||||
|
||||
ThemeData tbDarkTheme = ThemeData(
|
||||
primarySwatch: tbDarkMatIndigo,
|
||||
accentColor: Colors.deepOrange,
|
||||
brightness: Brightness.dark
|
||||
);
|
||||
Reference in New Issue
Block a user