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

[0.2.0] ModalBottom sheet doesn't resize correctly on tablets #147

Open
abigotado opened this issue Jun 24, 2023 · 6 comments
Open

[0.2.0] ModalBottom sheet doesn't resize correctly on tablets #147

abigotado opened this issue Jun 24, 2023 · 6 comments

Comments

@abigotado
Copy link

Encountered strange problem: when I run my app on tablet (iPad 10th gen) modal bottom sheet resizes incorrectly - it's has smaller width than screen. Problem occurres with version 0.2.0.

simulator_screenshot_D80333FA-D536-4329-A64B-68FAF5D595A5

To reproduce just create a new app with scaffold and modal bottom sheet and this wrapper:

import 'package:flutter/material.dart';
import 'package:responsive_framework/responsive_wrapper.dart';

// coverage:ignore-file

/// Class for creating responsive view depending on screen size.
class MainResponsiveWrapper extends StatelessWidget {
  /// Creates MainResponsiveWrapper.
  const MainResponsiveWrapper({required this.child, super.key});

  /// Widget, which will be wrapped in [ResponsiveWrapper].
  final Widget child;

  @override
  Widget build(final BuildContext context) => ResponsiveWrapper(
        minWidth: 320,
        defaultScale: true,
        mediaQueryData: MediaQuery.of(context).copyWith(textScaleFactor: 1),
        alignment: Alignment.center,
        defaultScaleLandscape: true,
        breakpoints: const <ResponsiveBreakpoint>[
          /// Examples: old Android phones.
          ResponsiveBreakpoint.resize(320, name: PHONE, scaleFactor: 0.7),

          /// Examples: iPhone SE 3
          ResponsiveBreakpoint.resize(
            360,
            name: 'SMALL_MOBILE',
            scaleFactor: 0.9,
          ),

          /// Examples: iPhone 14 PRO, Xiaomi 12
          ResponsiveBreakpoint.resize(
            390,
            name: MOBILE,
            scaleFactor: 1,
          ),

          /// Examples: iPhone 14 PRO MAX
          ResponsiveBreakpoint.resize(
            428,
            name: 'BIG_MOBILE',
            scaleFactor: 1.15,
          ),

          /// Examples: foldable smartphones
          ResponsiveBreakpoint.autoScale(
            520,
            name: 'HUGE_MOBILE',
            scaleFactor: 0.9,
          ),

          /// Examples: iPad mini
          ResponsiveBreakpoint.autoScale(680, name: TABLET, scaleFactor: 1),

          /// Examples: iPad Pro (12.9-inch)
          ResponsiveBreakpoint.resize(
            1000,
            name: 'BIG_TABLET',
            scaleFactor: 1.1,
          ),
        ],
        child: child,
      );
}

If I remove responsive wrapper^ everything is OK.

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.4 22F66 darwin-arm64, locale ru-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.2)
[✓] IntelliJ IDEA Community Edition (version 2022.2)
[✓] VS Code (version 1.78.0)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!
@abigotado
Copy link
Author

@rayliverified Are you still maintaining the package?

@rayliverified
Copy link
Contributor

Yes, the package just recently received a complete rewrite.

@abigotado
Copy link
Author

@rayliverified Thank you for your answer and for the package! I love the package and was a little bit worried as there are enough issues without answers

@rayliverified
Copy link
Contributor

Unfortunately, I've been very sick for the past year with Long Covid.

I'm also trying my best to launch Codelessly. Especially the past few months now that I've felt better.

The moment I started feeling better, I rewrote this package to address the underlying cause of these long standing issues. Hopefully that's proof of my dedication there.

@abigotado
Copy link
Author

Get well!!! And thank you very much for your efforts and for a wonderful package!

@abigotado
Copy link
Author

Any updates?

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