Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

Commit

Permalink
readme example of comment line
Browse files Browse the repository at this point in the history
  • Loading branch information
aprosail committed May 16, 2024
1 parent e92bf52 commit 825c777
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,36 @@ class App extends StatelessWidget {
const App({super.key});
@override
Widget build(BuildContext context) => const Text('app root')
Widget build(BuildContext context) => 'app root'
.textWidget
.wrapCenter
.wrapForeground(context, const Color(0xffdedcda))
.wrapBackground(const Color(0xff804044))
.ensureTextEnvironment(context);
}
```

Simplify your code is not the only benefit of using such package.
The chain-style programming also makes comment to cancel code easier:
such as you can simply cancel a line to remove a layer of widget,
and when you want to use them again, you can simply cancel the comment
to add them back to your code, that you don't need to worry about the indents.
For example:

```dart
import 'package:flutter/widgets.dart';
import 'package:wrap/wrap.dart';
class App extends StatelessWidget {
const App({super.key});
@override
Widget build(BuildContext context) => 'app root'
.textWidget
// .wrapCenter
// .wrapFontSize(23)
.wrapForeground(context, const Color(0xffbcbebf))
.wrapBackground(const Color(0xff232425))
.ensureTextEnvironment(context);
}
```

0 comments on commit 825c777

Please sign in to comment.