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

Onpress dont work will wrapped in containner #6

Closed
Yanaus opened this issue Nov 24, 2020 · 1 comment
Closed

Onpress dont work will wrapped in containner #6

Yanaus opened this issue Nov 24, 2020 · 1 comment

Comments

@Yanaus
Copy link

Yanaus commented Nov 24, 2020

Hello,

Onpress function stop working when i wrapped the UnicornDialer button in a container

Here is my code

` @OverRide
Widget build(BuildContext context) {
var childButtons = List();

childButtons.add(UnicornButton(
    hasLabel: true,
    labelText: "Chii chii",
    currentButton: FloatingActionButton(
        heroTag: "airplane",
        backgroundColor: Colors.greenAccent,
        mini: true,
        onPressed: () {print('chii chii');},
        child: Icon(Icons.airplanemode_active))));

childButtons.add(UnicornButton(
    hasLabel: true,
    labelText: "Choo choo",
    currentButton: FloatingActionButton(
        heroTag: "airplane",
        backgroundColor: Colors.greenAccent,
        mini: true,
        onPressed: () {print('choo choo');},
        child: Icon(Icons.airplanemode_active))));

childButtons.add(UnicornButton(
    hasLabel: true,
    labelText: "Chaa chaa",
    currentButton: FloatingActionButton(
        heroTag: "directions",
        backgroundColor: Colors.blueAccent,
        mini: true,
        child: Icon(Icons.directions_car))));

return Scaffold(
  
  floatingActionButton: Container(
    width: 100.0,
    height: 100.0,
    child: UnicornDialer(
        hasNotch: true,
        //hasBackground: false,
        backgroundColor: Color.fromRGBO(255, 255, 255, 0.0),
        parentButtonBackground: Colors.redAccent,
        orientation: UnicornOrientation.VERTICAL,
        parentButton: Icon(Icons.add),
        childButtons: childButtons),
  ),
  floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
  bottomNavigationBar: AnimatedBottomNavigationBar(
    gapLocation: GapLocation.center,
    notchSmoothness: NotchSmoothness.softEdge,
    icons: iconList,
    activeIndex: _currentIndex,
    inactiveColor: Colors.grey[800],
    onTap: (index) => onTabTapped(index),
  ),
  body: PageView(
    controller: _pageController,

    physics: NeverScrollableScrollPhysics(),  
    children: <Widget>[
      Explore(),
      StatesPage(),
      BookmarkPage(),
      ProfilePage(),
      MapSample()

    ],
  ),
);

}`

@vizhan-lanars
Copy link
Collaborator

Hi
Could you be more specific, please?
As I understood, child buttons (UnicornButton) onPressed is not fired. I guess the issue is on the unicorndial side. It's quite outdated.
I've found a couple of related issues #13 & #46.
According to answer, try to give more space for UnicornDialer (e.g. 300.0). See below:

  floatingActionButton: Container(
    width: 300.0,
    height: 300.0,
    child: UnicornDialer(
        hasNotch: true,
        //hasBackground: false,
        backgroundColor: Color.fromRGBO(255, 255, 255, 0.0),
        parentButtonBackground: Colors.redAccent,
        orientation: UnicornOrientation.VERTICAL,
        parentButton: Icon(Icons.add),
        childButtons: childButtons),
  ),

For now I'm going to close this issue.
Feel free to reopen it, if needed.

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