Comments (4)
i also had the same issue. I was able to solve it by doing this.
There is a default Class MenuController that get's imported different from the one he created in this tutorial, so what i did was to rename the MenuController Class he created to CustomMenuController:
class CustomMenuController extends GetxController {
static CustomMenuController instance = Get.find();
var activeItem = overviewPageDisplayName.obs;
var hoverItem = "".obs;
changeActiveItemTo(String itemName) {
activeItem.value = itemName;
}
onHover(String itemName) {
if (!isActive(itemName)) hoverItem.value = itemName;
}
isHovering(String itemName) => hoverItem.value == itemName;
isActive(String itemName) => activeItem.value == itemName;
Widget returnIconFor(String itemName) {
switch (itemName) {
case overviewPageDisplayName:
return _customIcon(Icons.trending_up, itemName);
case driversPageDisplayName:
return _customIcon(Icons.drive_eta, itemName);
case clientsPageDisplayName:
return _customIcon(Icons.people_alt_outlined, itemName);
case authenticationPageDisplayName:
return _customIcon(Icons.exit_to_app, itemName);
default:
return _customIcon(Icons.exit_to_app, itemName);
}
}
Widget _customIcon(IconData icon, String itemName) {
if (isActive(itemName)) return Icon(icon, size: 22, color: dark);
return Icon(
icon,
color: isHovering(itemName) ? dark : lightGrey,
);
}
}
now in your main.dart, update to this:
void main() {
Get.put(CustomMenuController());
runApp(const MyApp());
}
Then ensure where you created an instance of MenuController is changed to CustomMenuController, this should help.
from flutter-web-dashboard-template.
@GreatGodson Thanks for your help. In my case, it solves the compiling errors but the debug mode runs and displays a white screen. At least that is a plus. I am getting close to getting this running.
Also, you forgot to mention looking in the controller.dart file.
import 'package:flutter_web_dashboard/controllers/menu_controller.dart';
import 'package:flutter_web_dashboard/controllers/navigation_controller.dart';
CustomMenuController menuController = CustomMenuController.instance;
NavigationController navigationController = NavigationController.instance;
Update: I was able to get it running. I ended up looking into a resolved issue and found the answer. I got it running.
from flutter-web-dashboard-template.
@jiraheta I'm glad you were able to get it running.
from flutter-web-dashboard-template.
i am having the same issue and after following your steps, it worked like magic. Why did we have to change it to "CustomMenuController"?
from flutter-web-dashboard-template.
Related Issues (20)
- Side Menu itens not working. HOT 14
- /C:/Android/flutter/.pub-cache/hosted/pub.dartlang.org/charts_flutter-0.10.0/lib/src/behaviors/legend/legend_entry_layout.dart:134:45: Error: The getter 'body1' isn't defined for the class 'TextTheme'. - 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/Android/flutter/packages/flutter/lib/src/material/text_theme.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'body1'. color ??= Theme.of(context).textTheme.body1.color; HOT 4
- Local Navigator Chapter seems outdated HOT 3
- Please upgrade the code to be used with latest flutter stable version in 2022
- please fix this weird error or bug
- values are not showing in small screen cards
- bar chart errors can't be assigned to the parameter type 'List<Series<dynamic, String HOT 1
- Duplicate GlobalKey HOT 1
- Blank white screen HOT 2
- Error right at the beginning (getX-turtorial) "Error: Type 'CounterController' not found"
- error with side_menu.dart code
- "NavigationController" not found
- How can I navigate to detail page when tap on CellRow?
- Update to support flutter 3.0.4 HOT 2
- Having problem inside the layout file
- local_platform.dart:45:41: Error: Member not found: 'packageRoot'.
- final Function onTap HOT 2
- Exception: null. The flutter tool cannot access the file or directory. #1
- Side menus not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter-web-dashboard-template.