Git Product home page Git Product logo

side_navigation's Introduction

side_navigation's People

Contributors

jakehschwartz avatar jksevend avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

side_navigation's Issues

Required image on the SideNavigationBarHeader

I'm using your package and it's super good, thanks for that. I wanted to add a header to my side navigation bar, I used the SideNavigationBarHeader, but the image is required, and according to the design that I'm creating there is no image to display, so that would be great if you turn the image into an optional nullable parameter. Thanks!

Unselected item color

I would like to be able to choose the unselected color in the SideNavigationBarItem for icon and label. The background being used almost makes the unselected items disappear.

icon color

How can I change the Icon Color to white. so I cal view them when I have set page background to black
expandIcon: Icons.arrow_right,
shrinkIcon: Icons.arrow_left,

Examples

Hi do you have examples for using the Theme options

SideNavigationBarTheme Fields
ItemTheme fields
TogglerTheme fields

How to detect drawer button click

Please let me know when i click on the bottom button that is use for open and close drawer
is there any key to detect that drawer is open or not?
i want to perform some action on drawer button click
Screenshot (93)

SideNavigationBarItem items are faded

Dev environment:

$ flutter --version
Flutter 3.3.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision d9111f6402 (6 days ago) • 2022-10-19 12:27:13 -0700
Engine • revision 3ad69d7be3
Tools • Dart 2.18.2 • DevTools 2.15.0

Lib version:
side_navigation: ^1.0.4

Project: Created a sample flutter project for Web and Linux, added the side bar, and the items (aka SideNavigationBarItem) are faded.

Code:

   @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      body: Row(
        children: [
          SideNavigationBar(
            selectedIndex: _index,
            header: SideNavigationBarHeader(
                image: CircleAvatar(
                  child: Icon(Icons.wallet),
                ),
                title: Text('Test', style: Theme.of(context).textTheme.headline6),
                subtitle: SizedBox.shrink(),
            ),
            footer: const SideNavigationBarFooter(
                label: Text('Footer label')
            ),
            items: const [
              SideNavigationBarItem(
                icon: Icons.dashboard,
                label: 'Dashboard',
              ),
              SideNavigationBarItem(
                icon: Icons.person,
                label: 'Account',
              ),
              SideNavigationBarItem(
                icon: Icons.settings,
                label: 'Settings',
              ),
            ],
            onTap: (index) {
              setState(() {
                _index = index;
              });
            },
          ),
          Expanded(
            child: ListView(
              children: [
                Text('Main body', style: Theme.of(context).textTheme.headline4,),
              ],
            ),
          ),
        ],
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }

Result (Web):
image

Result (Linux):
image

Any idea why items have a bit of a fade? Anything that I'm missing in the config?

Error: Required named parameter 'vsync' must be provided on build

I got this error on build

ERROR: ../../.pub-cache/hosted/pub.dartlang.org/side_navigation-0.0.7/lib/src/api/side_navigation_bar.dart:104:26: Error: Required named parameter 'vsync' must be provided.
ERROR:       child: AnimatedSize(
ERROR:                          ^
ERROR: ../../snap/flutter/common/flutter/packages/flutter/lib/src/widgets/animated_size.dart:56:9: Context: Found this candidate, but the arguments don't match.
ERROR:   const AnimatedSize({
ERROR:         ^^^^^^^^^^^^
Exception: Build process failed

this is my base.dart

class Base extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _Base();
}

class _Base extends State<Base> {
  List<Widget> views = const [
    Center(
      child: Text('Setting'),
    ),
    Center(
      child: Text('Account'),
    ),
    Center(
      child: Text('Settings'),
    ),
  ];

  /// The currently selected index of the bar
  int selectedIndex = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      /// You can use an AppBar if you want to
      //appBar: AppBar(
      //  title: const Text('App'),
      //),

      // The row is needed to display the current view
      body: Row(
        children: [
          /// Pretty similar to the BottomNavigationBar!
          SideNavigationBar(
            selectedIndex: selectedIndex,
            items: const [
              SideNavigationBarItem(
                icon: Icons.dashboard,
                label: 'Dashboard',
              ),
              SideNavigationBarItem(
                icon: Icons.person,
                label: 'Account',
              ),
              SideNavigationBarItem(
                icon: Icons.settings,
                label: 'Settings',
              ),
            ],
            onTap: (index) {
              setState(() {
                selectedIndex = index;
              });
            },
          ),

          /// Make it take the rest of the available width
          Expanded(
            child: views.elementAt(selectedIndex),
          )
        ],
      ),
    );
  }
}

I just add the example on my base class.

Cant scroll on web

       Expanded(
        child: _body(context),
      ) 

_body returns a listview but I cant scroll in Chrome for Desktop and Edge for Desktop I can scroll fine on mobile browsers and

Overflow error error when reducing size

Hi, i found a bug that i think is quite easy to fix, when side bar is expanded try to pull right side of the window to shrink window width, at the moment when size of whole window is smaller then size of side bar, you will get overflow error.
I think if the width of window is smaller then (lets say 600) then it should auto fold to prevent this error from happening

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.