remove unused code

This commit is contained in:
Godwin Asuquo 2023-02-23 18:18:40 +02:00
parent 28c599e68a
commit 016bca01f4
4 changed files with 12 additions and 26 deletions

View file

@ -35,8 +35,6 @@ abstract class BasePage extends StatelessWidget {
Widget? get endDrawer => null; Widget? get endDrawer => null;
PreferredSizeWidget? desktopAppBar(BuildContext context) => null;
AppBarStyle get appBarStyle => AppBarStyle.regular; AppBarStyle get appBarStyle => AppBarStyle.regular;
Widget Function(BuildContext, Widget)? get rootWrapper => null; Widget Function(BuildContext, Widget)? get rootWrapper => null;
@ -152,7 +150,7 @@ abstract class BasePage extends StatelessWidget {
resizeToAvoidBottomInset: resizeToAvoidBottomInset, resizeToAvoidBottomInset: resizeToAvoidBottomInset,
extendBodyBehindAppBar: extendBodyBehindAppBar, extendBodyBehindAppBar: extendBodyBehindAppBar,
endDrawer: endDrawer, endDrawer: endDrawer,
appBar: desktopAppBar(context) ?? appBar(context), appBar: appBar(context),
body: body(context), body: body(context),
floatingActionButton: floatingActionButton(context)); floatingActionButton: floatingActionButton(context));

View file

@ -1,14 +1,15 @@
import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/store/settings_store.dart'; import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/themes/theme_base.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class DesktopNavbar extends StatelessWidget implements PreferredSizeWidget { class DesktopDashboardNavbar extends StatelessWidget implements ObstructingPreferredSizeWidget {
final Widget leading; final Widget leading;
final Widget middle; final Widget middle;
final Widget trailing; final Widget trailing;
DesktopNavbar({ DesktopDashboardNavbar({
super.key, super.key,
required this.leading, required this.leading,
required this.middle, required this.middle,
@ -41,4 +42,7 @@ class DesktopNavbar extends StatelessWidget implements PreferredSizeWidget {
@override @override
Size get preferredSize => Size.fromHeight(60); Size get preferredSize => Size.fromHeight(60);
@override
bool shouldFullyObstruct(BuildContext context) => false;
} }

View file

@ -2,13 +2,14 @@ import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_dashboard_page.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_dashboard_page.dart';
import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_dashboard_navbar.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator.dart';
import 'package:cake_wallet/src/widgets/desktop_nav_bar.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:cake_wallet/view_model/dashboard/desktop_sidebar_view_model.dart'; import 'package:cake_wallet/view_model/dashboard/desktop_sidebar_view_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/router.dart' as Router; import 'package:cake_wallet/router.dart' as Router;
@ -28,7 +29,7 @@ class DesktopSidebarWrapper extends BasePage {
static Key _pageViewKey = GlobalKey(); static Key _pageViewKey = GlobalKey();
@override @override
PreferredSizeWidget desktopAppBar(BuildContext context) => DesktopNavbar( ObstructingPreferredSizeWidget appBar(BuildContext context) => DesktopDashboardNavbar(
leading: Padding( leading: Padding(
padding: EdgeInsets.only(left: sideMenuWidth), padding: EdgeInsets.only(left: sideMenuWidth),
child: getIt<DesktopWalletSelectionDropDown>(), child: getIt<DesktopWalletSelectionDropDown>(),
@ -80,23 +81,6 @@ class DesktopSidebarWrapper extends BasePage {
double get sideMenuWidth => 76.0; double get sideMenuWidth => 76.0;
@override
Widget Function(BuildContext, Widget) get rootWrapper =>
(BuildContext context, Widget scaffold) => Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Theme.of(context).accentColor,
Theme.of(context).scaffoldBackgroundColor,
Theme.of(context).primaryColor,
],
begin: Alignment.topRight,
end: Alignment.bottomLeft,
),
),
child: scaffold,
);
@override @override
Widget body(BuildContext context) { Widget body(BuildContext context) {
_setEffects(); _setEffects();

View file

@ -1,7 +1,7 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget { class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget {
factory NavBar({Widget? leading, Widget? middle, Widget? trailing, bool useDesktopAppbar = false, Color? backgroundColor,}) { factory NavBar({Widget? leading, Widget? middle, Widget? trailing, Color? backgroundColor}) {
return NavBar._internal( return NavBar._internal(
leading: leading, leading: leading,
middle: middle, middle: middle,
@ -11,7 +11,7 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget {
} }
factory NavBar.withShadow( factory NavBar.withShadow(
{Widget? leading, Widget? middle, Widget? trailing, Color? backgroundColor, bool useDesktopAppbar = false,}) { {Widget? leading, Widget? middle, Widget? trailing, Color? backgroundColor}) {
return NavBar._internal( return NavBar._internal(
leading: leading, leading: leading,
middle: middle, middle: middle,