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

Your project is not running except it is showing following errors #98

Open
arslankaleem7229 opened this issue May 19, 2021 · 1 comment

Comments

@arslankaleem7229
Copy link

arslankaleem7229 commented May 19, 2021

lib/bloc_provider.dart:51:18: Error: The method 'inheritFromWidgetOfExactType' isn't defined for 
the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
        (context.inheritFromWidgetOfExactType(BlocProvider) as BlocProvider);
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/bloc_provider.dart:60:18: Error: The method 'inheritFromWidgetOfExactType' isn't defined for 
the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/C:/src/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
        (context.inheritFromWidgetOfExactType(BlocProvider) as BlocProvider);
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.2.0/lib/src/builder.dart:326:49: Error: The getter 'children' isn't defined for the class 'InlineSpan'.
 - 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.
        List<TextSpan> children = previous.text.children != null
                                                ^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.2.0/lib/src/builder.dart:327:41: Error: The getter 'children' isn't defined for the class 'InlineSpan'.
 - 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.
          ? new List.from(previous.text.children)
                                        ^^^^^^^^

                                                                        
FAILURE: Build failed with an exception.

* Where:
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 40s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                        44.6s
Exception: Gradle task assembleDebug failed with exit code 1
PS D:\Workspace\Testing\HistoryOfEverything\app>

@goodwillforyou
Copy link

replace this code context.inheritFromWidgetOfExactType(BlocProvider) as BlocProvider to context.getElementForInheritedWidgetOfExactType<BlocProvider>().widget as BlocProvider; running successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants