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

[pull] main from jamesblasco:main #1

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
42da8b0
resolve name conflict in Flutter 3.7 (#315)
danReynolds Jan 26, 2023
2e9afce
fix: deprecate duplicated name (#323)
jamesblasco Jan 28, 2023
2073bdd
fix: flutter 3.7 (#324)
jamesblasco Jan 28, 2023
09f4adc
Remove accessibleNavigation reference from BottomSheet (#339)
itome Jun 18, 2023
2005ba1
fixes (#353)
harshitAmar Jun 18, 2023
62c5428
:bug: (Annotated region) (#352)
T-moz Jun 18, 2023
3917484
fixes issue 343 (#344)
Skogsfrae Jun 18, 2023
6a5816d
Rudimentary fix for devicePixelRatio (#365)
saltedpotatos Sep 3, 2023
d89711d
chore: fix analysis issues for flutter 3.1.3 (#376)
remonh87 Sep 25, 2023
9f1817e
Initial route fix (#379)
kvenn Nov 8, 2023
62e11d6
feat: sheet improvements (#355)
jamesblasco Nov 8, 2023
639ccad
fix: update lints (#380)
jamesblasco Nov 8, 2023
d5c9ceb
[sheet] fixed for Flutter 3.16 (#381)
webhaikal Nov 20, 2023
2703e68
fix: adapt scrollable.dart to upstream SemanticsNode changes (#387)
richardshiue Mar 12, 2024
14ff58b
Expose `onAttach` and `onDetach` in scroll controller (#386)
Hari-07 Mar 12, 2024
e06e8e9
chore: Update example to latest flutter (#383)
joaobentes Mar 12, 2024
2e4826d
feat: bring up to date (#391)
jamesblasco Mar 12, 2024
17bc799
fix: prepare for will pop deprecation
jamesblasco Mar 12, 2024
e44458d
feat: prepare 3.0 release (#392)
jamesblasco Mar 12, 2024
55a97bc
Fix the system UI overlay style in the `CupertinoModalBottomSheetRout…
creativecreatorormaybenot Nov 18, 2024
2b014f4
Fix update Sheet content while initializing (#432)
maRci002 Nov 18, 2024
2a94be3
chore(deps): bump mocktail from 1.0.3 to 1.0.4 in /sheet (#408)
dependabot[bot] Nov 18, 2024
6190855
chore(deps): bump meta from 1.11.0 to 1.12.0 in /sheet (#406)
dependabot[bot] Nov 18, 2024
323e3a9
chore(deps): bump lints from 3.0.0 to 4.0.0 in /sheet (#402)
dependabot[bot] Nov 18, 2024
19471c1
chore(deps): bump lints from 3.0.0 to 4.0.0 in /modal_bottom_sheet (#…
dependabot[bot] Nov 18, 2024
ac1ddc8
Prevent scrolling beyond the maximum position (#427)
9AZX Nov 18, 2024
208300a
Allow resizing sheet larger than minResizableExtent when resizable is…
apackin Nov 18, 2024
c6718a0
Feat/add draggable property cupertino sheet route (#357)
Joran-Dob Nov 18, 2024
a87f82b
feat: pop scope (#437)
jamesblasco Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions modal_bottom_sheet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 3.0.0 - Flutter 3.19

+ Migrates to Flutter 3.19
+ ModalBottomSheetRoute has been renamed to ModalSheetRoute
- WillPopScope support will be replaced for PopScope functionality


## 3.0.0-pre - Flutter 3.7

+ Migrates to Flutter 3.7
+ ModalBottomSheetRoute has been renamed to ModalSheetRoute so it does not conflict with the new class from Flutter 3.7

## 2.1.1
+ Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion modal_bottom_sheet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Why not `showModalBottomSheet`?
Inspired by `showModalBottomSheet`, it completes with some must-need features:

- Support for inside scrollview + dragging down to close (`showModalBottomSheet` won't work correctly with scrollviews.
- Support for `WillPopScope` to prevent closing the dialog.
- Support for `PopScope` and `WillPopScope` to prevent closing the dialog.
- Support for scroll to top when tapping status bar (iOS only)
- Support for top SafeArea (not supported by showModalBottomSheet)
- Cupertino modal bottom sheet
Expand Down
5 changes: 1 addition & 4 deletions modal_bottom_sheet/example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@


enable-experiment:
- extension-methods
include: package:lints/recommended.yaml
6 changes: 3 additions & 3 deletions modal_bottom_sheet/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 31
compileSdkVersion 33

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -35,8 +35,8 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.example"
minSdkVersion 16
targetSdkVersion 31
minSdkVersion flutter.minSdkVersion
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
4 changes: 2 additions & 2 deletions modal_bottom_sheet/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.7.10'
repositories {
google()
jcenter()
Expand All @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
10 changes: 7 additions & 3 deletions modal_bottom_sheet/example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
org.gradle.jvmargs=-Xmx1536M \
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED
android.useAndroidX=true
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion modal_bottom_sheet/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
8 changes: 4 additions & 4 deletions modal_bottom_sheet/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_ios/ios"

SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
url_launcher_ios: 68d46cc9766d0c41dbdc884310529557e3cd7a86

PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011

COCOAPODS: 1.11.3
COCOAPODS: 1.15.2
17 changes: 11 additions & 6 deletions modal_bottom_sheet/example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -113,7 +113,6 @@
9E13656F8C2A211F9F4C04EF /* Pods-Runner.release.xcconfig */,
C33049C8773181A0B4BCD4EE /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -156,7 +155,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1300;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -200,10 +199,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand All @@ -214,6 +215,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -340,7 +342,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -356,6 +358,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 87RQQPQ85J;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down Expand Up @@ -417,7 +420,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -466,7 +469,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand All @@ -483,6 +486,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 87RQQPQ85J;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand All @@ -505,6 +509,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 87RQQPQ85J;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 2 additions & 0 deletions modal_bottom_sheet/example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,7 @@
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
6 changes: 3 additions & 3 deletions modal_bottom_sheet/example/lib/examples/cupertino_share.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class CupertinoSharePage extends StatelessWidget {
}

class PhotoShareBottomSheet extends StatelessWidget {
const PhotoShareBottomSheet({Key? key}) : super(key: key);
const PhotoShareBottomSheet({super.key});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -539,9 +539,9 @@ final actions2 = [
];

extension ListUtils<T> on List<T> {
List<T> addItemInBetween<A extends T>(A item) => this.length == 0
List<T> addItemInBetween<A extends T>(A item) => isEmpty
? this
: (this.fold([], (r, element) => [...r, element, item])..removeLast());
: (fold([], (r, element) => [...r, element, item])..removeLast());
}

class SimpleSliverDelegate extends SliverPersistentHeaderDelegate {
Expand Down
11 changes: 5 additions & 6 deletions modal_bottom_sheet/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ class MyApp extends StatelessWidget {
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key? key, required this.title}) : super(key: key);
MyHomePage({super.key, required this.title});

final String title;

@override
_MyHomePageState createState() => _MyHomePageState();
State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
Expand Down Expand Up @@ -208,8 +208,7 @@ class _MyHomePageState extends State<MyHomePage> {
builder: (context) => ModalWithNavigator(),
)),
ListTile(
title:
Text('Cupertino Navigator + Scroll + WillPopScope'),
title: Text('Cupertino Navigator + Scroll + PopScope'),
onTap: () => showCupertinoModalBottomSheet(
expand: true,
context: context,
Expand All @@ -218,7 +217,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
),
ListTile(
title: Text('Modal with WillPopScope'),
title: Text('Modal with PopScope'),
onTap: () => showCupertinoModalBottomSheet(
expand: true,
context: context,
Expand Down Expand Up @@ -260,7 +259,7 @@ class _MyHomePageState extends State<MyHomePage> {
padding: EdgeInsets.fromLTRB(16, 20, 16, 8),
child: Text(
title,
style: Theme.of(context).textTheme.caption,
style: Theme.of(context).textTheme.bodySmall,
),
);
}
Expand Down
10 changes: 5 additions & 5 deletions modal_bottom_sheet/example/lib/modals/circular_modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ import 'dart:math';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart'
as modal_bottom_sheet;

class AvatarBottomSheet extends StatelessWidget {
final Widget child;
final Animation<double> animation;
final SystemUiOverlayStyle? overlayStyle;

const AvatarBottomSheet(
{Key? key,
{super.key,
required this.child,
required this.animation,
this.overlayStyle})
: super(key: key);
this.overlayStyle});

@override
Widget build(BuildContext context) {
Expand Down Expand Up @@ -98,7 +98,7 @@ Future<T?> showAvatarModalBottomSheet<T>({
assert(debugCheckHasMediaQuery(context));
assert(debugCheckHasMaterialLocalizations(context));
final result = await Navigator.of(context, rootNavigator: useRootNavigator)
.push(ModalBottomSheetRoute<T>(
.push(modal_bottom_sheet.ModalSheetRoute<T>(
builder: builder,
containerBuilder: (_, animation, child) => AvatarBottomSheet(
child: child,
Expand Down
3 changes: 1 addition & 2 deletions modal_bottom_sheet/example/lib/modals/floating_modal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ class FloatingModal extends StatelessWidget {
final Widget child;
final Color? backgroundColor;

const FloatingModal({Key? key, required this.child, this.backgroundColor})
: super(key: key);
const FloatingModal({super.key, required this.child, this.backgroundColor});

@override
Widget build(BuildContext context) {
Expand Down
54 changes: 28 additions & 26 deletions modal_bottom_sheet/example/lib/modals/modal_complex_all.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,38 @@ import 'package:flutter/material.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';

class ComplexModal extends StatelessWidget {
const ComplexModal({Key? key}) : super(key: key);
const ComplexModal({super.key});

@override
Widget build(BuildContext context) {
return Material(
child: WillPopScope(
onWillPop: () async {
bool shouldClose = true;
await showCupertinoDialog(
context: context,
builder: (context) => CupertinoAlertDialog(
title: Text('Should Close?'),
actions: <Widget>[
CupertinoButton(
child: Text('Yes'),
onPressed: () {
shouldClose = true;
Navigator.of(context).pop();
},
),
CupertinoButton(
child: Text('No'),
onPressed: () {
shouldClose = false;
Navigator.of(context).pop();
},
),
],
));
return shouldClose;
child: PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (!didPop) {
final sheetNavigator = Navigator.of(context);

showCupertinoDialog(
context: context,
builder: (context) => CupertinoAlertDialog(
title: Text('Should Close?'),
actions: <Widget>[
CupertinoButton(
child: Text('Yes'),
onPressed: () {
Navigator.of(context).pop();
sheetNavigator.pop();
},
),
CupertinoButton(
child: Text('No'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
));
}
},
child: Navigator(
onGenerateRoute: (_) => MaterialPageRoute(
Expand Down
Loading