Jaime Blasco
Committed by GitHub

Merge branch 'master' into master

Showing 49 changed files with 880 additions and 514 deletions
name: Runnable (stable)
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
jobs:
analyze:
name: Analyze on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '11.x'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Log Dart/Flutter versions
run: |
dart --version
flutter --version
- name: Prepare dependencies
run: flutter pub get
- name: Analyse the repo
run: flutter analyze lib
- name: Run tests
run: flutter test
... ...
... ... @@ -15,10 +15,12 @@
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Visual Studio Code related
.classpath
.project
.settings/
.vscode/*
# Flutter/Dart/Pub related
**/doc/api/
... ... @@ -74,3 +76,5 @@ build/
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
**/macos/Flutter/ephemeral/
... ...
## 2.1.0 - Flutter 3.0
+ Migrates to Flutter 3.0
+ Use PageRoute to allow Hero animations
## 2.0.1 - Small fixes
+ Fixes bug with will pop scope
+ Replaces VelocityTracker deprecated constructor
+ Add optional RouteSettings to all showModal methods
## 2.0.0-nullsafety.1 - Null Safety support
+ Fixes #119 & #113
... ...
... ... @@ -26,6 +26,7 @@ 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 scroll to top when tapping status bar (iOS only)
- Support for top SafeArea (not supported by showModalBottomSheet)
- Cupertino modal bottom sheet
- Create custom modal bottom sheet
... ...
include: package:pedantic/analysis_options.yaml
enable-experiment:
- extension-methods
\ No newline at end of file
include: package:lints/recommended.yaml
\ No newline at end of file
... ...
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
# This file should be version controlled.
version:
revision: 32b17974ea81619064ab60e2513c5ce044c3fef2
channel: master
revision: cd41fdd495f6944ecd3506c21e94c6567b073278
channel: stable
project_type: app
# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
- platform: android
create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
- platform: ios
create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
- platform: linux
create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
- platform: macos
create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
- platform: web
create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
- platform: windows
create_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
base_revision: cd41fdd495f6944ecd3506c21e94c6567b073278
# User provided section
# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
... ...
... ... @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 30
compileSdkVersion 31
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
... ... @@ -36,7 +36,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.example"
minSdkVersion 16
targetSdkVersion 30
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
... ...
... ... @@ -9,7 +9,8 @@
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
android:exported="true">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
... ...
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
... ...
... ... @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>9.0</string>
</dict>
</plist>
... ...
PODS:
- Flutter (1.0.0)
- url_launcher_ios (0.0.1):
- Flutter
DEPENDENCIES:
- Flutter (from `Flutter`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
EXTERNAL SOURCES:
Flutter:
:path: Flutter
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
COCOAPODS: 1.11.2
... ...
... ... @@ -3,12 +3,13 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
63A861FE74EE80D78677751E /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8A9BC1675DC08B85185F5B8C /* Pods_Runner.framework */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
... ... @@ -31,10 +32,12 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
1A6B1787D436F43E646D2FA9 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
8A9BC1675DC08B85185F5B8C /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
... ... @@ -42,6 +45,8 @@
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9E13656F8C2A211F9F4C04EF /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
C33049C8773181A0B4BCD4EE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
... ... @@ -49,6 +54,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
63A861FE74EE80D78677751E /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
... ... @@ -72,6 +78,8 @@
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
9F130398C730264830D81C7A /* Pods */,
B01A076C020C44AA1586D1A9 /* Frameworks */,
);
sourceTree = "<group>";
};
... ... @@ -98,6 +106,25 @@
path = Runner;
sourceTree = "<group>";
};
9F130398C730264830D81C7A /* Pods */ = {
isa = PBXGroup;
children = (
1A6B1787D436F43E646D2FA9 /* Pods-Runner.debug.xcconfig */,
9E13656F8C2A211F9F4C04EF /* Pods-Runner.release.xcconfig */,
C33049C8773181A0B4BCD4EE /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
B01A076C020C44AA1586D1A9 /* Frameworks */ = {
isa = PBXGroup;
children = (
8A9BC1675DC08B85185F5B8C /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
... ... @@ -105,12 +132,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
CA1F95A1D6DE6081F36C77B1 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
AD44E91CFF7319FD809D60C7 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
... ... @@ -127,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
... ... @@ -197,6 +226,45 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
};
AD44E91CFF7319FD809D60C7 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
CA1F95A1D6DE6081F36C77B1 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
... ... @@ -290,7 +358,10 @@
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
... ... @@ -414,7 +485,10 @@
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
... ... @@ -433,7 +507,10 @@
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
... ...
... ... @@ -2,6 +2,6 @@
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
location = "self:">
</FileRef>
</Workspace>
... ...
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
... ...
... ... @@ -4,4 +4,7 @@
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
... ...
... ... @@ -7,38 +7,60 @@ import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
class CupertinoSharePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: appBar(context),
body: CupertinoPageScaffold(
final baseTextStyle = CupertinoTheme.of(context).textTheme.textStyle;
return CupertinoPageScaffold(
backgroundColor: CupertinoTheme.of(context).scaffoldBackgroundColor,
navigationBar: CupertinoNavigationBar(
backgroundColor: CupertinoTheme.of(context).barBackgroundColor,
middle: Column(
children: <Widget>[
Text(
'New York',
style: baseTextStyle,
),
Text(
'1 February 11:45',
style: baseTextStyle.copyWith(
fontWeight: FontWeight.normal,
fontSize: 12,
),
),
],
),
trailing: CupertinoButton(
child: Text('Edit'),
padding: EdgeInsets.zero,
onPressed: () {},
),
),
child: Column(
children: [
Expanded(
child: Center(
child: Hero(
tag: 'image',
child: Image.asset('assets/demo_image.jpeg'),
)),
),
bottomNavigationBar: bottomAppBar(context));
}
PreferredSizeWidget appBar(BuildContext context) {
return CupertinoNavigationBar(
middle: Column(
children: <Widget>[
Text('New York', style: TextStyle(fontWeight: FontWeight.normal)),
Text('1 February 11:45',
style: TextStyle(fontWeight: FontWeight.normal, fontSize: 12))
],
),
trailing: Text(
'Edit',
style: TextStyle(
color: CupertinoTheme.of(context).primaryColor,
),
bottomAppBar(context),
],
),
);
}
Widget bottomAppBar(BuildContext context) {
return BottomAppBar(
return Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(
width: 0.5,
color: CupertinoColors.separator.resolveFrom(context),
),
),
color: CupertinoTheme.of(context).barBackgroundColor,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
... ... @@ -80,9 +102,7 @@ class PhotoShareBottomSheet extends StatelessWidget {
child: Material(
color: Colors.transparent,
child: Scaffold(
backgroundColor: CupertinoTheme.of(context)
.scaffoldBackgroundColor
.withOpacity(0.95),
backgroundColor: CupertinoTheme.of(context).scaffoldBackgroundColor,
extendBodyBehindAppBar: true,
appBar: appBar(context),
body: CustomScrollView(
... ... @@ -96,8 +116,7 @@ class PhotoShareBottomSheet extends StatelessWidget {
height: 318,
child: ListView(
padding: EdgeInsets.all(12).copyWith(
right:
MediaQuery.of(context).size.width / 2 - 100),
right: MediaQuery.of(context).size.width / 2 - 100),
reverse: true,
scrollDirection: Axis.horizontal,
physics: PageScrollPhysics(),
... ... @@ -108,21 +127,24 @@ class PhotoShareBottomSheet extends StatelessWidget {
borderRadius: BorderRadius.circular(12),
child: Hero(
tag: 'image',
child:
Image.asset('assets/demo_image.jpeg'),
))),
child: Image.asset('assets/demo_image.jpeg'),
),
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 6),
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: Image.asset('assets/demo_image.jpeg'),
)),
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 6),
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: Image.asset('assets/demo_image.jpeg'),
)),
),
),
],
),
),
... ... @@ -149,7 +171,7 @@ class PhotoShareBottomSheet extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 4),
child: Column(
children: <Widget>[
if(app.imageUrl != null)
if (app.imageUrl != null)
Material(
child: ClipRRect(
child: Container(
... ... @@ -165,8 +187,8 @@ class PhotoShareBottomSheet extends StatelessWidget {
),
),
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(15)),
borderRadius: BorderRadius.circular(15),
),
elevation: 12,
shadowColor: Colors.black12,
),
... ... @@ -178,7 +200,8 @@ class PhotoShareBottomSheet extends StatelessWidget {
style: TextStyle(fontSize: 11),
)
],
));
),
);
},
itemCount: apps.length,
),
... ... @@ -188,69 +211,137 @@ class PhotoShareBottomSheet extends StatelessWidget {
padding: EdgeInsets.symmetric(horizontal: 18, vertical: 6),
sliver: SliverList(
delegate: SliverChildListDelegate.fixed(
List<Widget>.from(actions.map(
List<Widget>.from(
actions.map(
(action) => Container(
padding: EdgeInsets.symmetric(
vertical: 16, horizontal: 16),
child: Text(
action.title,
style: CupertinoTheme.of(context)
.textTheme
.textStyle,
)),
)).addItemInBetween(Divider(
style:
CupertinoTheme.of(context).textTheme.textStyle,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: CupertinoColors
.tertiarySystemGroupedBackground
.resolveFrom(context),
),
),
),
).addItemInBetween(
Container(
width: double.infinity,
height: 1,
))),
)),
color: CupertinoColors.separator.resolveFrom(context),
),
),
),
),
),
SliverPadding(
padding: EdgeInsets.symmetric(horizontal: 18, vertical: 6),
sliver: SliverList(
delegate: SliverChildListDelegate.fixed(
List<Widget>.from(actions1.map(
List<Widget>.from(
actions1.map(
(action) => Container(
padding: EdgeInsets.symmetric(
vertical: 16, horizontal: 16),
child: Text(
action.title,
style: CupertinoTheme.of(context)
.textTheme
.textStyle,
)),
)).addItemInBetween(Divider(
style:
CupertinoTheme.of(context).textTheme.textStyle,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: action == actions1.first
? Radius.circular(8)
: Radius.zero,
topRight: action == actions1.first
? Radius.circular(8)
: Radius.zero,
bottomLeft: action == actions1.last
? Radius.circular(8)
: Radius.zero,
bottomRight: action == actions1.last
? Radius.circular(8)
: Radius.zero,
),
color: CupertinoColors
.tertiarySystemGroupedBackground
.resolveFrom(context),
),
),
),
).addItemInBetween(
Container(
width: double.infinity,
height: 1,
))),
)
color: CupertinoColors.separator.resolveFrom(context),
),
),
),
),
),
SliverPadding(
padding: EdgeInsets.symmetric(horizontal: 18, vertical: 4),
sliver: SliverList(
delegate: SliverChildListDelegate.fixed(
List<Widget>.from(actions2.map(
List<Widget>.from(
actions2.map(
(action) => Container(
padding: EdgeInsets.symmetric(
vertical: 16, horizontal: 16),
child: Text(
action.title,
style: CupertinoTheme.of(context)
.textTheme
.textStyle,
)),
)).addItemInBetween(Divider(
style:
CupertinoTheme.of(context).textTheme.textStyle,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: action == actions2.first
? Radius.circular(8)
: Radius.zero,
topRight: action == actions2.first
? Radius.circular(8)
: Radius.zero,
bottomLeft: action == actions2.last
? Radius.circular(8)
: Radius.zero,
bottomRight: action == actions2.last
? Radius.circular(8)
: Radius.zero,
),
color: CupertinoColors
.tertiarySystemGroupedBackground
.resolveFrom(context),
),
),
),
).addItemInBetween(
Container(
width: double.infinity,
height: 1,
))),
)
color: CupertinoColors.separator.resolveFrom(context),
),
),
),
),
),
SliverSafeArea(
top: false,
sliver: SliverPadding(
padding: EdgeInsets.only(
bottom: 20,
)),
),
),
)
],
),
)));
),
),
);
}
Widget sliverContactsSection(BuildContext context) {
... ... @@ -268,7 +359,7 @@ class PhotoShareBottomSheet extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 4),
child: Column(
children: <Widget>[
if(person.imageUrl != null)
if (person.imageUrl != null)
Material(
child: CircleAvatar(
backgroundImage: AssetImage(
... ... @@ -322,7 +413,8 @@ class PhotoShareBottomSheet extends StatelessWidget {
fit: BoxFit.cover,
height: 40,
width: 40,
)),
),
),
SizedBox(width: 12),
Expanded(
child: Column(
... ... @@ -348,7 +440,8 @@ class PhotoShareBottomSheet extends StatelessWidget {
.actionTextStyle
.copyWith(
fontSize: 14,
fontWeight: FontWeight.normal),
fontWeight: FontWeight.normal,
),
),
SizedBox(width: 2),
Icon(
... ... @@ -357,9 +450,11 @@ class PhotoShareBottomSheet extends StatelessWidget {
color:
CupertinoTheme.of(context).primaryColor,
)
]),
],
)),
),
],
),
),
GestureDetector(
onTap: () => Navigator.of(context).pop(),
child: Align(
... ... @@ -368,13 +463,15 @@ class PhotoShareBottomSheet extends StatelessWidget {
margin: EdgeInsets.only(top: 14),
padding: EdgeInsets.all(4),
decoration: BoxDecoration(
color: Colors.black.withOpacity(0.1),
color: CupertinoColors.secondarySystemFill
.resolveFrom(context),
shape: BoxShape.circle,
),
child: Icon(
Icons.close,
size: 24,
color: Colors.black54,
color: CupertinoColors.systemFill
.resolveFrom(context),
),
),
),
... ...
... ... @@ -24,10 +24,17 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(platform: TargetPlatform.iOS),
darkTheme: ThemeData.dark().copyWith(platform: TargetPlatform.iOS),
title: 'BottomSheet Modals',
builder: (context, Widget? child) => WebFrame(
child: CupertinoTheme(
data: CupertinoThemeData(
brightness: Theme.of(context).brightness,
scaffoldBackgroundColor: CupertinoColors.systemBackground,
),
child: child!,
),
),
onGenerateRoute: (RouteSettings settings) {
switch (settings.name) {
case '/':
... ... @@ -40,14 +47,13 @@ class MyApp extends StatelessWidget {
body: CupertinoScaffold(
body: Builder(
builder: (context) => CupertinoPageScaffold(
backgroundColor: Colors.white,
navigationBar: CupertinoNavigationBar(
transitionBetweenRoutes: false,
middle: Text('Normal Navigation Presentation'),
trailing: GestureDetector(
child: Icon(Icons.arrow_upward),
onTap: () => CupertinoScaffold
.showCupertinoModalBottomSheet(
onTap: () =>
CupertinoScaffold.showCupertinoModalBottomSheet(
expand: true,
context: context,
backgroundColor: Colors.transparent,
... ... @@ -60,23 +66,25 @@ class MyApp extends StatelessWidget {
right: 40,
bottom: 20,
child: MaterialButton(
onPressed: () => Navigator.of(
context)
.popUntil((route) =>
route.settings.name == '/'),
onPressed: () => Navigator.of(context).popUntil(
(route) => route.settings.name == '/'),
child: Text('Pop back home'),
),
)
],
),
)),
),
child: Center(child: Container()),
),
),
child: Center(
child: Container(),
),
),
settings: settings);
),
),
),
settings: settings,
);
},
debugShowCheckedModeBanner: false,
);
... ... @@ -98,7 +106,6 @@ class _MyHomePageState extends State<MyHomePage> {
return Material(
child: Scaffold(
body: CupertinoPageScaffold(
backgroundColor: Colors.white,
navigationBar: CupertinoNavigationBar(
transitionBetweenRoutes: false,
middle: Text('iOS13 Modal Presentation'),
... ... @@ -129,7 +136,8 @@ class _MyHomePageState extends State<MyHomePage> {
context: context,
backgroundColor: Colors.transparent,
builder: (context) => ModalFit(),
)),
),
),
ListTile(
title: Text('Bar Modal'),
onTap: () => showBarModalBottomSheet(
... ... @@ -137,7 +145,8 @@ class _MyHomePageState extends State<MyHomePage> {
context: context,
backgroundColor: Colors.transparent,
builder: (context) => ModalInsideModal(),
)),
),
),
ListTile(
title: Text('Avatar Modal'),
onTap: () => showAvatarModalBottomSheet(
... ... @@ -145,13 +154,15 @@ class _MyHomePageState extends State<MyHomePage> {
context: context,
backgroundColor: Colors.transparent,
builder: (context) => ModalInsideModal(),
)),
),
),
ListTile(
title: Text('Float Modal'),
onTap: () => showFloatingModalBottomSheet(
context: context,
builder: (context) => ModalFit(),
)),
),
),
ListTile(
title: Text('Cupertino Modal fit'),
onTap: () => showCupertinoModalBottomSheet(
... ... @@ -159,7 +170,8 @@ class _MyHomePageState extends State<MyHomePage> {
context: context,
backgroundColor: Colors.transparent,
builder: (context) => ModalFit(),
)),
),
),
section('COMPLEX CASES'),
ListTile(
title: Text('Cupertino Small Modal forced to expand'),
... ... @@ -175,9 +187,9 @@ class _MyHomePageState extends State<MyHomePage> {
expand: true,
context: context,
backgroundColor: Colors.transparent,
builder: (context) =>
ModalInsideModal(reverse: true),
)),
builder: (context) => ModalInsideModal(reverse: true),
),
),
ListTile(
title: Text('Cupertino Modal inside modal'),
onTap: () => showCupertinoModalBottomSheet(
... ... @@ -185,7 +197,8 @@ class _MyHomePageState extends State<MyHomePage> {
context: context,
backgroundColor: Colors.transparent,
builder: (context) => ModalInsideModal(),
)),
),
),
ListTile(
title: Text('Cupertino Modal with inside navigation'),
onTap: () => showCupertinoModalBottomSheet(
... ... @@ -202,7 +215,8 @@ class _MyHomePageState extends State<MyHomePage> {
context: context,
backgroundColor: Colors.transparent,
builder: (context) => ComplexModal(),
)),
),
),
ListTile(
title: Text('Modal with WillPopScope'),
onTap: () => showCupertinoModalBottomSheet(
... ... @@ -210,21 +224,24 @@ class _MyHomePageState extends State<MyHomePage> {
context: context,
backgroundColor: Colors.transparent,
builder: (context) => ModalWillScope(),
)),
),
),
ListTile(
title: Text('Modal with Nested Scroll'),
onTap: () => showCupertinoModalBottomSheet(
expand: true,
context: context,
builder: (context) => NestedScrollModal(),
)),
),
),
ListTile(
title: Text('Modal with PageView'),
onTap: () => showBarModalBottomSheet(
expand: true,
context: context,
builder: (context) => ModalWithPageView(),
)),
),
),
SizedBox(
height: 60,
)
... ... @@ -244,6 +261,7 @@ class _MyHomePageState extends State<MyHomePage> {
child: Text(
title,
style: Theme.of(context).textTheme.caption,
));
),
);
}
}
... ...
... ... @@ -2,20 +2,24 @@ import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
class AvatarBottomSheet extends StatelessWidget {
final Widget child;
final Animation<double> animation;
final SystemUiOverlayStyle? overlayStyle;
const AvatarBottomSheet({Key? key, required this.child, required this.animation})
const AvatarBottomSheet(
{Key? key,
required this.child,
required this.animation,
this.overlayStyle})
: super(key: key);
@override
Widget build(BuildContext context) {
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
value: overlayStyle ?? SystemUiOverlayStyle.light,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
... ... @@ -28,26 +32,29 @@ class AvatarBottomSheet extends StatelessWidget {
builder: (context, child) => Transform.translate(
offset: Offset(0, (1 - animation.value) * 100),
child: Opacity(
child: child,
opacity: max(0, animation.value * 2 - 1))),
child: child, opacity: max(0, animation.value * 2 - 1))),
child: Row(
children: <Widget>[
SizedBox(width: 20),
CircleAvatar(
child: Text('JB'),
child: Text(
'JB',
style: TextStyle(color: Colors.black),
),
radius: 32,
backgroundColor: Colors.blueAccent,
),
],
),
)),
),
),
SizedBox(height: 12),
Flexible(
flex: 1,
fit: FlexFit.loose,
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15),
topRight: Radius.circular(15)),
topLeft: Radius.circular(15), topRight: Radius.circular(15)),
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).scaffoldBackgroundColor,
... ... @@ -55,14 +62,18 @@ class AvatarBottomSheet extends StatelessWidget {
BoxShadow(
blurRadius: 10,
color: Colors.black12,
spreadRadius: 5)
]),
spreadRadius: 5,
),
],
),
width: double.infinity,
child: MediaQuery.removePadding(
context: context, removeTop: true, child: child)),
context: context, removeTop: true, child: child),
),
),
),
]),
],
),
);
}
}
... ... @@ -82,13 +93,8 @@ Future<T?> showAvatarModalBottomSheet<T>({
bool isDismissible = true,
bool enableDrag = true,
Duration? duration,
SystemUiOverlayStyle? overlayStyle,
}) async {
assert(context != null);
assert(builder != null);
assert(expand != null);
assert(useRootNavigator != null);
assert(isDismissible != null);
assert(enableDrag != null);
assert(debugCheckHasMediaQuery(context));
assert(debugCheckHasMaterialLocalizations(context));
final result = await Navigator.of(context, rootNavigator: useRootNavigator)
... ... @@ -97,6 +103,7 @@ Future<T?> showAvatarModalBottomSheet<T>({
containerBuilder: (_, animation, child) => AvatarBottomSheet(
child: child,
animation: animation,
overlayStyle: overlayStyle,
),
bounce: bounce,
secondAnimationController: secondAnimation,
... ...
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
class FloatingModal extends StatelessWidget {
... ...
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ModalFit extends StatelessWidget {
... ...
... ... @@ -2,8 +2,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class SimpleModal extends StatelessWidget {
const SimpleModal({Key? key}) : super(key: key);
@override
... ...
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
... ...
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:url_launcher/url_launcher_string.dart';
class WebFrame extends StatelessWidget {
final Widget child;
... ... @@ -134,14 +133,14 @@ class WebFrame extends StatelessWidget {
Row(
children: <Widget>[
InkWell(
onTap: () => launch(
onTap: () => launchUrlString(
'https://pub.dev/packages/modal_bottom_sheet'),
child: Image.asset('assets/flutter.png',
height: 60),
),
Spacer(),
InkWell(
onTap: () => launch(
onTap: () => launchUrlString(
'https://github.com/jamesblasco/modal_bottom_sheet'),
child: Image.asset('assets/github.png',
height: 60),
... ...
... ... @@ -3,4 +3,5 @@
**/Pods/
# Xcode-related
**/dgph
**/xcuserdata/
... ...
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
... ...
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
... ...
... ... @@ -9,74 +9,32 @@ project 'Runner', {
'Release' => :release,
}
def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end
pods_ary = []
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) { |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
pods_ary.push({:name => podname, :path => podpath});
else
puts "Invalid plugin specification: #{line}"
end
}
return pods_ary
end
def pubspec_supports_macos(file)
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return false;
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
File.foreach(file_abs_path) { |line|
return true if line =~ /^\s*macos:/
}
return false
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_macos_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
ephemeral_dir = File.join('Flutter', 'ephemeral')
symlink_dir = File.join(ephemeral_dir, '.symlinks')
symlink_plugins_dir = File.join(symlink_dir, 'plugins')
system("rm -rf #{symlink_dir}")
system("mkdir -p #{symlink_plugins_dir}")
# Flutter Pods
generated_xcconfig = parse_KV_file(File.join(ephemeral_dir, 'Flutter-Generated.xcconfig'))
if generated_xcconfig.empty?
puts "Flutter-Generated.xcconfig must exist. If you're running pod install manually, make sure flutter packages get is executed first."
end
generated_xcconfig.map { |p|
if p[:name] == 'FLUTTER_FRAMEWORK_DIR'
symlink = File.join(symlink_dir, 'flutter')
File.symlink(File.dirname(p[:path]), symlink)
pod 'FlutterMacOS', :path => File.join(symlink, File.basename(p[:path]))
end
}
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
end
# Plugin Pods
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.map { |p|
symlink = File.join(symlink_plugins_dir, p[:name])
File.symlink(p[:path], symlink)
if pubspec_supports_macos(File.join(symlink, 'pubspec.yaml'))
pod p[:name], :path => File.join(symlink, 'macos')
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
}
end
# Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system.
install! 'cocoapods', :disable_input_output_paths => true
... ...
PODS:
- FlutterMacOS (1.0.0)
- url_launcher (0.0.1)
- url_launcher_macos (0.0.1):
- FlutterMacOS
DEPENDENCIES:
- FlutterMacOS (from `Flutter/ephemeral/.symlinks/flutter/darwin-x64`)
- url_launcher (from `Flutter/ephemeral/.symlinks/plugins/url_launcher/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
EXTERNAL SOURCES:
FlutterMacOS:
:path: Flutter/ephemeral/.symlinks/flutter/darwin-x64
url_launcher:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher/macos
:path: Flutter/ephemeral
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
SPEC CHECKSUMS:
FlutterMacOS: 15bea8a44d2fa024068daa0140371c020b4b6ff9
url_launcher: af78307ef9bafff91273b34f1c6c0c86a0004fd7
url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4
FlutterMacOS: 57701585bf7de1b3fc2bb61f6378d73bbdea8424
url_launcher_macos: 597e05b8e514239626bcf4a850fcf9ef5c856ec3
PODFILE CHECKSUM: d8ba9b3e9e93c62c74a660b46c6fcb09f03991a7
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
COCOAPODS: 1.8.4
COCOAPODS: 1.11.3
... ...
... ... @@ -21,16 +21,12 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
07F1EEFF1D7280028D8E0815 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6785DE70E6CF5A12A3672D00 /* Pods_Runner.framework */; };
1970F9138D50BB4FA70EFAB1 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C342A6A03A2212612EE55C57 /* Pods_Runner.framework */; };
335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; };
33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; };
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; };
33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
D73912F022F37F9E000D13A0 /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; };
D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
... ... @@ -50,8 +46,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */,
33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */,
);
name = "Bundle Framework";
runOnlyForDeploymentPostprocessing = 0;
... ... @@ -59,8 +53,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
123E850BF31901C0A1B9EDF9 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
12CD678DD42B59A87A0100ED /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
21A9B680A8F580B6657C3224 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; };
... ... @@ -72,15 +65,14 @@
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = "<group>"; };
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = "<group>"; };
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = "<group>"; };
33D1A10322148B71006C7A3E /* FlutterMacOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FlutterMacOS.framework; path = Flutter/ephemeral/FlutterMacOS.framework; sourceTree = SOURCE_ROOT; };
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
6785DE70E6CF5A12A3672D00 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
52EF924579156A50BB44ED07 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
6D64897DFD0D50397DFFAB46 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
956A1C59D4E7DF8845616D84 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
D73912EF22F37F9E000D13A0 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/ephemeral/App.framework; sourceTree = SOURCE_ROOT; };
C342A6A03A2212612EE55C57 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
... ... @@ -88,9 +80,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D73912F022F37F9E000D13A0 /* App.framework in Frameworks */,
33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */,
07F1EEFF1D7280028D8E0815 /* Pods_Runner.framework in Frameworks */,
1970F9138D50BB4FA70EFAB1 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
... ... @@ -115,7 +105,7 @@
33CEB47122A05771004F2AC0 /* Flutter */,
33CC10EE2044A3C60003C045 /* Products */,
D73912EC22F37F3D000D13A0 /* Frameworks */,
A1F7D023EEA811516CAA2CF1 /* Pods */,
C8485E5DEEEF4104132F0555 /* Pods */,
);
sourceTree = "<group>";
};
... ... @@ -145,8 +135,6 @@
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
D73912EF22F37F9E000D13A0 /* App.framework */,
33D1A10322148B71006C7A3E /* FlutterMacOS.framework */,
);
path = Flutter;
sourceTree = "<group>";
... ... @@ -164,12 +152,12 @@
path = Runner;
sourceTree = "<group>";
};
A1F7D023EEA811516CAA2CF1 /* Pods */ = {
C8485E5DEEEF4104132F0555 /* Pods */ = {
isa = PBXGroup;
children = (
12CD678DD42B59A87A0100ED /* Pods-Runner.debug.xcconfig */,
123E850BF31901C0A1B9EDF9 /* Pods-Runner.release.xcconfig */,
956A1C59D4E7DF8845616D84 /* Pods-Runner.profile.xcconfig */,
21A9B680A8F580B6657C3224 /* Pods-Runner.debug.xcconfig */,
52EF924579156A50BB44ED07 /* Pods-Runner.release.xcconfig */,
6D64897DFD0D50397DFFAB46 /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
... ... @@ -178,7 +166,7 @@
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
isa = PBXGroup;
children = (
6785DE70E6CF5A12A3672D00 /* Pods_Runner.framework */,
C342A6A03A2212612EE55C57 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
... ... @@ -190,13 +178,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
39807FAAEE6C2A7DC7608117 /* [CP] Check Pods Manifest.lock */,
127622FF3DE570FE561F179A /* [CP] Check Pods Manifest.lock */,
33CC10E92044A3C60003C045 /* Sources */,
33CC10EA2044A3C60003C045 /* Frameworks */,
33CC10EB2044A3C60003C045 /* Resources */,
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
A477A0AC3B4E8DBC8C9DA73C /* [CP] Embed Pods Frameworks */,
C0A6425075547B9067F49078 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
... ... @@ -215,7 +203,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
... ... @@ -266,7 +254,7 @@
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
3399D490228B24CF009A79C7 /* ShellScript */ = {
127622FF3DE570FE561F179A /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
... ... @@ -274,66 +262,68 @@
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
33CC111E2044C6BF0003C045 /* ShellScript */ = {
3399D490228B24CF009A79C7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
Flutter/ephemeral/FlutterInputs.xcfilelist,
);
inputPaths = (
Flutter/ephemeral/tripwire,
);
outputFileListPaths = (
Flutter/ephemeral/FlutterOutputs.xcfilelist,
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n";
};
39807FAAEE6C2A7DC7608117 /* [CP] Check Pods Manifest.lock */ = {
33CC111E2044C6BF0003C045 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
Flutter/ephemeral/FlutterInputs.xcfilelist,
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
Flutter/ephemeral/tripwire,
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
Flutter/ephemeral/FlutterOutputs.xcfilelist,
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire";
};
A477A0AC3B4E8DBC8C9DA73C /* [CP] Embed Pods Frameworks */ = {
C0A6425075547B9067F49078 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
... ... @@ -431,10 +421,6 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter/ephemeral",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
... ... @@ -561,10 +547,6 @@
CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter/ephemeral",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
... ... @@ -585,10 +567,6 @@
CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter/ephemeral",
);
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
... ...
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
... ... @@ -36,8 +36,8 @@
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
... ... @@ -59,8 +59,6 @@
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
... ...
... ... @@ -323,6 +323,10 @@
</items>
</menu>
</menuItem>
<menuItem title="Help" id="EPT-qC-fAb">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="rJ0-wn-3NY"/>
</menuItem>
</items>
<point key="canvasLocation" x="142" y="-258"/>
</menu>
... ...
... ... @@ -11,4 +11,4 @@ PRODUCT_NAME = example
PRODUCT_BUNDLE_IDENTIFIER = com.example.example
// The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2021 com.example. All rights reserved.
PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved.
... ...
... ... @@ -7,56 +7,56 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.3"
version: "2.8.2"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.5"
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.3.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.5"
version: "1.16.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "1.0.5"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
... ... @@ -67,41 +67,60 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.4"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety.3"
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.6"
version: "1.7.0"
modal_bottom_sheet:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "2.0.0-nullsafety.1"
version: "2.1.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.3"
version: "1.8.1"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.1"
version: "2.1.2"
sky_engine:
dependency: transitive
description: flutter
... ... @@ -113,91 +132,105 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.4"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.6"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety.6"
typed_data:
version: "0.4.9"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.5"
url_launcher_android:
dependency: transitive
description:
name: typed_data
name: url_launcher_android
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.5"
url_launcher:
dependency: "direct main"
version: "6.0.17"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher
name: url_launcher_ios
url: "https://pub.dartlang.org"
source: hosted
version: "6.0.0-nullsafety.1"
version: "6.0.17"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0-nullsafety.1"
version: "3.0.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0-nullsafety.1"
version: "3.0.1"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0-nullsafety.1"
version: "2.1.0"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0-nullsafety.1"
version: "3.0.1"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.5"
version: "2.1.2"
sdks:
dart: ">=2.12.0-29.10.beta <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0"
dart: ">=2.17.0 <3.0.0"
flutter: ">=3.0.0"
... ...
... ... @@ -14,19 +14,17 @@ publish_to: none
version: 1.0.0+1
environment:
sdk: ">=2.12.0-29.10.beta <3.0.0"
flutter: ">=3.0.0"
sdk: '>=2.17.0 <3.0.0'
dependencies:
cupertino_icons: ^1.0.5
flutter:
sdk: flutter
url_launcher: 6.0.0-nullsafety.1
modal_bottom_sheet:
path: '../'
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
url_launcher: ^6.1.5
dev_dependencies:
flutter_test:
... ...
... ... @@ -3,12 +3,8 @@
// found in the LICENSE file.
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/widgets.dart';
import 'package:modal_bottom_sheet/src/utils/scroll_to_top_status_bar.dart';
import 'package:modal_bottom_sheet/src/utils/bottom_sheet_suspended_curve.dart';
... ... @@ -49,10 +45,7 @@ class ModalBottomSheet extends StatefulWidget {
required this.expanded,
required this.onClosing,
required this.child,
}) : assert(enableDrag != null),
assert(onClosing != null),
assert(child != null),
super(key: key);
}) : super(key: key);
/// The closeProgressThreshold parameter
/// specifies when the bottom sheet will be dismissed when user drags it.
... ... @@ -108,7 +101,7 @@ class ModalBottomSheet extends StatefulWidget {
final ScrollController scrollController;
@override
_ModalBottomSheetState createState() => _ModalBottomSheetState();
ModalBottomSheetState createState() => ModalBottomSheetState();
/// Creates an [AnimationController] suitable for a
/// [ModalBottomSheet.animationController].
... ... @@ -128,7 +121,7 @@ class ModalBottomSheet extends StatefulWidget {
}
}
class _ModalBottomSheetState extends State<ModalBottomSheet>
class ModalBottomSheetState extends State<ModalBottomSheet>
with TickerProviderStateMixin {
final GlobalKey _childKey = GlobalKey(debugLabel: 'BottomSheet child');
... ... @@ -231,24 +224,27 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
// ignore: unawaited_futures
_bounceDragController.reverse();
var canClose = true;
if (widget.shouldClose != null && hasReachedWillPopThreshold) {
Future<void> tryClose() async {
if (widget.shouldClose != null) {
_cancelClose();
canClose = await shouldClose();
}
bool canClose = await shouldClose();
if (canClose) {
_close();
}
} else {
_close();
}
}
// If speed is bigger than _minFlingVelocity try to close it
if (velocity > _minFlingVelocity) {
_close();
tryClose();
} else if (hasReachedCloseThreshold) {
if (widget.animationController.value > 0.0) {
// ignore: unawaited_futures
widget.animationController.fling(velocity: -1.0);
}
_close();
} else {
_cancelClose();
}
tryClose();
} else {
_cancelClose();
}
... ... @@ -302,9 +298,8 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
// Otherwise the calculate the velocity with a VelocityTracker
if (_velocityTracker == null) {
//final pointerKind = defaultPointerDeviceKind(context);
// ignore: deprecated_member_use
_velocityTracker = VelocityTracker();
final pointerKind = defaultPointerDeviceKind(context);
_velocityTracker = VelocityTracker.withKind(pointerKind);
_startTime = DateTime.now();
}
... ... @@ -493,5 +488,4 @@ PointerDeviceKind defaultPointerDeviceKind(BuildContext context) {
case TargetPlatform.fuchsia:
return PointerDeviceKind.unknown;
}
return PointerDeviceKind.unknown;
}
... ...
import 'dart:async';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:modal_bottom_sheet/src/utils/modal_scroll_controller.dart';
import '../modal_bottom_sheet.dart';
... ... @@ -19,9 +16,7 @@ class _ModalBottomSheet<T> extends StatefulWidget {
this.expanded = false,
this.enableDrag = true,
this.animationCurve,
}) : assert(expanded != null),
assert(enableDrag != null),
super(key: key);
}) : super(key: key);
final double? closeProgressThreshold;
final ModalBottomSheetRoute<T> route;
... ... @@ -127,7 +122,7 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> {
}
}
class ModalBottomSheetRoute<T> extends PopupRoute<T> {
class ModalBottomSheetRoute<T> extends PageRoute<T> {
ModalBottomSheetRoute({
this.closeProgressThreshold,
this.containerBuilder,
... ... @@ -143,10 +138,7 @@ class ModalBottomSheetRoute<T> extends PopupRoute<T> {
this.animationCurve,
this.duration,
RouteSettings? settings,
}) : assert(expanded != null),
assert(isDismissible != null),
assert(enableDrag != null),
super(settings: settings);
}) : super(settings: settings);
final double? closeProgressThreshold;
final WidgetWithChildBuilder? containerBuilder;
... ... @@ -170,6 +162,12 @@ class ModalBottomSheetRoute<T> extends PopupRoute<T> {
bool get barrierDismissible => isDismissible;
@override
bool get maintainState => true; // keep in memory when not active (#252)
@override
bool get opaque => false; //transparency
@override
final String? barrierLabel;
@override
... ... @@ -245,14 +243,8 @@ Future<T?> showCustomModalBottomSheet<T>({
bool isDismissible = true,
bool enableDrag = true,
Duration? duration,
RouteSettings? settings,
}) async {
assert(context != null);
assert(builder != null);
assert(containerWidget != null);
assert(expand != null);
assert(useRootNavigator != null);
assert(isDismissible != null);
assert(enableDrag != null);
assert(debugCheckHasMediaQuery(context));
assert(debugCheckHasMaterialLocalizations(context));
final hasMaterialLocalizations =
... ... @@ -275,6 +267,7 @@ Future<T?> showCustomModalBottomSheet<T>({
enableDrag: enableDrag,
animationCurve: animationCurve,
duration: duration,
settings: settings,
));
return result;
}
... ...
... ... @@ -6,14 +6,16 @@ import 'package:flutter/services.dart';
import '../../modal_bottom_sheet.dart';
import '../bottom_sheet_route.dart';
const Radius _default_bar_top_radius = Radius.circular(15);
const Radius kDefaultBarTopRadius = Radius.circular(15);
class BarBottomSheet extends StatelessWidget {
final Widget child;
final Widget? control;
final Clip? clipBehavior;
final Color? backgroundColor;
final double? elevation;
final ShapeBorder? shape;
final SystemUiOverlayStyle? overlayStyle;
const BarBottomSheet({
Key? key,
... ... @@ -21,13 +23,15 @@ class BarBottomSheet extends StatelessWidget {
this.control,
this.clipBehavior,
this.shape,
this.backgroundColor,
this.elevation,
this.overlayStyle,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
value: overlayStyle ?? SystemUiOverlayStyle.light,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
... ... @@ -53,10 +57,11 @@ class BarBottomSheet extends StatelessWidget {
RoundedRectangleBorder(
side: BorderSide(),
borderRadius: BorderRadius.only(
topLeft: _default_bar_top_radius,
topRight: _default_bar_top_radius),
topLeft: kDefaultBarTopRadius,
topRight: kDefaultBarTopRadius),
),
clipBehavior: clipBehavior ?? Clip.hardEdge,
color: backgroundColor ?? Colors.white,
elevation: elevation ?? 2,
child: SizedBox(
width: double.infinity,
... ... @@ -88,13 +93,9 @@ Future<T?> showBarModalBottomSheet<T>({
bool enableDrag = true,
Widget? topControl,
Duration? duration,
RouteSettings? settings,
SystemUiOverlayStyle? overlayStyle,
}) async {
assert(context != null);
assert(builder != null);
assert(expand != null);
assert(useRootNavigator != null);
assert(isDismissible != null);
assert(enableDrag != null);
assert(debugCheckHasMediaQuery(context));
assert(debugCheckHasMaterialLocalizations(context));
final result = await Navigator.of(context, rootNavigator: useRootNavigator)
... ... @@ -107,7 +108,9 @@ Future<T?> showBarModalBottomSheet<T>({
control: topControl,
clipBehavior: clipBehavior,
shape: shape,
backgroundColor: backgroundColor,
elevation: elevation,
overlayStyle: overlayStyle,
),
secondAnimationController: secondAnimation,
expanded: expand,
... ... @@ -117,6 +120,7 @@ Future<T?> showBarModalBottomSheet<T>({
enableDrag: enableDrag,
animationCurve: animationCurve,
duration: duration,
settings: settings,
));
return result;
}
... ...
... ... @@ -5,8 +5,6 @@
import 'dart:async';
import 'package:flutter/cupertino.dart' show CupertinoTheme, CupertinoApp;
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'
show
Colors,
... ... @@ -17,12 +15,12 @@ import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import '../../modal_bottom_sheet.dart';
import '../bottom_sheet_route.dart';
const double _kPreviousPageVisibleOffset = 10;
const Radius _kDefaultTopRadius = Radius.circular(12);
const BoxShadow _kDefaultBoxShadow = BoxShadow(blurRadius: 10, color: Colors.black12, spreadRadius: 5);
const BoxShadow _kDefaultBoxShadow =
BoxShadow(blurRadius: 10, color: Colors.black12, spreadRadius: 5);
/// Cupertino Bottom Sheet Container
///
... ... @@ -43,23 +41,22 @@ class _CupertinoBottomSheetContainer extends StatelessWidget {
this.shadow,
}) : super(key: key);
@override
Widget build(BuildContext context) {
final topSafeAreaPadding = MediaQuery.of(context).padding.top;
final topPadding = _kPreviousPageVisibleOffset + topSafeAreaPadding;
final _shadow = shadow ?? _kDefaultBoxShadow;
final shadow = this.shadow ?? _kDefaultBoxShadow;
BoxShadow(blurRadius: 10, color: Colors.black12, spreadRadius: 5);
final _backgroundColor =
backgroundColor ?? CupertinoTheme.of(context).scaffoldBackgroundColor;
final backgroundColor = this.backgroundColor ??
CupertinoTheme.of(context).scaffoldBackgroundColor;
return Padding(
padding: EdgeInsets.only(top: topPadding),
child: ClipRRect(
borderRadius: BorderRadius.vertical(top: topRadius),
child: Container(
decoration:
BoxDecoration(color: _backgroundColor, boxShadow: [_shadow]),
BoxDecoration(color: backgroundColor, boxShadow: [shadow]),
width: double.infinity,
child: MediaQuery.removePadding(
context: context,
... ... @@ -94,12 +91,8 @@ Future<T?> showCupertinoModalBottomSheet<T>({
RouteSettings? settings,
Color? transitionBackgroundColor,
BoxShadow? shadow,
SystemUiOverlayStyle? overlayStyle,
}) async {
assert(context != null);
assert(builder != null);
assert(expand != null);
assert(useRootNavigator != null);
assert(enableDrag != null);
assert(debugCheckHasMediaQuery(context));
final hasMaterialLocalizations =
Localizations.of<MaterialLocalizations>(context, MaterialLocalizations) !=
... ... @@ -134,7 +127,8 @@ Future<T?> showCupertinoModalBottomSheet<T>({
previousRouteAnimationCurve: previousRouteAnimationCurve,
duration: duration,
settings: settings,
transitionBackgroundColor: transitionBackgroundColor ?? Colors.black),
transitionBackgroundColor: transitionBackgroundColor ?? Colors.black,
overlayStyle: overlayStyle),
);
return result;
}
... ... @@ -144,12 +138,12 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> {
final Curve? previousRouteAnimationCurve;
final BoxShadow? boxShadow;
// Background color behind all routes
// Black by default
final Color? transitionBackgroundColor;
final SystemUiOverlayStyle? overlayStyle;
CupertinoModalBottomSheetRoute({
required WidgetBuilder builder,
... ... @@ -173,10 +167,8 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> {
this.transitionBackgroundColor,
this.topRadius = _kDefaultTopRadius,
this.previousRouteAnimationCurve,
}) : assert(expanded != null),
assert(isDismissible != null),
assert(enableDrag != null),
super(
this.overlayStyle,
}) : super(
closeProgressThreshold: closeProgressThreshold,
scrollController: scrollController,
containerBuilder: containerBuilder,
... ... @@ -201,8 +193,7 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> {
Widget child,
) {
final paddingTop = MediaQuery.of(context).padding.top;
final distanceWithScale =
(paddingTop + _kPreviousPageVisibleOffset) * 0.9;
final distanceWithScale = (paddingTop + _kPreviousPageVisibleOffset) * 0.9;
final offsetY = secondaryAnimation.value * (paddingTop - distanceWithScale);
final scale = 1 - secondaryAnimation.value / 10;
return AnimatedBuilder(
... ... @@ -220,14 +211,15 @@ class CupertinoModalBottomSheetRoute<T> extends ModalBottomSheetRoute<T> {
}
@override
Widget getPreviousRouteTransition(BuildContext context,
Animation<double> secondaryAnimation, Widget child) {
Widget getPreviousRouteTransition(
BuildContext context, Animation<double> secondAnimation, Widget child) {
return _CupertinoModalTransition(
secondaryAnimation: secondaryAnimation,
secondaryAnimation: secondAnimation,
body: child,
animationCurve: previousRouteAnimationCurve,
topRadius: topRadius,
backgroundColor: transitionBackgroundColor ?? Colors.black,
overlayStyle: overlayStyle,
);
}
}
... ... @@ -237,7 +229,7 @@ class _CupertinoModalTransition extends StatelessWidget {
final Radius topRadius;
final Curve? animationCurve;
final Color backgroundColor;
final BoxShadow? boxShadow;
final SystemUiOverlayStyle? overlayStyle;
final Widget body;
... ... @@ -248,7 +240,7 @@ class _CupertinoModalTransition extends StatelessWidget {
required this.topRadius,
this.backgroundColor = Colors.black,
this.animationCurve,
this.boxShadow,
this.overlayStyle,
}) : super(key: key);
@override
... ... @@ -266,7 +258,7 @@ class _CupertinoModalTransition extends StatelessWidget {
);
return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
value: overlayStyle ?? SystemUiOverlayStyle.light,
child: AnimatedBuilder(
animation: curvedAnimation,
child: body,
... ... @@ -298,20 +290,16 @@ class _CupertinoModalTransition extends StatelessWidget {
}
}
class _CupertinoScaffold extends InheritedWidget {
class CupertinoScaffoldInheirted extends InheritedWidget {
final AnimationController? animation;
final Radius? topRadius;
@override
final Widget child;
const _CupertinoScaffold({
Key? key,
const CupertinoScaffoldInheirted({
this.animation,
required this.child,
required super.child,
this.topRadius,
}) : super(key: key, child: child);
}) : super();
@override
bool updateShouldNotify(InheritedWidget oldWidget) {
... ... @@ -321,18 +309,20 @@ class _CupertinoScaffold extends InheritedWidget {
// Support
class CupertinoScaffold extends StatefulWidget {
static _CupertinoScaffold? of(BuildContext context) =>
context.dependOnInheritedWidgetOfExactType<_CupertinoScaffold>();
static CupertinoScaffoldInheirted? of(BuildContext context) =>
context.dependOnInheritedWidgetOfExactType<CupertinoScaffoldInheirted>();
final Widget body;
final Radius topRadius;
final Color transitionBackgroundColor;
final SystemUiOverlayStyle? overlayStyle;
const CupertinoScaffold({
Key? key,
required this.body,
this.topRadius = _kDefaultTopRadius,
this.transitionBackgroundColor = Colors.black,
this.overlayStyle,
}) : super(key: key);
@override
... ... @@ -354,12 +344,8 @@ class CupertinoScaffold extends StatefulWidget {
Duration? duration,
RouteSettings? settings,
BoxShadow? shadow,
SystemUiOverlayStyle? overlayStyle,
}) async {
assert(context != null);
assert(builder != null);
assert(expand != null);
assert(useRootNavigator != null);
assert(enableDrag != null);
assert(debugCheckHasMediaQuery(context));
final isCupertinoApp =
context.findAncestorWidgetOfExactType<CupertinoApp>() != null;
... ... @@ -391,6 +377,7 @@ class CupertinoScaffold extends StatefulWidget {
previousRouteAnimationCurve: previousRouteAnimationCurve,
duration: duration,
settings: settings,
overlayStyle: overlayStyle,
));
return result;
}
... ... @@ -400,8 +387,6 @@ class _CupertinoScaffoldState extends State<CupertinoScaffold>
with TickerProviderStateMixin {
late AnimationController animationController;
SystemUiOverlayStyle? lastStyle;
@override
void initState() {
animationController =
... ... @@ -416,7 +401,7 @@ class _CupertinoScaffoldState extends State<CupertinoScaffold>
@override
Widget build(BuildContext context) {
return _CupertinoScaffold(
return CupertinoScaffoldInheirted(
animation: animationController,
topRadius: widget.topRadius,
child: _CupertinoModalTransition(
... ... @@ -424,6 +409,7 @@ class _CupertinoScaffoldState extends State<CupertinoScaffold>
body: widget.body,
topRadius: widget.topRadius,
backgroundColor: widget.transitionBackgroundColor,
overlayStyle: widget.overlayStyle,
),
);
}
... ...
... ... @@ -20,13 +20,8 @@ Future<T?> showMaterialModalBottomSheet<T>({
bool isDismissible = true,
bool enableDrag = true,
Duration? duration,
RouteSettings? settings,
}) async {
assert(context != null);
assert(builder != null);
assert(expand != null);
assert(useRootNavigator != null);
assert(isDismissible != null);
assert(enableDrag != null);
assert(debugCheckHasMediaQuery(context));
assert(debugCheckHasMaterialLocalizations(context));
final result = await Navigator.of(context, rootNavigator: useRootNavigator)
... ... @@ -50,6 +45,7 @@ Future<T?> showMaterialModalBottomSheet<T>({
enableDrag: enableDrag,
animationCurve: animationCurve,
duration: duration,
settings: settings,
));
return result;
}
... ... @@ -65,17 +61,18 @@ WidgetWithChildBuilder _materialContainerBuilder(BuildContext context,
final color = backgroundColor ??
bottomSheetTheme.modalBackgroundColor ??
bottomSheetTheme.backgroundColor;
final _elevation = elevation ?? bottomSheetTheme.elevation ?? 0.0;
final _shape = shape ?? bottomSheetTheme.shape;
final _clipBehavior =
final effectiveElevation = elevation ?? bottomSheetTheme.elevation ?? 0.0;
final effectiveShape = shape ?? bottomSheetTheme.shape;
final effectiveClipBehavior =
clipBehavior ?? bottomSheetTheme.clipBehavior ?? Clip.none;
final result = (context, animation, child) => Material(
Widget result(context, animation, child) => Material(
color: color,
elevation: _elevation,
shape: _shape,
clipBehavior: _clipBehavior,
child: child);
elevation: effectiveElevation,
shape: effectiveShape,
clipBehavior: effectiveClipBehavior,
child: child,
);
if (theme != null) {
return (context, animation, child) =>
Theme(data: theme, child: result(context, animation, child));
... ...
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import '../modal_bottom_sheet.dart';
... ... @@ -15,10 +14,7 @@ class MaterialWithModalsPageRoute<T> extends MaterialPageRoute<T> {
RouteSettings? settings,
bool maintainState = true,
bool fullscreenDialog = false,
}) : assert(builder != null),
assert(maintainState != null),
assert(fullscreenDialog != null),
super(
}) : super(
settings: settings,
fullscreenDialog: fullscreenDialog,
builder: builder,
... ...
... ... @@ -30,8 +30,7 @@ class BottomSheetSuspendedCurve extends Curve {
const BottomSheetSuspendedCurve(
this.startingPoint, {
this.curve = Curves.easeOutCubic,
}) : assert(startingPoint != null),
assert(curve != null);
});
/// The progress value at which [curve] should begin.
///
... ...
... ... @@ -16,8 +16,7 @@ class ModalScrollController extends InheritedWidget {
Key? key,
required this.controller,
required Widget child,
}) : assert(controller != null),
super(
}) : super(
key: key,
child: PrimaryScrollController(
controller: controller,
... ...
... ... @@ -15,10 +15,10 @@ class ScrollToTopStatusBarHandler extends StatefulWidget {
}) : super(key: key);
@override
_ScrollToTopStatusBarState createState() => _ScrollToTopStatusBarState();
ScrollToTopStatusBarState createState() => ScrollToTopStatusBarState();
}
class _ScrollToTopStatusBarState extends State<ScrollToTopStatusBarHandler> {
class ScrollToTopStatusBarState extends State<ScrollToTopStatusBarHandler> {
@override
void initState() {
super.initState();
... ... @@ -50,7 +50,7 @@ class _ScrollToTopStatusBarState extends State<ScrollToTopStatusBarHandler> {
void _handleStatusBarTap(BuildContext context) {
final controller = widget.scrollController;
if (controller != null && controller.hasClients) {
if (controller.hasClients) {
controller.animateTo(
0.0,
duration: const Duration(milliseconds: 300),
... ...
... ... @@ -7,49 +7,49 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0-nullsafety.3"
version: "2.8.2"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.5"
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.3.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0-nullsafety.5"
version: "1.16.0"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.3.0"
flutter:
dependency: "direct main"
description: flutter
... ... @@ -60,34 +60,41 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
lints:
dependency: "direct dev"
description:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10-nullsafety.3"
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.6"
version: "1.7.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.3"
pedantic:
dependency: "direct dev"
description:
name: pedantic
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.3"
version: "1.8.1"
sky_engine:
dependency: transitive
description: flutter
... ... @@ -99,56 +106,49 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0-nullsafety.4"
version: "1.8.2"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0-nullsafety.6"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.3"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0-nullsafety.3"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.3"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19-nullsafety.6"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0-nullsafety.5"
version: "0.4.9"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0-nullsafety.5"
version: "2.1.2"
sdks:
dart: ">=2.12.0-29.10.beta <3.0.0"
flutter: ">=1.12.0 <2.0.0"
dart: ">=2.17.0 <3.0.0"
flutter: ">=3.0.0"
... ...
name: modal_bottom_sheet
description: 'Create awesome and powerful modal bottom sheets. Material, Cupertino iOS 13 or create your own style'
version: 2.0.0-nullsafety.1
version: 2.1.0
homepage: 'https://github.com/jamesblasco/modal_bottom_sheet'
environment:
sdk: ">=2.12.0-29.10.beta <3.0.0"
flutter: ">=1.12.0 <2.0.0"
sdk: ">=2.17.0 <3.0.0"
flutter: ">=3.0.0"
dependencies:
flutter:
... ... @@ -14,41 +14,4 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
pedantic: 1.10.0-nullsafety.3
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
# To add assets to your package, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
#
# For details regarding assets in packages, see
# https://flutter.dev/assets-and-images/#from-packages
#
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# To add custom fonts to your package, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts in packages, see
# https://flutter.dev/custom-fonts/#from-packages
lints: ^2.0.0
... ...
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
void main() {
test('adds one to input values', () {});
group(
'Route.mainState are well-controlled by `mainState`',
() {
Future<void> testInitStateAndDispose(
WidgetTester tester,
Future<void> Function(BuildContext context, WidgetBuilder builder)
onPressed,
) async {
int initState = 0, dispose = 0;
await _pumpWidget(
tester: tester,
onPressed: (context) => onPressed(
context,
(_) => _TestWidget(
onInitState: () => initState++,
onDispose: () => dispose++,
),
),
);
expect(initState, 0);
await tester.tap(_textButtonWithText('Press me'));
await tester.pumpAndSettle();
expect(initState, 1);
expect(dispose, 0);
await tester.tap(_textButtonWithText('TestWidget push'));
await tester.pumpAndSettle();
expect(initState, 1);
expect(dispose, 0);
await tester.tap(_textButtonWithText('TestWidget pushed pop'));
await tester.pumpAndSettle();
expect(initState, 1);
expect(dispose, 0);
await tester.tap(_textButtonWithText('TestWidget pop'));
await tester.pumpAndSettle();
expect(initState, 1);
expect(dispose, 1);
}
testWidgets('with showCupertinoModalBottomSheet', (tester) {
return testInitStateAndDispose(
tester,
(context, builder) => showCupertinoModalBottomSheet(
context: context,
builder: builder,
),
);
});
testWidgets('with showMaterialModalBottomSheet', (tester) {
return testInitStateAndDispose(
tester,
(context, builder) => showMaterialModalBottomSheet(
context: context,
builder: builder,
),
);
});
},
);
}
Future<void> _pumpWidget({
required WidgetTester tester,
required void Function(BuildContext context) onPressed,
}) {
return tester.pumpWidget(
MaterialApp(
home: Builder(
builder: (context) => Scaffold(
body: Center(
child: TextButton(
onPressed: () => onPressed(context),
child: Text('Press me'),
),
),
),
),
),
);
}
Finder _textButtonWithText(String text) {
return find.widgetWithText(TextButton, text);
}
class _TestWidget extends StatefulWidget {
const _TestWidget({
Key? key,
this.onInitState,
this.onDispose,
}) : super(key: key);
final VoidCallback? onInitState;
final VoidCallback? onDispose;
@override
State<_TestWidget> createState() => _TestWidgetState();
}
class _TestWidgetState extends State<_TestWidget> {
@override
void initState() {
super.initState();
widget.onInitState?.call();
}
@override
void dispose() {
widget.onDispose?.call();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
onPressed: () => Navigator.of(context).push(
defaultPageRoute(
targetPlatform: Theme.of(context).platform,
builder: (context) => Scaffold(
body: Center(
child: TextButton(
onPressed: () => Navigator.of(context).pop(),
child: Text('TestWidget pushed pop'),
),
),
),
),
),
child: Text('TestWidget push'),
),
TextButton(
onPressed: () => Navigator.of(context).pop(),
child: Text('TestWidget pop'),
),
],
),
);
}
}
PageRoute<T> defaultPageRoute<T>({
required TargetPlatform targetPlatform,
required WidgetBuilder builder,
RouteSettings? settings,
bool maintainState = true,
bool fullscreenDialog = false,
}) {
switch (targetPlatform) {
case TargetPlatform.iOS:
case TargetPlatform.macOS:
return CupertinoPageRoute<T>(
builder: builder,
settings: settings,
maintainState: maintainState,
fullscreenDialog: fullscreenDialog,
);
default:
return MaterialPageRoute<T>(
builder: builder,
settings: settings,
maintainState: maintainState,
fullscreenDialog: fullscreenDialog,
);
}
}
... ...