-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bottom sheets and make them look good again (finally)
- Loading branch information
Showing
8 changed files
with
121 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,15 @@ | ||
import 'package:cupertino_modal_sheet/cupertino_modal_sheet.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter/services.dart'; | ||
import 'package:sheet/route.dart'; | ||
|
||
Future<void> showFredericBottomSheet( | ||
{required BuildContext context, | ||
bool enableDrag = false, | ||
bool isDismissible = true, | ||
required Widget Function(BuildContext) builder}) { | ||
return showCupertinoModalSheet( | ||
context: context, | ||
HapticFeedback.lightImpact(); | ||
return Navigator.of(context).push(CupertinoSheetRoute<void>( | ||
stops: isDismissible ? <double>[0, 1] : <double>[1], | ||
builder: builder, | ||
); | ||
|
||
// return showModalBottomSheet( | ||
// context: context, | ||
// shape: const RoundedRectangleBorder( | ||
// borderRadius: BorderRadius.vertical( | ||
// top: Radius.circular(25.0), | ||
// ), | ||
// ), | ||
// builder: (c) => | ||
// Container(height: MediaQuery.of(context).size.height * 0.9)); | ||
// | ||
// // Use `CupertinoModalSheetRoute` to show an ios 15 style modal sheet. | ||
// // For declarative navigation (Navigator 2.0), use `CupertinoModalSheetPage` instead. | ||
// print("WERNER FINDENIG"); | ||
// final modalRoute = CupertinoModalSheetRoute( | ||
// builder: (context) => DraggableSheet( | ||
// child: DecoratedBox( | ||
// decoration: const ShapeDecoration( | ||
// color: CupertinoColors.white, | ||
// shape: RoundedRectangleBorder( | ||
// borderRadius: BorderRadius.all( | ||
// Radius.circular(16), | ||
// ), | ||
// ), | ||
// ), | ||
// child: SizedBox.expand( | ||
// child: Builder(builder: builder), | ||
// )))); | ||
// | ||
// return Navigator.push(context, modalRoute); | ||
)); | ||
} | ||
|
||
// Future<void> showFredericBottomSheetOld( | ||
// {required BuildContext context, | ||
// bool enableDrag = false, | ||
// bool isDismissible = true, | ||
// required Widget Function(BuildContext) builder}) { | ||
// HapticFeedback.lightImpact(); | ||
// | ||
// return showCupertinoModalSheet( | ||
// context: context, | ||
// builder: builder, | ||
// //barrierDismissible: isDismissible, | ||
// ); | ||
// | ||
// // return Navigator.of(context) | ||
// // .push(CupertinoSheetRoute<void>(builder: builder)); | ||
// // Navigator.of(context) | ||
// // .push(SheetRoute<void>(builder: builder, draggable: enableDrag)); | ||
// } | ||
|
||
// void showOldCupertinoFredericBottomSheet({required BuildContext context, required Widget Function(BuildContext) builder}) { | ||
// CupertinoScaffold.showCupertinoModalBottomSheet( | ||
// context: context, | ||
// builder: builder); | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.