chn-sunch / flutter_mycommunity_app

整合了IM通讯,移动支付,地图导航,语音,智能验证码等功能的Flutter社交电商你可以在这里找到许多实现案例
MIT License
276 stars 79 forks source link

无法运行,是有什么特殊配置吗 #6

Open llllonger opened 2 years ago

llllonger commented 2 years ago

麻烦问一下,运行的时候跑不起来,有什么特殊的配置吗?

--W- The variant: debug, There's no json file --W- The variant: release, There's no json file --W- The variant: profile, There's no json file

chn-sunch commented 2 years ago

没有特殊配置。

dashu3344 commented 2 years ago

`70:7: Error: No named parameter with the name 'context'. context: context, ^^^^^^^ /C:/flutter_windows_2.10.3-stable/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_screenutil-5.5.1/lib/src/screen_util.dart:88:15: Context: Found this candidate, but the arguments don't match. static void init( ^^^^ lib/util/animationpage_util.dart:366:18: Error: Superclass has no method named 'buildMyTransitions'. return super.buildMyTransitions(context, animation, secondaryAnimation, page); ^^^^^^^^^^^^^^^^^^ Unhandled exception: NoSuchMethodError: The getter 'name' was called on null. Receiver: null Tried calling: name

0 Object.noSuchMethod (dart:core-patch/object_patch.dart:38:5)

1 ProgramCompiler._emitSuperTarget (package:dev_compiler/src/kernel/compiler.dart:5373:41)

2 ProgramCompiler.visitSuperMethodInvocation (package:dev_compiler/src/kernel/compiler.dart:5366:24)

3 SuperMethodInvocation.accept (package:kernel/ast.dart:6215:44)

4 ProgramCompiler._visitExpression (package:dev_compiler/src/kernel/compiler.dart:3870:20)

5 ProgramCompiler.visitAsExpression (package:dev_compiler/src/kernel/compiler.dart:5997:18)

6 AsExpression.accept (package:kernel/ast.dart:7414:44)

7 ProgramCompiler._visitExpression (package:dev_compiler/src/kernel/compiler.dart:3870:20)

8 ProgramCompiler.visitReturnStatement (package:dev_compiler/src/kernel/compiler.dart:4401:38)

9 ReturnStatement.accept (package:kernel/ast.dart:9877:43)

10 ProgramCompiler._visitStatement (package:dev_compiler/src/kernel/compiler.dart:3776:20)

11 MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)

12 ListIterator.moveNext (dart:_internal/iterable.dart:342:26)

13 new _GrowableList._ofEfficientLengthIterable (dart:core-patch/growable_array.dart:206:27)

14 new _GrowableList.of (dart:core-patch/growable_array.dart:153:28)

15 new List.of (dart:core-patch/array_patch.dart:51:28)

16 ListIterable.toList (dart:_internal/iterable.dart:213:44)

17 ProgramCompiler.visitBlock (package:dev_compiler/src/kernel/compiler.dart:3964:62)

18 Block.accept (package:kernel/ast.dart:8898:43)

19 ProgramCompiler._visitStatement (package:dev_compiler/src/kernel/compiler.dart:3776:20)

20 ProgramCompiler._emitFunctionScopedBody (package:dev_compiler/src/kernel/compiler.dart:3809:18)

21 ProgramCompiler._emitSyncFunctionBody. (package:dev_compiler/src/kernel/compiler.dart:3578:17)

22 ProgramCompiler._withLetScope (package:dev_compiler/src/kernel/compiler.dart:2376:25)

23 ProgramCompiler._withCurrentFunction (package:dev_compiler/src/kernel/compiler.dart:3612:18)

24 ProgramCompiler._emitSyncFunctionBody (package:dev_compiler/src/kernel/compiler.dart:3574:17)

25 ProgramCompiler._emitFunction (package:dev_compiler/src/kernel/compiler.dart:3391:11)

26 ProgramCompiler._emitMethodDeclaration (package:dev_compiler/src/kernel/compiler.dart:1970:12)

27 ProgramCompiler._emitClassMethods (package:dev_compiler/src/kernel/compiler.dart:1911:23)

28 ProgramCompiler._emitClassDeclaration (package:dev_compiler/src/kernel/compiler.dart:700:21)

29 ProgramCompiler._emitClass (package:dev_compiler/src/kernel/compiler.dart:622:21)

30 List.forEach (dart:core-patch/growable_array.dart:433:8)

31 ProgramCompiler._emitLibrary (package:dev_compiler/src/kernel/compiler.dart:571:23)

32 List.forEach (dart:core-patch/growable_array.dart)

33 ProgramCompiler.emitModule (package:dev_compiler/src/kernel/compiler.dart:431:15)

34 JavaScriptBundler.compile (package:frontend_server/src/javascript_bundle.dart:152:33)

#35 FrontendCompiler.writeJavascriptBundle (package:frontend_server/frontend_server.dart:665:32) #36 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:573:9) #37 listenAndCompile. (package:frontend_server/frontend_server.dart:1154:11) Finished with error: the Dart compiler exited unexpectedly. Failed to compile application. ` 这个是什么错误啊
chn-sunch commented 2 years ago

buildMyTransitions 是自定义的方法,代码里都有注释。你搜索这个出错的函数就能找到

//修改flutter的源文件,flutter版本更新后需要添加代码 // E:\flutter\packages\flutter\lib\src\cupertino\route.dart // 1.搜索 // @override // Widget buildTransitions(BuildContext context, Animation animation, Animation secondaryAnimation, Widget child) { // return buildPageTransitions(this, context, animation, secondaryAnimation, child); // } // 在上面的代码下添加以下的代码 // @override // Widget buildMyTransitions(BuildContext context, Animation animation, Animation secondaryAnimation, Widget child) { // return buildMyPageTransitions(this, context, animation, secondaryAnimation, child); // }

//创建一个自定义的ios动画,没有任何特效直接切换页面 // static Widget buildMyPageTransitions( // PageRoute route, // BuildContext context, // Animation animation, // Animation secondaryAnimation, // Widget child, // ) { // return _CupertinoBackGestureDetector( // enabledCallback: () => _isPopGestureEnabled(route), // onStartPopGesture: () => _startPopGesture(route), // child: child, // // );

GarthGit commented 2 years ago

https://juejin.cn/post/7059725840958881828