Skip to content

Commit 4ddcb48

Browse files
authored
0.0.1-pre.1 (#5)
* Refactor history button and search widget * Update error_util.dart and platform_initialization.dart files * ToggleOctopusTools * Add helper methods * Add insert and insertAll methods to OctopusNodeBase * Refactor OctopusState and OctopusNode classes * Add test for decoding location with UUID * Add devtools configuration file * Add octopus tools * Add global key for AppState * Reverse order of adding nodes in StateUtil.normalizeChildren() * Add InheritedOctopus * Add script to move all files to the web folder * Update image source directory path * Update pipeline * Update network path * Fix NetworkImage * Refactoring * Refactor product image widget in product screen * Update OctopusInformationProvider * handlesBackButton * Update platform initialization and history handling * Comment setUrlStrategy * 0.0.1-pre.1
1 parent cb2cf8f commit 4ddcb48

Some content is hidden

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

59 files changed

+2467
-1779
lines changed

.github/workflows/example-deploy-production.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ jobs:
4242
flutter pub get
4343
timeout-minutes: 5
4444

45+
- name: 🖼️ Move images from assets to web
46+
working-directory: ${{ env.working-directory }}
47+
run: |
48+
dart run bin/web_move_images.dart
49+
timeout-minutes: 5
50+
4551
- name: 🏗️ Codegen
4652
working-directory: ${{ env.working-directory }}
4753
run: |
@@ -56,8 +62,8 @@ jobs:
5662
run: |
5763
flutter build web --release --no-source-maps \
5864
--no-tree-shake-icons --pwa-strategy offline-first \
59-
--web-renderer canvaskit --base-href / \
60-
--dart-define=ENVIRONMENT=production --dart-define=PROD=true
65+
--base-href / \
66+
--dart-define-from-file=config/production.json
6167
6268
- name: 📁 Upload web build result
6369
uses: actions/upload-artifact@v3

.github/workflows/example-deploy-staging.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ jobs:
5252
flutter pub get
5353
timeout-minutes: 5
5454

55+
- name: 🖼️ Move images from assets to web
56+
working-directory: ${{ env.working-directory }}
57+
run: |
58+
dart run bin/web_move_images.dart
59+
timeout-minutes: 5
60+
5561
- name: 🏗️ Codegen
5662
working-directory: ${{ env.working-directory }}
5763
run: |
@@ -66,8 +72,8 @@ jobs:
6672
run: |
6773
flutter build web --release --no-source-maps \
6874
--no-tree-shake-icons --pwa-strategy offline-first \
69-
--web-renderer canvaskit --base-href / \
70-
--dart-define=ENVIRONMENT=staging --dart-define=STAGE=true
75+
--base-href / \
76+
--dart-define-from-file=config/staging.json
7177
7278
- name: 📁 Upload web build result
7379
uses: actions/upload-artifact@v3

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.0.1-pre.1
2+
3+
- Refactoring
4+
15
## 0.0.1-pre.0
26

37
- Initial publication

example/bin/move_images.dart

Lines changed: 0 additions & 24 deletions
This file was deleted.

example/bin/web_move_images.dart

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// ignore_for_file: avoid_print
2+
3+
import 'dart:io' as io;
4+
5+
import 'package:path/path.dart' as p;
6+
7+
void main() {
8+
final current = io.Directory.current;
9+
10+
// Move images
11+
final src = io.Directory(p.join(current.path, 'assets', 'data', 'images'));
12+
final dst =
13+
io.Directory(p.join(current.path, 'web', 'assets', 'data', 'images'))
14+
..createSync(recursive: true);
15+
final files = src
16+
.listSync(recursive: false)
17+
.whereType<io.File>()
18+
.where((e) => e.path.endsWith('.webp'))
19+
.toList(growable: false);
20+
for (final file in files) {
21+
final newPath = p.join(dst.path, p.basename(file.path));
22+
if (io.File(newPath).existsSync()) continue;
23+
file
24+
..copySync(newPath)
25+
..deleteSync();
26+
print('${file.path} -> $newPath');
27+
}
28+
29+
// Change pubspec.yaml
30+
final pubspec = io.File(p.join(current.path, 'pubspec.yaml'));
31+
final content = pubspec
32+
.readAsStringSync()
33+
.replaceAll(RegExp(r'\s+\-\s*assets\/data\/images.*'), '');
34+
pubspec.writeAsStringSync(content);
35+
}

example/config/staging.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ENVIRONMENT": "staging"
3+
}

example/devtools_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extensions:

example/lib/src/common/router/routes.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ enum Routes with OctopusRoute {
7777
/// Pushes the [route] to the catalog tab.
7878
/// [id] is the product or category id for the [route].
7979
static void pushToCatalog(BuildContext context, Routes route, String id) =>
80-
Octopus.of(context).setState((state) {
80+
context.octopus.setState((state) {
8181
final node = state.find((n) => n.name == 'catalog-tab');
8282
if (node == null) {
8383
return state
@@ -101,7 +101,7 @@ enum Routes with OctopusRoute {
101101

102102
/// Pops the last [route] from the catalog tab.
103103
static void popFromCatalog(BuildContext context) =>
104-
Octopus.of(context).setState((state) {
104+
context.octopus.setState((state) {
105105
final node = state.find((n) => n.name == 'catalog-tab');
106106
if (node == null || node.children.length < 2) {
107107
return state

example/lib/src/common/util/error_util.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import 'dart:async';
44

5-
import 'package:example/src/common/util/platform/error_util_platform.dart'
5+
import 'package:example/src/common/util/platform/error_util_vm.dart'
66
// ignore: uri_does_not_exist
7-
if (dart.library.html) 'package:example/src/common/util/platform/error_util_browser.dart';
7+
if (dart.library.html) 'package:example/src/common/util/platform/error_util_js.dart';
88
import 'package:l/l.dart';
99

1010
/// Error util.

example/lib/src/common/util/platform/error_util_browser.dart renamed to example/lib/src/common/util/platform/error_util_js.dart

File renamed without changes.

0 commit comments

Comments
 (0)