Codelessly / ResponsiveFramework

Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple. Demo: https://gallery.codelessly.com/flutterwebsites/minimal/
https://codelessly.com
MIT License
1.25k stars 150 forks source link

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

Open abigotado opened 1 year ago

abigotado commented 1 year ago

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 commented 1 year ago

@rayliverified Are you still maintaining the package?

rayliverified commented 1 year ago

Yes, the package just recently received a complete rewrite.

abigotado commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

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

abigotado commented 8 months ago

Any updates?