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

HiddenDrawer works on iPad, but has issues with iPhone and Gesture detector #60

Open
cpuell opened this issue Nov 17, 2023 · 0 comments

Comments

@cpuell
Copy link

cpuell commented Nov 17, 2023

Hi,.

When run app with hidden drawer on iPad it works fine, but on iPhone it shows laggy and takes much time to detect the gesture on leading action button in app bar. I don't see any error in my debug console.

iPhone 14 Pro Max iOS ver. 17.1.1
iPad Air (5. Gen) iOS ver. 17.1.1
Flutter 3.16.0

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.0, on macOS 14.1.1 23B81 darwin-arm64, locale de-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.84.2)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

Not sure why, but when i run it on iPad it flawlessly detect the open and close toggle on leading icon button.

I don't have such a complicated structure, just using the basic implementation.

class HiddenDrawer extends StatefulWidget {
  const HiddenDrawer({Key? key}) : super(key: key);

  static const routeName = '/hidden_drawer';

  @override
  State<HiddenDrawer> createState() => _HiddenDrawerState();
}

class _HiddenDrawerState extends State<HiddenDrawer> {
  List<ScreenHiddenDrawer> _pages = [];

  final menuItemTextStyle = TextStyle(
      fontWeight: FontWeight.bold, fontSize: 18, color: AppTheme.corporate500);

  final menuItemTextStyleSelected = TextStyle(
      fontWeight: FontWeight.bold, fontSize: 18, color: AppTheme.corporate500);

  @override
  void initState() {
    super.initState();
    _pages = [
      ScreenHiddenDrawer(
        ItemHiddenMenu(
          name: 'Profile',
          baseStyle: menuItemTextStyle,
          selectedStyle: menuItemTextStyleSelected,
          colorLineSelected: Colors.black,
        ),
        CustomerProfileDetail(),
      ),
      ScreenHiddenDrawer(
        ItemHiddenMenu(
          name: 'Settings',
          baseStyle: menuItemTextStyle,
          selectedStyle: menuItemTextStyleSelected,
          colorLineSelected: Colors.black,
        ),
        SettingsPage(),
      ),
    ];
  }

  @override
  Widget build(BuildContext context) {
    return HiddenDrawerMenu(
      // elevationAppBar: 10,
      disableAppBarDefault: false,
      backgroundColorMenu: Theme.of(context).scaffoldBackgroundColor,
      screens: _pages,
      initPositionSelected: 1,
      slidePercent: 60,
      contentCornerRadius: 24,
    );
  }
}
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

1 participant