Unverified Commit acbd2801 authored by Mohammad Ghalayini's avatar Mohammad Ghalayini Committed by GitHub

Add an Interactive Example for PhysicalShape (#86423)

parent 0d7e6798
......@@ -1049,6 +1049,47 @@ class PhysicalModel extends SingleChildRenderObjectWidget {
/// [PhysicalModel] does the same but only supports shapes that can be expressed
/// as rectangles with rounded corners.
///
/// {@tool dartpad --template=stateless_widget_material}
///
/// This example shows how to use a [PhysicalShape] on a centered [SizedBox]
/// to clip it to a rounded rectangle using a [ShapeBorderClipper] and give it
/// an orange color along with a shadow.
///
/// ```dart
/// Widget build(BuildContext context) {
/// return Scaffold(
/// appBar: AppBar(
/// title: const Text('PhysicalShape Sample'),
/// ),
/// body: Center(
/// child: PhysicalShape(
/// elevation: 5.0,
/// child: const SizedBox(
/// child: Center(
/// child: Text(
/// 'Hello, World!',
/// style: TextStyle(
/// color: Colors.white,
/// fontSize: 20.0,
/// ),
/// ),
/// ),
/// height: 200.0,
/// width: 200.0,
/// ),
/// clipper: ShapeBorderClipper(
/// shape: RoundedRectangleBorder(
/// borderRadius: BorderRadius.circular(10.0),
/// )
/// ),
/// color: Colors.orange,
/// ),
/// ),
/// );
/// }
/// ```
/// {@end-tool}
///
/// See also:
///
/// * [ShapeBorderClipper], which converts a [ShapeBorder] to a [CustomClipper], as
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment