-
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.
Add builder constructor and update version to 0.0.2
- Loading branch information
1 parent
796e7d6
commit b7c71be
Showing
10 changed files
with
175 additions
and
61 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,3 +1,3 @@ | ||
## 0.0.1 | ||
|
||
* TODO: Describe initial release. | ||
- Add ObscureWidget(), ObscureWidget.builder() and obscure() extension on widget. |
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,15 +1,66 @@ | ||
# obscure_widget | ||
# ObscureWidget blur its child when screen is being captured | ||
|
||
A new Flutter plugin project. | ||
## Usages | ||
|
||
## Getting Started | ||
Lets take a look at how to use `ObscureWidget`, `ObscureWidget.builder()` and `.obscured()` extension. | ||
|
||
This project is a starting point for a Flutter | ||
[plug-in package](https://flutter.dev/developing-packages/), | ||
a specialized package that includes platform-specific implementation code for | ||
Android and/or iOS. | ||
### ObscureWidget | ||
|
||
For help getting started with Flutter development, view the | ||
[online documentation](https://flutter.dev/docs), which offers tutorials, | ||
samples, guidance on mobile development, and a full API reference. | ||
supported parameters **blur**, **blurColor**, **borderRadius**, and **colorOpacity** | ||
|
||
```dart | ||
ObscureWidget( | ||
child: Container( | ||
width: double.infinity, | ||
color: Colors.amber, | ||
padding: const EdgeInsets.all(18.0), | ||
child: Text( | ||
'Secure Text', | ||
style: Theme.of(context).textTheme.headline6, | ||
), | ||
), | ||
) | ||
``` | ||
|
||
### with .obscured() extension | ||
|
||
```dart | ||
Container( | ||
width: double.infinity, | ||
color: Colors.amber, | ||
padding: const EdgeInsets.all(18.0), | ||
child: Text( | ||
'Other Secure Text with extension', | ||
style: Theme.of(context).textTheme.headline6, | ||
), | ||
).obscured(blur: 2, blurColor: Colors.red), | ||
``` | ||
|
||
### ObscureWidget.builder() | ||
|
||
use this for custom implementation | ||
|
||
```dart | ||
ObscureWidget.builder( | ||
obscureBuilder: (context, isCaptured, child) { | ||
return Container( | ||
decoration: BoxDecoration( | ||
border: Border.all( | ||
width: 4, | ||
color: isCaptured ? Colors.red : Colors.green, | ||
), | ||
), | ||
child: child, | ||
); | ||
}, | ||
child: Container( | ||
width: double.infinity, | ||
color: Colors.black, | ||
padding: const EdgeInsets.all(18.0), | ||
child: Text( | ||
'Other Secure Text with builder constructor', | ||
style: Theme.of(context).textTheme.headline6?.copyWith(color: Colors.white), | ||
), | ||
), | ||
) | ||
``` |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.