Skip to content

Commit

Permalink
fixed conflict error between the material MenuController class and Ap…
Browse files Browse the repository at this point in the history
…pBar MenuController to MenuAppController
  • Loading branch information
aslight0013 committed Mar 3, 2023
1 parent 6e01da4 commit d3a60d7
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 66 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';

class MenuController extends ChangeNotifier {
class MenuAppController extends ChangeNotifier {
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();

GlobalKey<ScaffoldState> get scaffoldKey => _scaffoldKey;
Expand Down
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:admin/constants.dart';
import 'package:admin/controllers/MenuController.dart';
import 'package:admin/controllers/MenuAppController.dart';
import 'package:admin/screens/main/main_screen.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
Expand All @@ -25,7 +25,7 @@ class MyApp extends StatelessWidget {
home: MultiProvider(
providers: [
ChangeNotifierProvider(
create: (context) => MenuController(),
create: (context) => MenuAppController(),
),
],
child: MainScreen(),
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/dashboard/components/header.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:admin/controllers/MenuController.dart';
import 'package:admin/controllers/MenuAppController.dart';
import 'package:admin/responsive.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
Expand All @@ -18,7 +18,7 @@ class Header extends StatelessWidget {
if (!Responsive.isDesktop(context))
IconButton(
icon: Icon(Icons.menu),
onPressed: context.read<MenuController>().controlMenu,
onPressed: context.read<MenuAppController>().controlMenu,
),
if (!Responsive.isMobile(context))
Text(
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/main/main_screen.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'package:admin/controllers/MenuController.dart';
import 'package:admin/controllers/MenuAppController.dart';
import 'package:admin/responsive.dart';
import 'package:admin/screens/dashboard/dashboard_screen.dart';
import 'package:flutter/material.dart';
Expand All @@ -10,7 +10,7 @@ class MainScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
key: context.read<MenuController>().scaffoldKey,
key: context.read<MenuAppController>().scaffoldKey,
drawer: SideMenu(),
body: SafeArea(
child: Row(
Expand Down
Loading

0 comments on commit d3a60d7

Please sign in to comment.