Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example apps to use dart_eval 0.7.9, support Flutter 3.22 #83

Merged
merged 2 commits into from
Jul 6, 2024
Merged
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:
generate_bindings:
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.

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
43 changes: 0 additions & 43 deletions lib/src/material/text_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,6 @@ class $TextTheme implements $Instance {
labelLarge: args[12]?.$value,
labelMedium: args[13]?.$value,
labelSmall: args[14]?.$value,
headline1: args[15]?.$value,
headline2: args[16]?.$value,
headline3: args[17]?.$value,
headline4: args[18]?.$value,
headline5: args[19]?.$value,
headline6: args[20]?.$value,
subtitle1: args[21]?.$value,
subtitle2: args[22]?.$value,
bodyText1: args[23]?.$value,
bodyText2: args[24]?.$value,
caption: args[25]?.$value,
button: args[26]?.$value,
overline: args[27]?.$value,
));
}

Expand Down Expand Up @@ -191,36 +178,6 @@ class $TextTheme implements $Instance {
case 'labelSmall':
final labelSmall = $value.labelSmall;
return labelSmall == null ? const $null() : $TextStyle.wrap(labelSmall);
case 'headline1':
final headline1 = $value.headline1;
return headline1 == null ? const $null() : $TextStyle.wrap(headline1);
case 'headline2':
final headline2 = $value.headline2;
return headline2 == null ? const $null() : $TextStyle.wrap(headline2);
case 'headline3':
final headline3 = $value.headline3;
return headline3 == null ? const $null() : $TextStyle.wrap(headline3);
case 'headline4':
final headline4 = $value.headline4;
return headline4 == null ? const $null() : $TextStyle.wrap(headline4);
case 'headline5':
final headline5 = $value.headline5;
return headline5 == null ? const $null() : $TextStyle.wrap(headline5);
case 'headline6':
final headline6 = $value.headline6;
return headline6 == null ? const $null() : $TextStyle.wrap(headline6);
case 'subtitle1':
final subtitle1 = $value.subtitle1;
return subtitle1 == null ? const $null() : $TextStyle.wrap(subtitle1);
case 'subtitle2':
final subtitle2 = $value.subtitle2;
return subtitle2 == null ? const $null() : $TextStyle.wrap(subtitle2);
case 'bodyText1':
final bodyText1 = $value.bodyText1;
return bodyText1 == null ? const $null() : $TextStyle.wrap(bodyText1);
case 'bodyText2':
final bodyText2 = $value.bodyText2;
return bodyText2 == null ? const $null() : $TextStyle.wrap(bodyText2);
}

throw UnimplementedError();
Expand Down
3 changes: 0 additions & 3 deletions lib/src/material/theme_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ class $ThemeData implements $Instance {
primaryColorDark: args[5]?.$value,
canvasColor: args[6]?.$value,
scaffoldBackgroundColor: args[7]?.$value,
bottomAppBarColor: args[8]?.$value,
cardColor: args[9]?.$value,
dividerColor: args[10]?.$value,
highlightColor: args[11]?.$value,
Expand Down Expand Up @@ -154,8 +153,6 @@ class $ThemeData implements $Instance {
return $Color.wrap($value.canvasColor);
case 'scaffoldBackgroundColor':
return $Color.wrap($value.scaffoldBackgroundColor);
case 'bottomAppBarColor':
return $Color.wrap($value.bottomAppBarColor);
case 'cardColor':
return $Color.wrap($value.cardColor);
case 'dividerColor':
Expand Down