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
class _ImprovedDraggableScrollableSheetState extends State<ImprovedDraggableScrollableSheet> { | |
@override | |
Widget build(BuildContext context) { | |
final MediaQueryData mediaQueryData = MediaQuery.of(context); | |
final double heightOfDevice = mediaQueryData.size.height; | |
final initialChildSize = | |
(commentsHeaderHeight + mediaQueryData.viewPadding.bottom + mediaQueryData.viewPadding.top) / heightOfDevice; | |
return DraggableScrollableSheet( |
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
class ImprovedDraggableScrollableSheet extends StatefulWidget { | |
const ImprovedDraggableScrollableSheet({Key? key}) : super(key: key); | |
@override | |
State<ImprovedDraggableScrollableSheet> createState() => _ImprovedDraggableScrollableSheetState(); | |
} | |
class _ImprovedDraggableScrollableSheetState extends State<ImprovedDraggableScrollableSheet> { | |
final GlobalKey commentsHeaderKey = GlobalKey(); |
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
class ImprovedDraggableScrollableSheet extends StatefulWidget { | |
const ImprovedDraggableScrollableSheet({ | |
Key? key, | |
required this.viewPadding, | |
}) : super(key: key); | |
final EdgeInsets viewPadding; | |
@override | |
State<ImprovedDraggableScrollableSheet> createState() => _ImprovedDraggableScrollableSheetState(); |
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
Future<void> main() async { | |
await initApp(); | |
runApp(const MyApp()); | |
} | |
initApp() { | |
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized(); | |
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding); | |
} |