Replies: 14 comments 29 replies
-
Hi, flutter_eval does not support |
Beta Was this translation helpful? Give feedback.
-
thanks for quick reply, it's better to add those comments to readme, and give the user a full successful steps. thanks |
Beta Was this translation helpful? Give feedback.
-
Added documentation to readme in ccb607e. Closing |
Beta Was this translation helpful? Give feedback.
-
still has some error. after i change as readme said: Widget main() {
// do any setup, then
return MyApp();
}
// void main() {
// //runApp(const MyApp());
// } dart_eval: 0.4.7 Unhandled exception:
Null check operator used on a null value
#0 _resolveImportsAndExports.<anonymous closure> (package:dart_eval/src/eval/compiler/compiler.dart:620:87)
#1 MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)
#2 ListIterable.toSet (dart:_internal/iterable.dart:218:18)
#3 _resolveImportsAndExports (package:dart_eval/src/eval/compiler/compiler.dart:620:90)
#4 Compiler.compileSources (package:dart_eval/src/eval/compiler/compiler.dart:165:9)
#5 Compiler.compile (package:dart_eval/src/eval/compiler/compiler.dart:118:12)
#6 main (file:///Users/zmtzawqlp/Documents/github/hot_update/flutter_eval/dart_eval/bin/dart_eval.dart:103:36)
#7 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
#8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12) |
Beta Was this translation helpful? Give feedback.
-
may be we can provide annotation to define which class should be scan to generate program.evc, and one Eval() one .evc, so that we can decide which page/widget we need to hot update. @Eval(fileName:'HomePage.evc', library:"package:hot_update_demo/home_page.dart", function:"MyHomePage.")
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key}) : super(key: key);
@override
State<MyHomePage> createState() {
return _MyHomePageState();
}
}
|
Beta Was this translation helpful? Give feedback.
-
it seems that dart_eval compiler not use AnalysisContextCollection to scan dart sdk and flutter sdk to generate the template code. maybe we can create a tool to do this , and reduce adaptation problems. https://stackoverflow.com/questions/69670345/in-dart-how-do-i-get-from-the-ast-to-elements and i made a plugin https://pub.dev/packages/ff_annotation_route to generate route, we can get dart type and other info, make a tool. I'm trying to understand the principle of dart_eval and flutter_eval , does it support any logic (in theory)? widget map is easy to do, we can scan dart sdk, flutter sdk, packages and generate the map for all the widget, type, class, enum. but i can't get how to support the logic? it's kind of you if you can clarify it when you have a time. thanks. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
i make a simple demo , still has some error
|
Beta Was this translation helpful? Give feedback.
-
it works after i add |
Beta Was this translation helpful? Give feedback.
-
Navigator and NavigatorState are support in flutter_eval, but it has some error when compile with dart_eval NavigatorState navigatorState = Navigator.of(context);
navigatorState.pushNamed('PageA'); full code:
error: Found binding file: .dart_eval/bindings/flutter_eval.json
Compiling package runtime_widgets...
Unhandled exception:
Null check operator used on a null value
#0 CompilerContext.lookupLocal (package:dart_eval/src/eval/compiler/context.dart:223:40)
#1 IdentifierReference.getValue (package:dart_eval/src/eval/compiler/reference.dart:163:23)
#2 compileIdentifier (package:dart_eval/src/eval/compiler/expression/identifier.dart:13:48)
#3 compileMethodInvocation (package:dart_eval/src/eval/compiler/expression/method_invocation.dart:30:20)
#4 compileExpression (package:dart_eval/src/eval/compiler/expression/expression.dart:30:12)
#5 compileReturn (package:dart_eval/src/eval/compiler/statement/return.dart:43:17)
#6 compileStatement (package:dart_eval/src/eval/compiler/statement/statement.dart:24:12)
#7 compileBlock (package:dart_eval/src/eval/compiler/statement/block.dart:16:20)
#8 compileMethodDeclaration (package:dart_eval/src/eval/compiler/declaration/method.dart:51:14)
#9 compileDeclaration (package:dart_eval/src/eval/compiler/declaration/declaration.dart:18:12)
#10 compileClassDeclaration (package:dart_eval/src/eval/compiler/declaration/class.dart:29:5)
#11 compileDeclaration (package:dart_eval/src/eval/compiler/declaration/declaration.dart:16:5)
#12 Compiler.compileSources.<anonymous closure>.<anonymous closure> (package:dart_eval/src/eval/compiler/compiler.dart:338:9)
#13 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:614:13)
#14 Compiler.compileSources.<anonymous closure> (package:dart_eval/src/eval/compiler/compiler.dart:327:13)
#15 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:614:13)
#16 Compiler.compileSources (package:dart_eval/src/eval/compiler/compiler.dart:324:30)
#17 Compiler.compile (package:dart_eval/src/eval/compiler/compiler.dart:131:12)
#18 main (file:///Users/zmtzawqlp/.pub-cache/hosted/pub.flutter-io.cn/dart_eval-0.5.0/bin/dart_eval.dart:103:36)
#19 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:32)
#20 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12) |
Beta Was this translation helpful? Give feedback.
-
isSelected and selectedIcon properties of IconButton are not in flutter 3.0.5
|
Beta Was this translation helpful? Give feedback.
-
TextButton(
child: Icon(
Icons.add,
color: Colors.red,
),
onPressed: () {
Navigator.of(context).pushNamed(
'PageA',
arguments: <String, dynamic>{
'key': null,
'count': _counter,
'constructorName': '',
'argumentNames': ['key', 'count'],
},
);
},
)
],
), error when i click button
|
Beta Was this translation helpful? Give feedback.
-
still has error when try to compile with dart_eval NavigatorState navigatorState = Navigator.of(context);
navigatorState.pushNamed('PageA'); |
Beta Was this translation helpful? Give feedback.
-
work fine. but i found error when i try to add auto generate route helper class // GENERATED CODE - DO NOT MODIFY MANUALLY
// **************************************************************************
// Auto generated by https://github.com/fluttercandies/ff_annotation_route
// **************************************************************************
// fast mode: false
// version: 10.0.6
// **************************************************************************
// ignore_for_file: prefer_const_literals_to_create_immutables,unused_local_variable,unused_import,unnecessary_import,unused_shown_name,implementation_imports,duplicate_import
import 'package:flutter/foundation.dart';
import 'package:flutter/src/foundation/key.dart'
as autoimport61a64860a48a0a727515bc4ec00b2fff;
const List<String> routeNames = <String>[
'HomePage',
'PageA',
];
class Routes {
const Routes._();
/// 'HomePage'
///
/// [name] : 'HomePage'
///
/// [exts] : {'library': 'package:runtime_widgets/src/pages/home_page.dart', 'function': 'HomePageWidget.'}
static const String homePage = 'HomePage';
/// 'PageA'
///
/// [name] : 'PageA'
///
/// [constructors] :
///
/// PageA({Key? key, required int count})
///
/// [exts] : {'library': 'package:runtime_widgets/src/pages/page_a.dart', 'function': 'PageAWidget.'}
static const _PageA pageA = _PageA();
}
class _PageA {
const _PageA();
String get name => 'PageA';
Map<String, dynamic> d(
{autoimport61a64860a48a0a727515bc4ec00b2fff.Key? key,
required int count}) =>
<String, dynamic>{
'key': key,
'count': count,
'constructorName': '',
'argumentNames': ['key', 'count'],
};
@override
String toString() => name;
} |
Beta Was this translation helpful? Give feedback.
-
i am follow the readme, add flutter_eval.json into project and run
dart_eval compile -o program.evc
, get some error, would you please check it if you have time, thanks.demo.zip
Beta Was this translation helpful? Give feedback.
All reactions