Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging bottom bar does not work #13

Open
Sun3 opened this issue May 30, 2020 · 1 comment
Open

Dragging bottom bar does not work #13

Sun3 opened this issue May 30, 2020 · 1 comment

Comments

@Sun3
Copy link

Sun3 commented May 30, 2020

Using the sample code provided by this repo when you try to drag the bottom bar up or down it does not move. Is there a setting to change?

Thanks

@ederjavs
Copy link

ederjavs commented Aug 25, 2020

the secret is the controller

class _MyScreenState extends State<MyScreen> with SingleTickerProviderStateMixin {
BottomBarController controlador;

......

@OverRide
void initState() {
super.initState();
controlador = BottomBarController(vsync: this, dragLength: 450, snap: true);
}

floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: GestureDetector(
// Set onVerticalDrag event to drag handlers of controller for swipe effect
onVerticalDragUpdate: controlador.onDrag,
onVerticalDragEnd: controlador.onDragEnd,
child: FloatingActionButton.extended(
heroTag: null,
label: Text("Pull up"),
elevation: 2,
backgroundColor: Colors.deepOrange,
foregroundColor: Colors.white,

      //Set onPressed event to swap state of bottom bar
      onPressed: () {
        print("object");
        controlador.swap();
      },
    ),
  ),
  bottomNavigationBar: BottomExpandableAppBar(
    controller: controlador,
    expandedHeight: 550,
    horizontalMargin: 16,
    shape: AutomaticNotchedShape(
        RoundedRectangleBorder(), StadiumBorder(side: BorderSide())),
    expandedBackColor: Colors.white,
    expandedBody: Center(
      child: Text("Hello world!"),
    ),
    bottomAppBarBody: Padding(
      padding: const EdgeInsets.all(8.0),
      child: Row(
        mainAxisSize: MainAxisSize.max,
        children: <Widget>[
          Expanded(
            child: Text(
              "Tets",
              textAlign: TextAlign.center,
            ),
          ),
          Spacer(
            flex: 2,
          ),
          Expanded(
            child: Text(
              "Stet",
              textAlign: TextAlign.center,
            ),
          ),
        ],
      ),
    ),
  ),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants