Skip to content

Commit

Permalink
Add VWModal doc
Browse files Browse the repository at this point in the history
  • Loading branch information
carllosnc committed Feb 11, 2024
1 parent 7e4fef2 commit c20a12a
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docs/vw_modal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# VWModal

`VWModal` is a modal component that can be used to display a modal on the screen.

## Parameters

| Property | Type | Description |
| -------------- | -------------- | ---------------------------------------------------------- |
| `context` | `BuildContext` | The build context of the page. |
| `body` | `Widget` | The body of the dialog. |
| `insetPadding` | `EdgeInsets` | The padding of the dialog. Defaults to EdgeInsets.all(30). |

## Usage

```dart
FilledButton(
onPressed: () {
VWModal.open(
context: context,
body: Container(
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.secondaryContainer,
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: FilledButton(
onPressed: () {
VWModal.close(context);
},
child: const Text('Close'),
),
),
),
);
},
child: const Text('Open Dialog'),
)
```

0 comments on commit c20a12a

Please sign in to comment.