forked from Santos-Enoque/flutter-web-dashboard-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b605853
commit 6295006
Showing
14 changed files
with
461 additions
and
117 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter_web_dashboard/constants/controllers.dart'; | ||
import 'package:flutter_web_dashboard/routing/router.dart'; | ||
import 'package:flutter_web_dashboard/routing/routes.dart'; | ||
|
||
Navigator localNavigator() => Navigator( | ||
key: navigationController.navigatorKey, | ||
onGenerateRoute: generateRoute, | ||
initialRoute: overviewPageRoute, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
const int extraLargeScreenSize = 1920; | ||
const int largeScreenSize = 1366; | ||
const int mediumScreenSize = 768; | ||
const int smallSceenSize = 360; | ||
const int customScreenSize = 1100; | ||
|
||
|
||
|
||
|
||
class ResponsiveWidget extends StatelessWidget { | ||
final Widget largeScreen; | ||
final Widget mediumScreen; | ||
final Widget smallScreen; | ||
|
||
const ResponsiveWidget({ | ||
Key key, | ||
@required this.largeScreen, | ||
this.mediumScreen, | ||
this.smallScreen, | ||
}) : super(key: key); | ||
|
||
static bool isSmallScreen(BuildContext context) { | ||
return MediaQuery.of(context).size.width < mediumScreenSize; | ||
} | ||
|
||
static bool isMediumScreen(BuildContext context) { | ||
return MediaQuery.of(context).size.width >= mediumScreenSize && | ||
MediaQuery.of(context).size.width < largeScreenSize; | ||
} | ||
|
||
static bool isLargeScreen(BuildContext context) { | ||
return MediaQuery.of(context).size.width >= largeScreenSize && | ||
MediaQuery.of(context).size.width < extraLargeScreenSize; | ||
} | ||
|
||
static bool isExtraLargeScreen(BuildContext context) { | ||
return MediaQuery.of(context).size.width >= extraLargeScreenSize; | ||
} | ||
|
||
static bool isCustomSize(BuildContext context) { | ||
return MediaQuery.of(context).size.width <= customScreenSize && | ||
MediaQuery.of(context).size.width >= mediumScreenSize; | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return LayoutBuilder( | ||
builder: (context, constraints) { | ||
if (constraints.maxWidth >= largeScreenSize) { | ||
return largeScreen; | ||
} else if (constraints.maxWidth < largeScreenSize && | ||
constraints.maxWidth >= mediumScreenSize) { | ||
return mediumScreen ?? largeScreen; | ||
} else { | ||
return smallScreen ?? largeScreen; | ||
} | ||
}, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_web_dashboard/constants/controllers.dart'; | ||
import 'package:get/get.dart'; | ||
import 'package:flutter_web_dashboard/constants/style.dart'; | ||
|
||
import 'custom_text.dart'; | ||
|
||
class HorizontalMenuItem extends StatelessWidget { | ||
final String itemName; | ||
final Function onTap; | ||
const HorizontalMenuItem({ Key key, this.itemName, this.onTap }) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
double _width = MediaQuery.of(context).size.width; | ||
|
||
return InkWell( | ||
onTap: onTap, | ||
onHover: (value){ | ||
value ? | ||
menuController.onHover(itemName) : menuController.onHover("not hovering"); | ||
}, | ||
child: Obx(() => Container( | ||
color: menuController.isHovering(itemName) ? lightGrey.withOpacity(.1) : Colors.transparent, | ||
child: Row( | ||
children: [ | ||
Visibility( | ||
visible: menuController.isHovering(itemName) || menuController.isActive(itemName), | ||
maintainSize: true, | ||
maintainAnimation: true, | ||
maintainState: true, | ||
child: Container( | ||
width: 6, | ||
height: 40, | ||
color: Colors.white, | ||
), | ||
), | ||
SizedBox(width:_width / 88), | ||
|
||
Padding( | ||
padding: const EdgeInsets.all(16), | ||
child: menuController.returnIconFor(itemName), | ||
), | ||
if(!menuController.isActive(itemName)) | ||
Flexible(child: CustomText(text: itemName , color: menuController.isHovering(itemName) ? Colors.white : lightGrey,)) | ||
else | ||
Flexible(child: CustomText(text: itemName , color: Colors.white , size: 18, weight: FontWeight.bold,)) | ||
|
||
], | ||
), | ||
)) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_web_dashboard/helpers/local_navigator.dart'; | ||
import 'package:flutter_web_dashboard/widgets/side_menu.dart'; | ||
|
||
class LargeScreen extends StatelessWidget { | ||
const LargeScreen({ Key key }) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Row( | ||
children: [ | ||
Expanded( | ||
child: SideMenu()), | ||
Expanded( | ||
flex: 5, | ||
child: Container( | ||
margin: EdgeInsets.symmetric(horizontal: 16), | ||
child: localNavigator()),), | ||
], | ||
); | ||
} | ||
} |
Oops, something went wrong.