Skip to content

Commit

Permalink
publish patch version
Browse files Browse the repository at this point in the history
  • Loading branch information
aprosail committed Jun 28, 2024
2 parents 946b4d0 + 75c8593 commit e47135a
Show file tree
Hide file tree
Showing 18 changed files with 188 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 0.1.3

- Wrap inherit handler (experimental).
- Optimize examples following the pub.dev specifications.
- Update readme examples.
- Build example code as validation in ci.

## 0.1.2

- Wrap `Text` from `String`.
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ class App extends StatelessWidget {
child: const Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: Text('app root'),
child: Text(
'Complex and endless nesting hell.',
),
),
),
);
Expand All @@ -44,9 +46,11 @@ class App extends StatelessWidget {
const App({super.key});
@override
Widget build(BuildContext context) => const Text('app root')
Widget build(BuildContext context) => 'Concise chain style programming.'
.asText
.center
.ensureDirection(context)
.ensureMedia(context);
}
```
8 changes: 8 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Examples

- Before: before using the `modifier` package.
- After: after using the `modifier` package.

The two examples are just for demonstration purposes.
It's not necessary to run or focus on its UI.
Please focus on its source code and compare the difference.
30 changes: 30 additions & 0 deletions example/after/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: web
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
1 change: 1 addition & 0 deletions example/after/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:lintall/lintall.yaml
3 changes: 2 additions & 1 deletion example/after.dart → example/after/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ class App extends StatelessWidget {
const App({super.key});

@override
Widget build(BuildContext context) => const Text('app root')
Widget build(BuildContext context) => 'Concise chain style programming.'
.asText
.center
.ensureDirection(context)
.ensureMedia(context);
Expand Down
13 changes: 13 additions & 0 deletions example/after/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: modifier_example_after
description: An example after using the modifier package.
publish_to: "none"
version: 0.0.0
environment: {sdk: ">=3.4.3 <4.0.0"}

dependencies:
flutter: {sdk: flutter}
modifier: {path: ../../}

dev_dependencies:
flutter_test: {sdk: flutter}
lintall: ^0.1.0
19 changes: 19 additions & 0 deletions example/after/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html>
<head>
<base href="$FLUTTER_BASE_HREF" />
<meta charset="UTF-8" />
<meta content="IE=Edge" http-equiv="X-UA-Compatible" />
<meta name="description" content="A new Flutter project." />

<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="before" />

<title>after</title>
<link rel="manifest" href="manifest.json" />
</head>
<body>
<script src="flutter_bootstrap.js" async></script>
</body>
</html>
12 changes: 12 additions & 0 deletions example/after/web/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "modifier_example_after",
"short_name": "after",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "An example after using the modifier package.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": []
}
30 changes: 30 additions & 0 deletions example/before/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: web
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
1 change: 1 addition & 0 deletions example/before/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:lintall/lintall.yaml
4 changes: 3 additions & 1 deletion example/before.dart → example/before/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class App extends StatelessWidget {
child: const Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: Text('app root'),
child: Text(
'Complex and endless nesting hell.',
),
),
),
);
Expand Down
12 changes: 12 additions & 0 deletions example/before/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: modifier_example_before
description: An example before using the modifier package.
publish_to: "none"
version: 0.0.0
environment: {sdk: ">=3.4.3 <4.0.0"}

dependencies:
flutter: {sdk: flutter}

dev_dependencies:
flutter_test: {sdk: flutter}
lintall: ^0.1.0
19 changes: 19 additions & 0 deletions example/before/web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html>
<head>
<base href="$FLUTTER_BASE_HREF" />
<meta charset="UTF-8" />
<meta content="IE=Edge" http-equiv="X-UA-Compatible" />
<meta name="description" content="A new Flutter project." />

<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="before" />

<title>before</title>
<link rel="manifest" href="manifest.json" />
</head>
<body>
<script src="flutter_bootstrap.js" async></script>
</body>
</html>
12 changes: 12 additions & 0 deletions example/before/web/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "modifier_example_before",
"short_name": "before",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "An example before using the modifier package.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": []
}
4 changes: 4 additions & 0 deletions lib/src/inherit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ class InheritHandlerAPI<T> {
final void Function(T value) update;
}

extension WrapInheritHandler on Widget {
Widget handle<T>(T data) => InheritHandler<T>(data: data, child: this);
}

extension UpdateInheritHandler on BuildContext {
void update<T>(T Function(T raw) updater) {
final raw = find<T>();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: modifier
description: Syntax sugar optimizations to avoid nesting hell in Flutter.
version: 0.1.2
version: 0.1.3
homepage: https://github.com/treeinfra/modifier
environment: {sdk: ">=3.4.3 <4.0.0", flutter: ">=3.22.2"}
topics:
Expand Down
8 changes: 8 additions & 0 deletions review.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@ flutter pub get || exit 1
dart format --output=none --set-exit-if-changed . || exit 1
flutter analyze --fatal-infos || exit 1
flutter test || exit 1

# Build the examples to validate.
cd example/before
flutter build web || exit 1
cd ../after
flutter build web || exit 1
cd ../..

flutter pub publish --dry-run || exit 1

0 comments on commit e47135a

Please sign in to comment.