Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/generate_bindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- uses: monterail/flutter-action@v1
with:
channel: 'stable'
- run: make flutter_bindings
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
on:
pull_request:
branches:
- master

jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: monterail/flutter-action@v1
with:
channel: 'stable'
- run: flutter test
11 changes: 2 additions & 9 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class EvalExample extends StatelessWidget {

@override
Widget build(BuildContext context) {
return const EvalWidget(
return const CompilerWidget(
packages: {
'example': {
'main.dart': '''
Expand Down Expand Up @@ -64,7 +64,7 @@ class EvalExample extends StatelessWidget {
),
Text(
'\$_counter',
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.titleSmall,
),
],
)
Expand All @@ -82,13 +82,6 @@ class EvalExample extends StatelessWidget {
}
},

/// In debug mode, flutter_eval will continually re-generate a compiled
/// EVC bytecode file for the given program, and save it to the specified
/// assetPath. During runtime, it will instead load the compiled EVC file.
/// To ensure this works, you must add the file path to the assets section of
/// your pubspec.yaml file.
assetPath: 'assets/program.evc',

/// Specify which library (i.e. which file) to use as an entrypoint.
library: 'package:example/main.dart',

Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ environment:
dependencies:
flutter:
sdk: flutter
dart_eval: ^0.7.8
dart_eval: ^0.7.9
flutter_eval:
path: ../

Expand All @@ -23,4 +23,4 @@ dev_dependencies:
flutter:
uses-material-design: true
assets:
- assets/program.evc
# - assets/program.evc
Binary file modified examples/code_push_app/assets/hot_update.evc
Binary file not shown.

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions examples/code_push_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ class MyApp extends StatelessWidget {
// Load a potential hot-swap update to be used by our app. If the URI responds with
// an error, it will be treated as no update present.
return HotSwapLoader(
// Updates can be loaded from the network using http:// and https://,
// or from local files/Flutter assets using file:// and asset:// respectively.
uri: 'asset://assets/hot_update.evc',
loader: AssetEvcLoader.fromString('asset://assets/hot_update.evc'),
strategy: HotSwapStrategy.immediate,
child: MaterialApp(
title: 'Flutter Demo',
Expand Down
2 changes: 1 addition & 1 deletion examples/code_push_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
cupertino_icons: ^1.0.6
flutter_eval:
path: ../../
dart_eval: ^0.7.8
dart_eval: ^0.7.9

dev_dependencies:
flutter_test:
Expand Down
Loading