I renamed Warehouse_edit_repository.dart to warehouse_edit_repository.dart
But when I import the file and try to run the program I get this error
- 'WarehouseEditRepository/*1*/' is from 'package:bhoomi/data/repository/warehouse_edit_repository.dart' ('lib/data/repository/warehouse_edit_repository.dart').
- 'WarehouseEditRepository/*2*/' is from 'package:bhoomi/data/repository/Warehouse_edit_repository.dart' ('lib/data/repository/Warehouse_edit_repository.dart').
EditWarehouseBloc(editWarehouseRepository: WarehouseEditRepository())
^
lib/screens/project_screens/purch_mgmt_screens/masters/warehouse_screen/warehouse_edit_screen.dart:178:14: Error: Type argument 'EditWarehouseBloc' doesn't conform to the bound 'BlocBase<S>' of the type variable 'B' on 'BlocConsumer'.
- 'EditWarehouseBloc' is from 'package:bhoomi/bloc/warehouse_view_bloc/warehouse_view_bloc.dart' ('lib/bloc/warehouse_view_bloc/warehouse_view_bloc.dart').
- 'BlocBase' is from 'package:bloc/src/bloc.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/bloc-7.2.1/lib/src/bloc.dart').
Try changing type arguments so that they conform to the bounds.
child: BlocConsumer<EditWarehouseBloc, EditWarehouseState>(
^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_bloc-7.3.3/lib/src/bloc_consumer.dart:61:20: Context: This is the type variable whose bound isn't conformed to.
class BlocConsumer<B extends BlocBase<S>, S> extends StatefulWidget {
^
lib/screens/project_screens/purch_mgmt_screens/masters/warehouse_screen/warehouse_edit_screen.dart:702:58: Error: The argument type 'AddWarehouseModel/*1*/' can't be assigned to the parameter type 'AddWarehouseModel/*2*/'.
- 'AddWarehouseModel/*1*/' is from 'package:bhoomi/data/model/add_warehouse_repository.dart' ('lib/data/model/add_warehouse_repository.dart').
- 'AddWarehouseModel/*2*/' is from 'package:bhoomi/data/model/add_Warehouse_repository.dart' ('lib/data/model/add_Warehouse_repository.dart').
model: model));
^
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\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.
I deleted vs code, tried writing the code again removing imports and importing again used as in imports but doesn't work. Any solutions?
It's possible that you have import statements that are still using the old casing. Try searching for Warehouse_edit_repository and add_Warehouse_repository across your workspace with the Case Sensitivity setting enabled in VS Code, and correct any that are using the wrong casing.
Related
I am facing an issue in flutter for a couple of days
before I close Android Studio everything was working fine with no errors so far, next day I started it with no changes, and it shows me an error message and cannot compile while there is no errors in my code or in anything
../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-1.20.0/lib/src/platform_dialog_action.dart:171:14:
Error: The method 'FlatButton' isn't defined for the class
'PlatformDialogAction'.
'PlatformDialogAction' is from 'package:flutter_platform_widgets/src/platform_dialog_action.dart'
('../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-1.20.0/lib/src/platform_dialog_action.dart').
Try correcting the name to the name of an existing method, or defining
a method named 'FlatButton'.
return FlatButton(
^^^^^^^^^^ ../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-1.20.0/lib/src/platform_button.dart:269:14:
Error: The method 'FlatButton' isn't defined for the class
'PlatformButton'.
'PlatformButton' is from 'package:flutter_platform_widgets/src/platform_button.dart'
('../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-1.20.0/lib/src/platform_button.dart').
Try correcting the name to the name of an existing method, or defining
a method named 'FlatButton'.
return FlatButton(
^^^^^^^^^^ ../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-1.20.0/lib/src/platform_button.dart:302:12:
Error: The method 'RaisedButton' isn't defined for the class
'PlatformButton'.
'PlatformButton' is from 'package:flutter_platform_widgets/src/platform_button.dart'
('../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_platform_widgets-1.20.0/lib/src/platform_button.dart').
Try correcting the name to the name of an existing method, or defining
a method named 'RaisedButton'.
return RaisedButton(
^^^^^^^^^^^^ Target kernel_snapshot failed: Exception
FAILURE: Build failed with an exception.
Where: Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line:
1151
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 10s Exception: Gradle task assembleDebug failed with
exit code 1
I tried to restart, search, and made everything but then nothing worked for me
Does anybody have an idea why is that happening?
thanks in advance
I had lots of reference of '.r' through my flutter app and I replaced all '.r' references with '' empty string and I came to to know that dart files also have been modified and now I get these errors in my debug console. I tried to fix these but seems like re-adding '.r' isn't fixing these problems.
Debug Console:
Launching lib\main.dart on sdk gphone x86 in debug mode...
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/lib/src/path_provider_windows_real.dart:117:66: Error: Member not found: 'roamingAppData'.
final String? appDataRoot = await
getPath(WindowsKnownFolder.roamingAppData);
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/lib/src/path_provider_windows_real.dart:146:60: Error: The method 'rsetGUID' isn't defined for the class 'GUID'.
'GUID' is from 'package:win32/src/guid.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/win32-3.0.1/lib/src/guid.dart').
Try correcting the name to the name of an existing method, or defining a method named 'rsetGUID'.
final Pointer knownFolderID =
calloc().ref.rsetGUID(folderID);
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/lib/src/path_provider_windows_real.dart:235:5: Error: Expected an identifier, but got '.'.
Try inserting an identifier before '.'.
.replaceAll(RegExp(r'[<>:"/\\|?*]'), '_');
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/lib/src/path_provider_windows_real.dart:237:9: Error: Expected an identifier, but got '.'.
Try inserting an identifier before '.'.
.trimRight();
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.1.3/lib/src/path_provider_windows_real.dart:239:5: Error: Expected an identifier, but got '.'.
Try inserting an identifier before '.'.
.replaceAll(RegExp(r'[<>:"/\|?*]'), '_');
FAILURE: Build failed with an exception.
Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159
What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
Process 'command 'C:\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 10s Exception: Gradle task assembleDebug failed with exit code 1 Exited (sigterm)
Building flutter application is giving an error.When i try to build my application the error is occured.
The error is:
**/C:/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.5/lib/src/io_client.dart:88:7: Error: 'kethrow' isn't a type.
kethrow _ClientSocketException(error, request.url);
^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.5/lib/src/io_client.dart:88:15: Error: Expected ';' after this.
kethrow _ClientSocketException(error, request.url);
^^^^^^^^^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.5/lib/src/io_client.dart:88:43: Error: Expected ')' before this.
kethrow _ClientSocketException(error, request.url);
^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.5/lib/src/io_client.dart:48:30: Error: A non-null value must be returned since the return type 'IOStreamedResponse' doesn't allow null.
- 'IOStreamedResponse' is from 'package:http/src/io_streamed_response.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.5/lib/src/io_streamed_response.dart').
package:http/src/io_streamed_response.dart:1
Future<IOStreamedResponse> send(BaseRequest request) async {
^
3
FAILURE: Build failed with an exception.
* Where:
Script 'C:\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1156
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\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 5m 45s
Exception: Gradle task assembleDebug failed with exit code 1**
How to fix this error.Thanks in advance.
I ran into this error a few days ago. It is strangely from the dart file. Mine was 'heethrow'. I corrected it by following the link to the file: /C:/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.5/lib/src/io_client.dart.
How to go about it:
Open location /C:/flutter/.pub-cache/hosted/pub.dartlang.org/http-0.13.5/lib/src/ in Visual Studio Code
inside the src folder, open io_client.dart
(make sure you're in the io_client.dart inside the src folder)
Once you're in io_client.dart, locate the place with the error: in your case, it says 88:7 that is, line 88 column 7. Scroll to line number 88 and change 'kethrow' to 'throw'
the errors in the other places as marked in the image below should be corrected and your io_client.dart should be error free.
Note: other files outside io_client.dart might mark red indicating errors but never mind. Just save your changes in the io_client.dart file and close the file. Once closed
Open your project again and run flutter clean in the terminal.
next run flutter pub get
next run flutter pub upgrade
run your app again, everything should work fine.
But I'd advise you don't always go into those files to edit anything. I did that because I've tried every possible solution and needed to deliver my work. I even installed Visual Studio for Windows as suggested by flutter doctor, but that was not the solution.
run code after one year then face this issue
when flutter run command then command response error
how can remove these error
also run command flutter create -t app
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_math_fork-0.3.3+1/lib/src/widgets/selectable.dart:407:7: Error: The non-abstract class 'InternalSelectableMathState' is missing implementations for these members:
TextSelectionDelegate.copySelection
TextSelectionDelegate.cutSelection
TextSelectionDelegate.pasteText
TextSelectionDelegate.selectAll
Try to either
provide an implementation,
inherit an implementation from a superclass or mixin,
mark the class as abstract, or
provide a 'noSuchMethod' implementation.
class InternalSelectableMathState extends State
^^^^^^^^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/services/text_input.dart:1034:8: Context: 'TextSelectionDelegate.copySelection' is defined here.
void copySelection(SelectionChangedCause cause);
^^^^^^^^^^^^^
/C:/src/flutter/packages/flutter/lib/src/services/text_input.dart:1014:8: Context: 'TextSelectionDelegate.cutSelection' is defined here.
Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
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 25s
Running Gradle task 'assembleDebug'... 26.1s
Exception: Gradle task assembleDebug failed with exit code 1
Well, I hate bringing you bad news, but Flutter received a LOT of updates. You might want to either
Use an older version of Flutter (see: THIS LINK)
Refactor your code to adhere to the changes
while taking build some 3rd party packages like flutter_form_builder,flutter_chips_inputalso flutter services packages throws error,that leads to build failure ,I think that is package version crash problem.... but, i can't solve this problem....
How can i solve it?
below is error code.
thank you.
ERROR CODE
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_form_builder-3.7.2/lib/src/fields/form_builder_range_slider.dart:21:9: Error: Type 'RangeSemanticFormatterCallback' not found.
final RangeSemanticFormatterCallback semanticFormatterCallback;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_chips_input-1.6.1/lib/src/chips_input.dart:62:7: Error: The non-abstract class 'ChipsInputState' is missing implementations for these members:
- TextInputClient.currentAutofillScope
- TextInputClient.currentTextEditingValue
- TextInputClient.performPrivateCommand
- TextInputClient.showAutocorrectionPromptRect
Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class ChipsInputState<T> extends State<ChipsInput<T>>
^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:805:22: Context: 'TextInputClient.currentAutofillScope' is defined here.
AutofillScope? get currentAutofillScope;
^^^^^^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:793:25: Context: 'TextInputClient.currentTextEditingValue' is defined here.
TextEditingValue? get currentTextEditingValue;
^^^^^^^^^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:814:8: Context: 'TextInputClient.performPrivateCommand' is defined here.
void performPrivateCommand(String action, Map<String, dynamic> data);
^^^^^^^^^^^^^^^^^^^^^
../flutter/packages/flutter/lib/src/services/text_input.dart:823:8: Context: 'TextInputClient.showAutocorrectionPromptRect' is defined here.
void showAutocorrectionPromptRect(int start, int end);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:273:8: Error: The method 'FlushbarRoute.install' has more required arguments than those of overridden method 'OverlayRoute.install'.
void install(OverlayEntry insertionPoint) {
^
../flutter/packages/flutter/lib/src/widgets/routes.dart:46:8: Context: This is the overridden method ('install').
void install() {
^
../flutter/.pub-cache/hosted/pub.dartlang.org/flutter_form_builder-3.7.2/lib/src/fields/form_builder_range_slider.dart:21:9: Error: 'RangeSemanticFormatterCallback' isn't a type.
final RangeSemanticFormatterCallback semanticFormatterCallback;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../flutter/.pub-cache/hosted/pub.dartlang.org/flushbar-1.9.1/lib/flushbar_route.dart:281:18: Error: Too many positional arguments: 0 allowed, but 1 found.
Try removing the extra positional arguments.
super.install(insertionPoint);
^
FAILURE: Build failed with an exception.
* Where:
Script '/Users/gabriel/Git/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 900
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/gabriel/Git/flutter/bin/flutter'' 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 32s
############## Solution Things ###############
That situation is caused by selecting wrong package version....
so, i try to change version of "flutter_form_builder"!
and i solved this problem!
This is due to incompatibilty of flutter_form_builder with your version of flutter. As advised on the github page of flutter_form_builder, you need to choose the plugin according to your version of flutter.
From the github page:
For Flutter 1.17.x, use version 3.12.x
For Flutter 1.20.x, use version 3.13.x
For Flutter 1.22.X, use version 3.14.x
You have to type the correct version number in pubspec.yaml
Remove pubspec.lock, remove podfile.lock, and run
cd ios && pod repo update && cd .. && flutter clean && flutter pub get