Flutter english_words unused_import error - flutter

I'm new to flutter and I'm getting the above error:
Unused import: package:english_words/english_words.dart
I don't understand why I am getting an error.
What should I do?

This is referring you didn't use the package. You can remove the import (line 1) if you dont use the package on this file. Or you can ignore it for now.
You can find more about linter-rules and flutter_lints.

Related

Flutter Throw Errors When opening AndroidManifest.xml

../android/app/source/main/AndroidManifest.xml
Unresolved class '{applicationName}'
Cannot resolve symbol '#mipmap/ic_launcher'
MainActivity must extend android.app.Activity
Cannot resolve symbol '#style/LaunchTheme'
Cannot resolve symbol '#style/NormalTheme'
I created new project then I checked AndroidManifest.xml file and it throw couple of error.
My flutter looks okay on flutter doctor.
Any ideas on how to resolve?
Thanks!
You don't worry about these errors, just run your app, It should work fine!!!
Many one got this error but it is just an error of IDEs.so don't worry and run your app you will not get any error.

Flutter getx package - Error: No named parameter with the name 'findProxy'

When I run the project I get an error like this, flutter clean and then flutter pub get tried but no result. Thanks for read, please help..
==>
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/get-4.6.0/lib/get_connect/http/src/http.dart:60:11: Error: No named parameter with the name 'findProxy'.
findProxy: findProxy,
^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/get-4.6.0/lib/get_connect/http/src/http/html/http_request_html.dart:13:3: Context: Found this candidate, but the arguments don't match.
HttpRequestImpl({
^^^^^^^^^^^^^^^
Most probably, this is caused because the package is not compatible with the current version of flutter or vice versa.
Try updating the package version from:
https://pub.dev/packages/http
Also, try importing the package using following command:
import 'package:http/http.dart' as http;
and then use functions as follows:
http.post()

Flutter Redux Navigation library import error

I have been developing application and one of the libraries I have used was Flutter Redux Navigation. Everything was working fine, until recently, when I started getting following error
../../lib/src/navigation_middleware.dart:3:1: Error: 'NavigationDestination' is imported from both 'package:flutter/src/material/navigation_bar.dart' and 'package:flutter_redux_navigation/src/navigation_destination.dart'.
import 'package:flutter_redux_navigation/src/navigation_destination.dart';
^^^^^^^^^^^^^^^^^^^^^
../../lib/src/navigation_middleware.dart:35:26: Error: 'NavigationDestination' is imported from both 'package:flutter/src/material/navigation_bar.dart' and 'package:flutter_redux_navigation/src/navigation_destination.dart'.
this._setState(NavigationDestination(
^^^^^^^^^^^^^^^^^^^^^
../../lib/src/navigation_middleware.dart:55:26: Error: 'NavigationDestination' is imported from both 'package:flutter/src/material/navigation_bar.dart' and 'package:flutter_redux_navigation/src/navigation_destination.dart'.
this._setState(NavigationDestination(
I even tried to copy example project from their git, and got exactly same error. This is something in library, or perhaps some settings of my IDE? Please let me know if anyone encountered this error.
The problem was that I have upgraded Flutter version from 2.5.1 to 2.8.0. The newest Flutter version contains upgraded Material library, which contains the method called NavigationDestination. Thus both, the library and Material design have the same name of the class, of course, resulting in error.

myfatoorah_flutter import package fails build

I have added myfatoorah_flutter package version 1.0.7 and in file I have imported the package as import 'package:myfatoorah_flutter/myfatoorah_flutter.dart'; it fails the build and gives the following error
../../../Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/myfatoorah_flutter-1.0.7/lib/myfatoorah_flutter.dart:609:31: Error: The argument type 'bool Function(bool)' can't be assigned to the parameter type 'bool Function(bool, RouteInfo)'.
- 'RouteInfo' is from 'package:back_button_interceptor/src/back_button_interceptor.dart'
('../../../Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/back_button_interceptor-4.3.1/lib/src/back_button_interceptor.dart').
BackButtonInterceptor.add(myInterceptor);
I have tried following solutions and none of them worked:
changed version of myfatoorah_flutter
switched between channels dev/stable
upgraded flutter sdk
settings.gradle removed and added again
when I remove import line, it works fine, help is required so that I can integrate the payment methods
I am also getting the same error as I tried this way and worked for me.
change version of back_button_interceptor to back_button_interceptor: 4.0.2 in myfatoorah_flutter's pubspec.ymal.

Flutter "import framework:dart" throws error

my Flutter dart script requires 'import framework:dart'. But Visual Studio Code's "Problems Tab" indicates this error:
Target of URI doesn't exist: 'framework:dart'.
Try creating the file referenced by the URI, or Try using a URI for a file that does exist.
Needing suggestions to remedy this.
Thanks!
If you use the flutter framework for dart, the import must be:
import 'package:flutter/material.dart';
if you want to use the Cupertino-style (==iOS theme) than you have to make following import:
import 'package:flutter/cupertino.dart';
If you have Flutter installed, this imports should work.
Because framework.dart is in the widgets.dart library packages, I think you need to import the widgets.dart library.
import 'package:flutter/widgets.dart';
For the usage, you can read the docs here.
I hope it will help.