Skip to content

Commit 5044044

Browse files
committed
+Performance updates, better examples
1 parent 7edaea0 commit 5044044

48 files changed

Lines changed: 4048 additions & 1504 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/_README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This workflow provides a manual trigger for publishing. It activates **only** wh
3434

3535
### 3. `deploy-example.yml` (Optional)
3636

37-
If your project contains a Flutter web example in a `hosted_example` directory, this workflow will automatically build it and deploy it to GitHub Pages on every push to the `main` branch. This is great for providing live demos of your package.
37+
If your project contains a Flutter web example in an `example/hosted_example` directory, this workflow will automatically build it and deploy it to GitHub Pages on every push to the `main` branch. This is great for providing live demos of your package.
3838

3939
---
4040

.github/workflows/deploy-example.yml_REMOVE_TO_ENABLE

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,30 +40,30 @@ jobs:
4040
# Install all project dependencies
4141
- name: Install dependencies
4242
run: flutter pub get
43-
working-directory: ./hosted_example
43+
working-directory: ./example/hosted_example
4444

4545
# Enable Flutter web support
4646
- name: Enable Flutter web support
4747
run: flutter config --enable-web
48-
working-directory: ./hosted_example
48+
working-directory: ./example/hosted_example
4949

50-
# Build the web app in /hosted_example/
51-
- name: Build web app in /hosted_example/
50+
# Build the web app in /example/hosted_example/
51+
- name: Build web app in /example/hosted_example/
5252
run: flutter build web --release --wasm --base-href "/${{ github.event.repository.name }}/"
53-
working-directory: ./hosted_example
53+
working-directory: ./example/hosted_example
5454

5555
# Necessary
5656
- name: Create .nojekyll
57-
run: touch hosted_example/build/web/.nojekyll
57+
run: touch example/hosted_example/build/web/.nojekyll
5858

5959
# Necessary
6060
- name: Create 404.html for SPA routing
61-
run: cp hosted_example/build/web/index.html hosted_example/build/web/404.html
61+
run: cp example/hosted_example/build/web/index.html example/hosted_example/build/web/404.html
6262

6363
# Deploy the app to GitHub Pages
6464
- name: Deploy to GitHub Pages
6565
uses: peaceiris/actions-gh-pages@v4
6666
with:
6767
github_token: ${{ secrets.GITHUB_TOKEN }}
68-
publish_dir: ./hosted_example/build/web
68+
publish_dir: ./example/hosted_example/build/web
6969
keep_files: false

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
## Summary
1717

18-
A lightweight Flutter router with state management. [Live demo](https://dev-cetera.github.io/df_router/chat?chatId=123456).
18+
A lightweight Flutter router with state management. [Live demo](https://dev-cetera.github.io/df_router/).
1919

2020
## Quick Start
2121

_README_CONTENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Summary
22

3-
A lightweight Flutter router with state management. [Live demo](https://dev-cetera.github.io/df_router/chat?chatId=123456).
3+
A lightweight Flutter router with state management. [Live demo](https://dev-cetera.github.io/df_router/).
44

55
## Quick Start
66

analysis_options.yaml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
##.title
2-
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
3-
##
4-
## Copyright © dev-cetera.com & contributors.
5-
##
6-
## The use of this source code is governed by an MIT-style license described in
7-
## the LICENSE file located in this project's root directory.
8-
##
9-
## See: https://opensource.org/license/mit
10-
##
11-
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
12-
##.title~
1+
# For dev-cetera.com
2+
# Version: 1
133

14-
include: package:flutter_lints/flutter.yaml
4+
include: package:lints/recommended.yaml
155

166
## ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
177

@@ -31,6 +21,7 @@ linter:
3121
prefer_relative_imports: true
3222
prefer_single_quotes: true
3323
require_trailing_commas: true
24+
unawaited_futures: true
3425
unnecessary_this: true
3526

3627
analyzer:
@@ -42,22 +33,27 @@ analyzer:
4233
strict-raw-types: true
4334
exclude:
4435
- build/**
36+
# - '**.g.dart'
4537

4638
errors:
47-
unused_label: ignore
4839
always_declare_return_types: error
4940
avoid_renaming_method_parameters: error
5041
avoid_type_to_string: error
42+
close_sinks: error
43+
collection_methods_unrelated_type: error
5144
depend_on_referenced_packages: error
5245
flutter_style_todos: error
5346
invalid_override_of_non_virtual_member: error
5447
invalid_use_of_protected_member: error
48+
missing_return: error
5549
no_leading_underscores_for_local_identifiers: error
5650
prefer_final_in_for_each: error
5751
prefer_relative_imports: error
52+
record_literal_one_positional_no_trailing_comma: error
5853
unnecessary_new: error
5954
unrelated_type_equality_checks: error
55+
unused_label: ignore
6056
use_key_in_widget_constructors: error
6157

6258
formatter:
63-
trailing_commas: preserve
59+
trailing_commas: preserve

example/example.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ final class HomeRoute extends RouteState {
1111
final class ChatRoute extends RouteState {
1212
final String chatId;
1313
ChatRoute({required this.chatId})
14-
: super.parse('/chat', queryParameters: {'chatId': chatId});
14+
: super.parse('/chat', queryParameters: {'chatId': chatId});
1515
ChatRoute.from(RouteState other)
16-
: chatId = other.uri.queryParameters['chatId'] ?? '',
17-
super(other.uri);
16+
: chatId = other.uri.queryParameters['chatId'] ?? '',
17+
super(other.uri);
1818
}
1919

2020
class MyApp extends StatelessWidget {

hosted_example/analysis_options.yaml renamed to example/hosted_example/analysis_options.yaml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
1-
##.title
2-
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
3-
##
4-
## Copyright © dev-cetera.com & contributors.
5-
##
6-
## The use of this source code is governed by an MIT-style license described in
7-
## the LICENSE file located in this project's root directory.
8-
##
9-
## See: https://opensource.org/license/mit
10-
##
11-
## ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
12-
##.title~
1+
# For dev-cetera.com
2+
# Version: 1
133

14-
include: package:flutter_lints/flutter.yaml
4+
include: package:lints/recommended.yaml
155

166
## ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
177

@@ -31,6 +21,7 @@ linter:
3121
prefer_relative_imports: true
3222
prefer_single_quotes: true
3323
require_trailing_commas: true
24+
unawaited_futures: true
3425
unnecessary_this: true
3526

3627
analyzer:
@@ -42,22 +33,27 @@ analyzer:
4233
strict-raw-types: true
4334
exclude:
4435
- build/**
36+
# - '**.g.dart'
4537

4638
errors:
47-
unused_label: ignore
4839
always_declare_return_types: error
4940
avoid_renaming_method_parameters: error
5041
avoid_type_to_string: error
42+
close_sinks: error
43+
collection_methods_unrelated_type: error
5144
depend_on_referenced_packages: error
5245
flutter_style_todos: error
5346
invalid_override_of_non_virtual_member: error
5447
invalid_use_of_protected_member: error
48+
missing_return: error
5549
no_leading_underscores_for_local_identifiers: error
5650
prefer_final_in_for_each: error
5751
prefer_relative_imports: error
52+
record_literal_one_positional_no_trailing_comma: error
5853
unnecessary_new: error
5954
unrelated_type_equality_checks: error
55+
unused_label: ignore
6056
use_key_in_widget_constructors: error
6157

6258
formatter:
63-
trailing_commas: preserve
59+
trailing_commas: preserve

0 commit comments

Comments
 (0)