Skip to content

Instantly share code, notes, and snippets.

@VB10
Created September 11, 2022 01:04
Show Gist options
  • Save VB10/b491441fc21ea06eadd75e3a408973ed to your computer and use it in GitHub Desktop.
Save VB10/b491441fc21ea06eadd75e3a408973ed to your computer and use it in GitHub Desktop.
Custom page sheet
import 'package:flutter/material.dart';
class CustomPage extends StatelessWidget {
const CustomPage({super.key});
@override
Widget build(BuildContext context) {
return Container();
}
}
extension CustomPageSheet on CustomPage {
Future<T?> show<T>(BuildContext context) {
return showModalBottomSheet(context: context, builder: (context) => this);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment