Jaime Blasco

Format and fix analyzer hints

... ... @@ -53,8 +53,7 @@ class CupertinoSharePage extends StatelessWidget {
expand: true,
context: context,
backgroundColor: Colors.transparent,
builder: (context) =>
PhotoShareBottomSheet(),
builder: (context) => PhotoShareBottomSheet(),
);
},
),
... ... @@ -73,10 +72,7 @@ class CupertinoSharePage extends StatelessWidget {
}
class PhotoShareBottomSheet extends StatelessWidget {
const PhotoShareBottomSheet({Key key})
: super(key: key);
const PhotoShareBottomSheet({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
... ... @@ -92,7 +88,7 @@ class PhotoShareBottomSheet extends StatelessWidget {
appBar: appBar(context),
body: CustomScrollView(
physics: ClampingScrollPhysics(),
controller: ModalScrollController.of(context),
controller: ModalScrollController.of(context),
slivers: <Widget>[
SliverSafeArea(
bottom: false,
... ...
... ... @@ -95,7 +95,6 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
print(MediaQuery.of(context).size.height);
return Material(
child: Scaffold(
body: CupertinoPageScaffold(
... ... @@ -202,8 +201,7 @@ class _MyHomePageState extends State<MyHomePage> {
expand: true,
context: context,
backgroundColor: Colors.transparent,
builder: (context) =>
ComplexModal(),
builder: (context) => ComplexModal(),
)),
ListTile(
title: Text('Modal with WillPopScope'),
... ... @@ -211,26 +209,22 @@ class _MyHomePageState extends State<MyHomePage> {
expand: true,
context: context,
backgroundColor: Colors.transparent,
builder: (context) =>
ModalWillScope(),
builder: (context) => ModalWillScope(),
)),
ListTile(
title: Text('Modal with Nested Scroll'),
onTap: () => showCupertinoModalBottomSheet(
expand: true,
context: context,
builder: (context) =>
NestedScrollModal(),
builder: (context) => NestedScrollModal(),
)),
ListTile(
title: Text('Modal with PageView'),
onTap: () => showBarModalBottomSheet(
expand: true,
context: context,
builder: (context, scrollController) =>
ModalWithPageView(
scrollController: scrollController),
)),
expand: true,
context: context,
builder: (context) => ModalWithPageView(),
)),
SizedBox(
height: 60,
)
... ...
... ... @@ -32,7 +32,6 @@ class ComplexModal extends StatelessWidget {
),
],
));
print('hello');
return shouldClose;
},
child: Navigator(
... ...
... ... @@ -2,8 +2,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ModalFit extends StatelessWidget {
const ModalFit({Key key}) : super(key: key);
@override
... ...
... ... @@ -2,8 +2,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class ModalWillScope extends StatelessWidget {
const ModalWillScope({Key key}) : super(key: key);
@override
... ... @@ -33,7 +31,6 @@ class ModalWillScope extends StatelessWidget {
),
],
));
print('hello');
return shouldClose;
},
child: CupertinoPageScaffold(
... ...
... ... @@ -3,13 +3,10 @@ import 'package:flutter/material.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
class ModalWithNavigator extends StatelessWidget {
const ModalWithNavigator({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Material(
child: Navigator(
onGenerateRoute: (_) => MaterialPageRoute(
... ... @@ -29,22 +26,26 @@ class ModalWithNavigator extends StatelessWidget {
(index) => ListTile(
title: Text('Item'),
onTap: () {
Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute(
builder: (context) => CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('New Page'),
),
child: Stack(
fit: StackFit.expand,
children: <Widget>[
MaterialButton(
onPressed: () => Navigator.of(context).pop(),
child: Text('touch here'),
)
],
)
)
), ModalRoute.withName('/'));
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
builder: (context) =>
CupertinoPageScaffold(
navigationBar:
CupertinoNavigationBar(
middle: Text('New Page'),
),
child: Stack(
fit: StackFit.expand,
children: <Widget>[
MaterialButton(
onPressed: () =>
Navigator.of(context)
.pop(),
child: Text('touch here'),
)
],
))),
ModalRoute.withName('/'));
},
)),
).toList(),
... ...
... ... @@ -5,7 +5,6 @@ import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
class NestedScrollModal extends StatelessWidget {
const NestedScrollModal({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return NestedScrollView(
... ...
import 'package:flutter/material.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
class ModalWithPageView extends StatelessWidget {
final ScrollController scrollController;
const ModalWithPageView({Key key, this.scrollController}) : super(key: key);
const ModalWithPageView({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Material(
child: Scaffold(
appBar: AppBar(
leading: Container(), title: Text('Modal With Page View')),
appBar:
AppBar(leading: Container(), title: Text('Modal With Page View')),
body: SafeArea(
bottom: false,
child: PageView(
children: List.generate(2, (index) => ListView(
shrinkWrap: true,
controller: scrollController,
children: ListTile.divideTiles(
context: context,
tiles: List.generate(
100,
(index) => ListTile(
title: Text('Item'),
children: List.generate(
2,
(index) => ListView(
shrinkWrap: true,
controller: ModalScrollController.of(context),
children: ListTile.divideTiles(
context: context,
tiles: List.generate(
100,
(index) => ListTile(
title: Text('Item'),
)),
).toList(),
)),
).toList(),
)),
),
),
),
... ...
... ... @@ -7,7 +7,6 @@ class ModalWithScroll extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Material(
child: CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
... ...
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`)
- 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
url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
SPEC CHECKSUMS:
FlutterMacOS: 15bea8a44d2fa024068daa0140371c020b4b6ff9
url_launcher: af78307ef9bafff91273b34f1c6c0c86a0004fd7
url_launcher_macos: 45af3d61de06997666568a7149c1be98b41c95d4
PODFILE CHECKSUM: d8ba9b3e9e93c62c74a660b46c6fcb09f03991a7
COCOAPODS: 1.8.4
... ...
... ... @@ -28,6 +28,7 @@
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, ); }; };
7750D706F7F4EF7A4673CFC3 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F36D136272EAF3C8E9406E8 /* Pods_Runner.framework */; };
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 */
... ... @@ -58,9 +59,11 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
1601E62CD620826356A7224C /* 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>"; };
31540D3B1454E3935C2255AE /* 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>"; };
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; };
33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
... ... @@ -73,7 +76,9 @@
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>"; };
6F36D136272EAF3C8E9406E8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
8C45A9FE6302E0520D92F872 /* 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>"; };
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; };
/* End PBXFileReference section */
... ... @@ -85,6 +90,7 @@
files = (
D73912F022F37F9E000D13A0 /* App.framework in Frameworks */,
33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */,
7750D706F7F4EF7A4673CFC3 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
... ... @@ -109,6 +115,7 @@
33CEB47122A05771004F2AC0 /* Flutter */,
33CC10EE2044A3C60003C045 /* Products */,
D73912EC22F37F3D000D13A0 /* Frameworks */,
9350091802CFC393284BD46E /* Pods */,
);
sourceTree = "<group>";
};
... ... @@ -157,9 +164,21 @@
path = Runner;
sourceTree = "<group>";
};
9350091802CFC393284BD46E /* Pods */ = {
isa = PBXGroup;
children = (
1601E62CD620826356A7224C /* Pods-Runner.debug.xcconfig */,
8C45A9FE6302E0520D92F872 /* Pods-Runner.release.xcconfig */,
31540D3B1454E3935C2255AE /* Pods-Runner.profile.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
isa = PBXGroup;
children = (
6F36D136272EAF3C8E9406E8 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
... ... @@ -171,11 +190,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
84BD7313E5046A1EFFEE4684 /* [CP] Check Pods Manifest.lock */,
33CC10E92044A3C60003C045 /* Sources */,
33CC10EA2044A3C60003C045 /* Frameworks */,
33CC10EB2044A3C60003C045 /* Resources */,
33CC110E2044A8840003C045 /* Bundle Framework */,
3399D490228B24CF009A79C7 /* ShellScript */,
3F31035F17BB50E98F3B6DB3 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
... ... @@ -282,6 +303,43 @@
shellPath = /bin/sh;
shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh\ntouch Flutter/ephemeral/tripwire\n";
};
3F31035F17BB50E98F3B6DB3 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
84BD7313E5046A1EFFEE4684 /* [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 */
... ...
... ... @@ -4,4 +4,7 @@
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
... ...
... ... @@ -4,4 +4,4 @@ export 'src/material_with_modal_page_route.dart';
export 'src/bottom_sheets/cupertino_bottom_sheet.dart';
export 'src/bottom_sheets/material_bottom_sheet.dart';
export 'src/bottom_sheets/bar_bottom_sheet.dart';
export 'src/utils/modal_scroll_controller.dart';
\ No newline at end of file
export 'src/utils/modal_scroll_controller.dart';
... ...
... ... @@ -262,6 +262,7 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
//Check if scrollController is used
if (!_scrollController.hasClients) return;
//Check if there is more than 1 attached ScrollController e.g. swiping page in PageView
// ignore: invalid_use_of_protected_member
if (_scrollController.positions.length > 1) return;
if (_scrollController !=
... ... @@ -291,7 +292,7 @@ class _ModalBottomSheetState extends State<ModalBottomSheet>
// Otherwise the calculate the velocity with a VelocityTracker
if (_velocityTracker == null) {
final pointerKind = defaultPointerDeviceKind(context);
//final pointerKind = defaultPointerDeviceKind(context);
_velocityTracker = VelocityTracker();
_startTime = DateTime.now();
}
... ...
... ... @@ -78,7 +78,7 @@ class _ModalBottomSheetState<T> extends State<_ModalBottomSheet<T>> {
Widget build(BuildContext context) {
assert(debugCheckHasMediaQuery(context));
final scrollController = PrimaryScrollController.of(context) ??
(_scrollController ??= ScrollController());
(_scrollController ??= ScrollController());
return ModalScrollController(
controller: scrollController,
child: Builder(
... ...
... ... @@ -49,12 +49,13 @@ class BarBottomSheet extends StatelessWidget {
flex: 1,
fit: FlexFit.loose,
child: Material(
shape: shape ?? RoundedRectangleBorder(
side: BorderSide(),
borderRadius: BorderRadius.only(
topLeft: _default_bar_top_radius,
topRight: _default_bar_top_radius),
),
shape: shape ??
RoundedRectangleBorder(
side: BorderSide(),
borderRadius: BorderRadius.only(
topLeft: _default_bar_top_radius,
topRight: _default_bar_top_radius),
),
clipBehavior: clipBehavior ?? Clip.hardEdge,
elevation: elevation ?? 2,
child: SizedBox(
... ...
... ... @@ -39,7 +39,7 @@ class ModalScrollController extends InheritedWidget {
/// Returns null if there is no [ScrollController] associated with the given
/// context.
static ScrollController of(BuildContext context) {
final ModalScrollController result =
final result =
context.dependOnInheritedWidgetOfExactType<ModalScrollController>();
return result?.controller;
}
... ...