When I run flutter I get the error as below, it says package doesn't exist, named parameter not defined like error. Even though I downgraded and upgraded flutter it is showing the same error please look and tell whether if any fixes available.
The plugins `firebase_auth, flutter_country_picker, geocoder` use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib/main_dev.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
Error: Couldn't resolve the package 'timekeeper' in 'package:timekeeper/support/colors.dart'.
Error: Couldn't resolve the package 'timekeeper' in 'package:timekeeper/support/strings.dart'.
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fancy_dialog-1.0.4/lib/fancy_dialog.dart:6:8: Error: Not found: 'package:timekeeper/support/colors.dart'
import 'package:timekeeper/support/colors.dart';
^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fancy_dialog-1.0.4/lib/fancy_dialog.dart:7:8: Error: Not found: 'package:timekeeper/support/strings.dart'
import 'package:timekeeper/support/strings.dart';
^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart:4:8: Error: Not found: 'package:timekeeper/support/colors.dart'
import 'package:timekeeper/support/colors.dart';
^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/fancy_dialog-1.0.4/lib/fancy_dialog.dart:29:24: Error: Undefined name 'MyColors'.
this.okColor = MyColors.kPrimaryColor,
^^^^^^^^
lib/service/push_notification_service.dart:30:26: Error: The getter 'Messaging' isn't defined for the class 'PushNotificationService'.
- 'PushNotificationService' is from 'package:spaid/service/push_notification_service.dart' ('lib/service/push_notification_service.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Messaging'.
final _messaging = Messaging.instance;
^^^^^^^^^
lib/service/push_notification_service.dart:47:10: Error: The method 'configure' isn't defined for the class 'FirebaseMessaging'.
- 'FirebaseMessaging' is from 'package:firebase_messaging/firebase_messaging.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging-8.0.0-dev.15/lib/firebase_messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'configure'.
_fcm.configure(
^^^^^^^^^
lib/ui/add_event_screen/add_event_screen_ui.dart:2654:29: Error: No named parameter with the name 'onClick'.
onClick: (value) {
^^^^^^^
../../Documents/flutter/packages/flutter/lib/src/material/time_picker.dart:1801:9: Context: Found this candidate, but the arguments don't match.
const TimePickerDialog({
^^^^^^^^^^^^^^^^
lib/ui/add_event_screen/add_event_screen_ui.dart:3702:31: Error: No named parameter with the name 'onClick'.
onClick: (value) {
^^^^^^^
../../Documents/flutter/packages/flutter/lib/src/material/time_picker.dart:1801:9: Context: Found this candidate, but the arguments don't match.
const TimePickerDialog({
^^^^^^^^^^^^^^^^
lib/ui/add_event_screen/add_event_screen_ui.dart:3901:31: Error: No named parameter with the name 'onClick'.
onClick: (value) {
^^^^^^^
../../Documents/flutter/packages/flutter/lib/src/material/time_picker.dart:1801:9: Context: Found this candidate, but the arguments don't match.
const TimePickerDialog({
^^^^^^^^^^^^^^^^
lib/ui/coaches_corner/home_Screen_provider.dart:179:31: Error: Can't declare 'GetDrillCategoryRequest' because it was already used in this scope.
GetDrillCategoryRequest GetDrillCategoryRequest =
^^^^^^^^^^^^^^^^^^^^^^^
lib/ui/coaches_corner/home_Screen_provider.dart:179:7: Context: Previous use of 'GetDrillCategoryRequest'.
GetDrillCategoryRequest GetDrillCategoryRequest =
^^^^^^^^^^^^^^^^^^^^^^^
lib/ui/coaches_corner/home_Screen_provider.dart:195:7: Error: 'GetDrillPlanRequest' isn't a type.
GetDrillPlanRequest GetDrillPlanRequest = GetDrillPlanRequest();
^^^^^^^^^^^^^^^^^^^
lib/ui/coaches_corner/home_Screen_provider.dart:195:27: Error: Can't declare 'GetDrillPlanRequest' because it was already used in this scope.
GetDrillPlanRequest GetDrillPlanRequest = GetDrillPlanRequest();
^^^^^^^^^^^^^^^^^^^
lib/ui/coaches_corner/home_Screen_provider.dart:195:7: Context: Previous use of 'GetDrillPlanRequest'.
GetDrillPlanRequest GetDrillPlanRequest = GetDrillPlanRequest();
^^^^^^^^^^^^^^^^^^^
lib/ui/coaches_corner/home_Screen_provider.dart:195:49: Error: The method 'GetDrillPlanRequest' isn't defined for the class 'HomeScreenProvider'.
- 'HomeScreenProvider' is from 'package:spaid/ui/coaches_corner/home_Screen_provider.dart' ('lib/ui/coaches_corner/home_Screen_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'GetDrillPlanRequest'.
GetDrillPlanRequest GetDrillPlanRequest = GetDrillPlanRequest();
^^^^^^^^^^^^^^^^^^^
lib/ui/coaches_corner/home_Screen_provider.dart:196:7: Error: The getter 'GetDrillPlanRequest' isn't defined for the class 'HomeScreenProvider'.
- 'HomeScreenProvider' is from 'package:spaid/ui/coaches_corner/home_Screen_provider.dart' ('lib/ui/coaches_corner/home_Screen_provider.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'GetDrillPlanRequest'.
GetDrillPlanRequest.iDNo =
^^^^^^^^^^^^^^^^^^^
lib/ui/coaches_corner/home_Screen_provider.dart:200:49: Error: The getter 'GetDrillPlanRequest' isn't defined for the class 'HomeScreenProvider'.
- 'HomeScreenProvider' is from 'package:spaid/ui/coaches_corner/home_Screen_provider.dart' ('lib/ui/coaches_corner/home_Screen_provider.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'GetDrillPlanRequest'.
.post(Endpoints.getAllDrillUrl, data: GetDrillPlanRequest)
^^^^^^^^^^^^^^^^^^^
lib/ui/coaches_corner/home_Screen_provider.dart:219:26: Error: Can't declare 'GetDrillPlanResponse' because it was already used in this scope.
GetDrillPlanResponse GetDrillPlanResponse =
^^^^^^^^^^^^^^^^^^^^
lib/ui/coaches_corner/home_Screen_provider.dart:219:5: Context: Previous use of 'GetDrillPlanResponse'.
GetDrillPlanResponse GetDrillPlanResponse =
^^^^^^^^^^^^^^^^^^^^
lib/ui/coaches_corner/home_Screen_provider.dart:221:28: Error: A value of type 'Type' can't be assigned to a variable of type 'GetDrillPlanResponse'.
- 'Type' is from 'dart:core'.
- 'GetDrillPlanResponse' is from 'package:spaid/model/response/getDrill_Plan_response/getDrill_plan_response.dart' ('lib/model/response/getDrill_Plan_response/getDrill_plan_response.dart').
getDrillPlanResponse = GetDrillPlanResponse;
^
lib/ui/coaches_corner/home_Screen_ui.dart:1196:49: Error: No named parameter with the name 'onClick'.
onClick: (value) {
^^^^^^^
../../Documents/flutter/packages/flutter/lib/src/material/time_picker.dart:1801:9: Context: Found this candidate, but the arguments don't match.
const TimePickerDialog({
^^^^^^^^^^^^^^^^
lib/ui/coaches_corner/home_Screen_ui.dart:1530:45: Error: No named parameter with the name 'onClick'.
onClick: (value) {
^^^^^^^
../../Documents/flutter/packages/flutter/lib/src/material/time_picker.dart:1801:9: Context: Found this candidate, but the arguments don't match.
const TimePickerDialog({
^^^^^^^^^^^^^^^^
lib/ui/edit_event_screen/edit_event_screen_ui.dart:2666:29: Error: No named parameter with the name 'onClick'.
onClick: (value) {
^^^^^^^
../../Documents/flutter/packages/flutter/lib/src/material/time_picker.dart:1801:9: Context: Found this candidate, but the arguments don't match.
const TimePickerDialog({
^^^^^^^^^^^^^^^^
lib/ui/edit_event_screen/edit_event_screen_ui.dart:3774:31: Error: No named parameter with the name 'onClick'.
onClick: (value) {
^^^^^^^
../../Documents/flutter/packages/flutter/lib/src/material/time_picker.dart:1801:9: Context: Found this candidate, but the arguments don't match.
const TimePickerDialog({
^^^^^^^^^^^^^^^^
lib/ui/edit_event_screen/edit_event_screen_ui.dart:3968:31: Error: No named parameter with the name 'onClick'.
onClick: (value) {
^^^^^^^
../../Documents/flutter/packages/flutter/lib/src/material/time_picker.dart:1801:9: Context: Found this candidate, but the arguments don't match.
const TimePickerDialog({
^^^^^^^^^^^^^^^^
lib/ui/home_screen/home_menu_screen/notification_preferences.dart:406:57: Error: No named parameter with the name 'onTap'.
onTap: (value) {
^^^^^
../../Documents/flutter/packages/flutter/lib/src/material/time_picker.dart:1801:9: Context: Found this candidate, but the arguments don't match.
const TimePickerDialog({
^^^^^^^^^^^^^^^^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.12/lib/src/link.dart:213:30: Error: The value 'null' can't be assigned to the parameter type 'BuildContext' because 'BuildContext' is not nullable.
- 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../Documents/flutter/packages/flutter/lib/src/widgets/framework.dart').
pushRouteNameToFramework(null, routeName);
^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/lite_rolling_switch-1.0.0/lib/lite_rolling_switch.dart:97:20: Warning: Operand of null-aware operation '?.' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../Documents/flutter/packages/flutter/lib/src/widgets/binding.dart').
WidgetsBinding.instance?.addPostFrameCallback((_) {
^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_below-1.0.3/lib/dropdown_below.dart:479:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../Documents/flutter/packages/flutter/lib/src/widgets/binding.dart').
WidgetsBinding.instance!.addObserver(this);
^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_below-1.0.3/lib/dropdown_below.dart:484:20: Warning: Operand of null-aware operation '!' has type 'WidgetsBinding' which excludes null.
- 'WidgetsBinding' is from 'package:flutter/src/widgets/binding.dart' ('../../Documents/flutter/packages/flutter/lib/src/widgets/binding.dart').
WidgetsBinding.instance!.removeObserver(this);
^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_button2-1.8.0/lib/dropdown_button2.dart:77:14: Error: The method 'clampDouble' isn't defined for the class '_DropdownMenuPainter'.
- '_DropdownMenuPainter' is from 'package:dropdown_button2/dropdown_button2.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_button2-1.8.0/lib/dropdown_button2.dart').
Try correcting the name to the name of an existing method, or defining a method named 'clampDouble'.
begin: clampDouble(top.begin! + itemHeight,
^^^^^^^^^^^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_button2-1.8.0/lib/dropdown_button2.dart:182:9: Error: The method 'clampDouble' isn't defined for the class '_DropdownMenuItemButtonState<T>'.
- '_DropdownMenuItemButtonState' is from 'package:dropdown_button2/dropdown_button2.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_button2-1.8.0/lib/dropdown_button2.dart').
Try correcting the name to the name of an existing method, or defining a method named 'clampDouble'.
clampDouble(0.5 + (widget.itemIndex + 1) * unit, 0.0, 1.0);
^^^^^^^^^^^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_button2-1.8.0/lib/dropdown_button2.dart:183:24: Error: The method 'clampDouble' isn't defined for the class '_DropdownMenuItemButtonState<T>'.
- '_DropdownMenuItemButtonState' is from 'package:dropdown_button2/dropdown_button2.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_button2-1.8.0/lib/dropdown_button2.dart').
Try correcting the name to the name of an existing method, or defining a method named 'clampDouble'.
final double end = clampDouble(start + 1.5 * unit, 0.0, 1.0);
^^^^^^^^^^^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_button2-1.8.0/lib/dropdown_button2.dart:484:16: Error: The method 'clampDouble' isn't defined for the class '_DropdownMenuRouteLayout<T>'.
- '_DropdownMenuRouteLayout' is from 'package:dropdown_button2/dropdown_button2.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_button2-1.8.0/lib/dropdown_button2.dart').
Try correcting the name to the name of an existing method, or defining a method named 'clampDouble'.
left = clampDouble(buttonRect.right + offset.dx, 0.0, size.width) -
^^^^^^^^^^^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_button2-1.8.0/lib/dropdown_button2.dart:488:16: Error: The method 'clampDouble' isn't defined for the class '_DropdownMenuRouteLayout<T>'.
- '_DropdownMenuRouteLayout' is from 'package:dropdown_button2/dropdown_button2.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_button2-1.8.0/lib/dropdown_button2.dart').
Try correcting the name to the name of an existing method, or defining a method named 'clampDouble'.
left = clampDouble(
^^^^^^^^^^^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart:52:21: Error: The getter 'MyColors' isn't defined for the class 'TextDropdownFormField'.
- 'TextDropdownFormField' is from 'package:dropdown_plus/src/text-dropdown.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'MyColors'.
? MyColors.errorColor
^^^^^^^^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart:53:21: Error: The getter 'MyColors' isn't defined for the class 'TextDropdownFormField'.
- 'TextDropdownFormField' is from 'package:dropdown_plus/src/text-dropdown.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'MyColors'.
: MyColors.black),
^^^^^^^^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart:54:22: Error: The getter 'MyColors' isn't defined for the class 'TextDropdownFormField'.
- 'TextDropdownFormField' is from 'package:dropdown_plus/src/text-dropdown.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'MyColors'.
fillColor: MyColors.white,
^^^^^^^^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart:57:24: Error: The getter 'MyColors' isn't defined for the class 'TextDropdownFormField'.
- 'TextDropdownFormField' is from 'package:dropdown_plus/src/text-dropdown.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'MyColors'.
color: MyColors.borderColor),
^^^^^^^^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart:73:24: Error: The getter 'MyColors' isn't defined for the class 'TextDropdownFormField'.
- 'TextDropdownFormField' is from 'package:dropdown_plus/src/text-dropdown.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'MyColors'.
color: MyColors
^^^^^^^^
../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart:84:24: Error: The getter 'MyColors' isn't defined for the class 'TextDropdownFormField'.
- 'TextDropdownFormField' is from 'package:dropdown_plus/src/text-dropdown.dart' ('../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/dropdown_plus-0.0.9/lib/src/text-dropdown.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'MyColors'.
color: MyColors
^^^^^^^^
Unhandled exception:
NoSuchMethodError: The getter 'path' was called on null.
Receiver: null
Tried calling: path
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:38:5)
#1 JavaScriptBundler.compile (file:///opt/s/w/ir/x/w/sdk/pkg/frontend_server/lib/src/javascript_bundle.dart:165:65)
<asynchronous suspension>
#2 FrontendCompiler.writeJavascriptBundle (file:///opt/s/w/ir/x/w/sdk/pkg/frontend_server/lib/frontend_server.dart:694:32)
<asynchronous suspension>
#3 FrontendCompiler.compile (file:///opt/s/w/ir/x/w/sdk/pkg/frontend_server/lib/frontend_server.dart:602:9)
<asynchronous suspension>
#4 listenAndCompile.<anonymous closure> (file:///opt/s/w/ir/x/w/sdk/pkg/frontend_server/lib/frontend_server.dart:1199:11)
<asynchronous suspension>
Finished with error: the Dart compiler exited unexpectedly.
Failed to compile application.
Related
Problem
I have been successfully using firebase firestore in my current app for months. However, recently when experimenting with firebase realtime, when I attempt to build on either physical or emulated iphone or android, the build fails.
I've tried usual - flutter clean, multiple emulators, reboot everything, same errors.
Strangely, when building with a pre-realtime version, the errors persist - none of my previous commits work anymore!
For sanity check, I created a new flutter application to see if anything was working - yes, a new clean flutter app works.
Any advice?
Error message when trying to build for iPhone:
Xcode's output:
↳
Writing result bundle at path:
/var/folders/qp/f66_vfps3839pj76pb3d_9fr0000gn/T/flutter_tools.u3vUGq/flutter_ios_build_temp_di
r4QxZbF/temporary_xcresult_bundle
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart:21:38: Error: Type
'FutureOr' not found.
typedef EventHandler<Event, State> = FutureOr<void> Function(
^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_base.dart:23:3: Error:
Type 'FutureOr' not found.
FutureOr<void> close();
^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:108:44:
Error: Type 'StreamTransformerBase' not found.
class _FlatMapStreamTransformer<T> extends StreamTransformerBase<Stream<T>, T> {
^^^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart:53:28: Error:
Couldn't find constructor 'StreamController'.
final _eventController = StreamController<Event>.broadcast();
^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart:54:27: Error:
'StreamSubscription' isn't a type.
final _subscriptions = <StreamSubscription<dynamic>>[];
^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_base.dart:61:57: Error:
Couldn't find constructor 'StreamController.broadcast'.
late final _stateController = StreamController<State>.broadcast();
^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:3:24:
Error: Undefined name 'runZoned'.
const _asyncRunZoned = runZoned;
^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/emitter.dart:68:22: Error:
Method not found: 'Completer'.
final _completer = Completer<void>();
^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/emitter.dart:69:25: Error:
'FutureOr' isn't a type.
final _disposables = <FutureOr<void> Function()>[];
^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart:196:48: Error:
Couldn't find constructor 'StreamController.broadcast'.
final controller = StreamController<E>.broadcast(
^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart:269:57: Error: The
method 'cancel' isn't defined for the class 'Object?'.
- 'Object' is from 'dart:core'.
Try correcting the name to the name of an existing method, or defining a method named 'cancel'.
await Future.wait<void>(_subscriptions.map((s) => s.cancel()));
^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:37:40:
Error: Undefined name 'Zone'.
static BlocOverrides? get current => Zone.current[_token] as BlocOverrides?;
^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:103:33:
Error: The argument type '_FlatMapStreamTransformer<dynamic>' can't be assigned to the parameter
type 'StreamTransformer<Stream<dynamic>, dynamic>'.
- '_FlatMapStreamTransformer' is from 'package:bloc/src/bloc.dart'
('../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart').
- 'StreamTransformer' is from 'dart:async'.
- 'Stream' is from 'dart:async'.
.transform<dynamic>(const _FlatMapStreamTransformer<dynamic>());
^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:113:44:
Error: Couldn't find constructor 'StreamController.broadcast'.
final controller = StreamController<T>.broadcast(sync: true);
^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:116:30:
Error: 'StreamSubscription' isn't a type.
final subscriptions = <StreamSubscription<dynamic>>[];
^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:145:28:
Error: The argument type 'List<dynamic>' can't be assigned to the parameter type
'Iterable<Future<dynamic>>'.
- 'List' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return Future.wait(cancels).then((_) {});
^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/emitter.dart:80:23: Error:
The method 'Completer' isn't defined for the class '_Emitter<State>'.
- '_Emitter' is from 'package:bloc/src/bloc.dart'
('../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart').
Try correcting the name to the name of an existing method, or defining a method named
'Completer'.
final completer = Completer<void>();
^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/emitter.dart:88:23: Error:
The argument type 'List<dynamic>' can't be assigned to the parameter type
'Iterable<Future<dynamic>>'.
- 'List' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return Future.any([future, completer.future]).whenComplete(() {
^
Failed to package /Users/stew/Repos/pet_project.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
Result bundle written to path:
/var/folders/qp/f66_vfps3839pj76pb3d_9fr0000gn/T/flutter_tools.u3vUGq/flutter_ios_build_temp_di
r4QxZbF/temporary_xcresult_bundle
Could not build the application for the simulator.
Error launching application on iPhone SE (3rd generation).
Error message when trying to build for Android:
Launching lib/main_development.dart on Android SDK built for x86 in debug mode...
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart:21:38: Error: Type 'FutureOr' not found.
typedef EventHandler<Event, State> = FutureOr<void> Function(
^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_base.dart:23:3: Error: Type 'FutureOr' not found.
FutureOr<void> close();
^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:108:44: Error: Type 'StreamTransformerBase' not found.
class _FlatMapStreamTransformer<T> extends StreamTransformerBase<Stream<T>, T> {
^^^^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart:53:28: Error: Couldn't find constructor 'StreamController'.
final _eventController = StreamController<Event>.broadcast();
^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart:54:27: Error: 'StreamSubscription' isn't a type.
final _subscriptions = <StreamSubscription<dynamic>>[];
^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_base.dart:61:57: Error: Couldn't find constructor 'StreamController.broadcast'.
late final _stateController = StreamController<State>.broadcast();
^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:3:24: Error: Undefined name 'runZoned'.
const _asyncRunZoned = runZoned;
^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/emitter.dart:68:22: Error: Method not found: 'Completer'.
final _completer = Completer<void>();
^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/emitter.dart:69:25: Error: 'FutureOr' isn't a type.
final _disposables = <FutureOr<void> Function()>[];
^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart:196:48: Error: Couldn't find constructor 'StreamController.broadcast'.
final controller = StreamController<E>.broadcast(
^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart:269:57: Error: The method 'cancel' isn't defined for the class 'Object?'.
- 'Object' is from 'dart:core'.
Try correcting the name to the name of an existing method, or defining a method named 'cancel'.
await Future.wait<void>(_subscriptions.map((s) => s.cancel()));
^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:37:40: Error: Undefined name 'Zone'.
static BlocOverrides? get current => Zone.current[_token] as BlocOverrides?;
^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:103:33: Error: The argument type '_FlatMapStreamTransformer<dynamic>' can't be assigned to the parameter type 'StreamTransformer<Stream<dynamic>, dynamic>'.
- '_FlatMapStreamTransformer' is from 'package:bloc/src/bloc.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart').
- 'StreamTransformer' is from 'dart:async'.
- 'Stream' is from 'dart:async'.
.transform<dynamic>(const _FlatMapStreamTransformer<dynamic>());
^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:113:44: Error: Couldn't find constructor 'StreamController.broadcast'.
final controller = StreamController<T>.broadcast(sync: true);
^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:116:30: Error: 'StreamSubscription' isn't a type.
final subscriptions = <StreamSubscription<dynamic>>[];
^^^^^^^^^^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc_overrides.dart:145:28: Error: The argument type 'List<dynamic>' can't be assigned to the parameter type 'Iterable<Future<dynamic>>'.
- 'List' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return Future.wait(cancels).then((_) {});
^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/emitter.dart:80:23: Error: The method 'Completer' isn't defined for the class '_Emitter<State>'.
- '_Emitter' is from 'package:bloc/src/bloc.dart' ('../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/bloc.dart').
Try correcting the name to the name of an existing method, or defining a method named 'Completer'.
final completer = Completer<void>();
^^^^^^^^^
../../flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.0.3/lib/src/emitter.dart:88:23: Error: The argument type 'List<dynamic>' can't be assigned to the parameter type 'Iterable<Future<dynamic>>'.
- 'List' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
- 'Future' is from 'dart:async'.
return Future.any([future, completer.future]).whenComplete(() {
^
FAILURE: Build failed with an exception.
* Where:
Script '/Users/stew/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1156
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDevelopmentDebug'.
> Process 'command '/Users/stew/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 17s
Running Gradle task 'assembleDevelopmentDebug'... 19.2s
Exception: Gradle task assembleDevelopmentDebug failed with exit code 1
I found the answer here: Update flutter dependencies in /.pub-cache
flutter pub cache repair
AppData/Local/Pub/Cache/hosted/pub.dartlang.org/syncfusion_flutter_gauges-19.4.54/lib/src/radial_gauge/pointers/marker_pointer_renderer.dart:631:34: Error: The getter 'secondaryContainer' isn't defined for the class 'ColorScheme'.
'ColorScheme' is from 'package:flutter/src/material/color_scheme.dart' ('../../../../fvm/default/packages/flutter/lib/src/material/color_scheme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'secondaryContainer'.
_themeData.colorScheme.secondaryContainer.withOpacity(0.8)
^^^^^^^^^^^^^^^^^^
I am getting this error when i ran a flutter project from github... i tried everything.
i tried many command but no luck
Try correcting the name to the name of an existing getter, or defining a getter or field named 'headline'.
theme.primaryTextTheme.headline;
^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-0.3.4/lib/src/flutter/appbar.dart:338:45: Error: The getter 'body1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'body1'.
TextStyle sideStyle = widget.textTheme?.body1 ??
^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-0.3.4/lib/src/flutter/appbar.dart:339:32: Error: The getter 'body1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'body1'.
appBarTheme.textTheme?.body1 ??
^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-0.3.4/lib/src/flutter/appbar.dart:340:32: Error: The getter 'body1' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'body1'.
theme.primaryTextTheme.body1;
Launching lib\main.dart on Edge in debug mode...
lib\main.dart:1
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-0.3.4/lib/src/flutter/appbar.dart:322:57: Error: No named parameter with the name 'nullOk'.
final ScaffoldState scaffold = Scaffold.of(context, nullOk: true);
^^^^^^
/C:/flutter/packages/flutter/lib/src/material/scaffold.dart:1769:24: Context: Found this candidate, but the arguments don't match.
static ScaffoldState of(BuildContext context) {
^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-0.3.4/lib/src/flutter/appbar.dart:335:47: Error: The getter 'headline' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'headline'.
TextStyle centerStyle = widget.textTheme?.headline ??
^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-0.3.4/lib/src/flutter/appbar.dart:336:32: Error: The getter 'headline' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/flutter/packages/flutter/lib/src/material/text_theme.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'headline'.
appBarTheme.textTheme?.headline ??
^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/velocity_x-0.3.4/lib/src/flutter/appbar.dart:337:32: Error: The getter 'headline' isn't defined for the class 'TextTheme'.
- 'TextTheme' is from 'package:flutter/src/material/text_theme.dart' ('/C:/flutter/packages/flutter/lib/src/material/text_theme.dart').
^^^^^
Failed to compile app.
Exited (sigterm)
You are attempting to use code written for an older version of flutter, that is the problem, you need to either downgrade your SDK or update the code.
Updating the code should be simple enough, most changes are very intuitive and IntelliSense can autocomplete what you don't know, however it seems like the original code used the getflutter package, which has since been discontinued and now is getWidget, I've never used neither, but the migration shouldn't be too hard.
If you are interested in updating the code here are the main changes I can see:
The getter 'body1' isn't defined for the class 'TextTheme'.
just change body1 to bodyText1
The getter 'headline' isn't defined for the class 'TextTheme'.
just change headline to headline1
And if what you want to do is downgrade the SDK, which might be the better option, simply download an older version from here
I already using flutter clean but it doesn’t work
../../Resource/flutter/.pub-cache/hosted/pub.dartlang.org/chewie-0.12.0/lib/src/chewie_player.dart:85:7: Error: No named parameter with the name 'resizeToAvoidBottomPadding'. resizeToAvoidBottomPadding: false,
^^^^^^^^^^^^^^^^^^^^^^^^^^
../../Resource/flutter/packages/flutter/lib/src/material/scaffold.dart:1451:9: Context: Found this candidate, but the arguments don't match. const Scaffold({
^^^^^^^^
../../Resource/flutter/.pub-cache/hosted/pub.dartlang.org/chewie_audio-1.1.1/lib/src/chewie_player.dart:99:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../Resource/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(_ChewieAudioControllerProvider) as _ChewieAudioControllerProvider; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../Resource/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.19.1/lib/src/picture_provider.dart:52:59: Error: No named parameter with the name 'nullOk'. context != null ? Localizations.localeOf(context, nullOk: true) : null, ^^^^^^
../../Resource/flutter/packages/flutter/lib/src/widgets/localizations.dart:413:17: Context: Found this candidate, but the arguments don't match. static Locale localeOf(BuildContext context) {
sry after i update to flutter 2.0.1, i forget to flutter pub upgrade
After make update the windows I got the below errors and I don't know why this happen.
D:/dev/courses/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/stacked_services-0.4.11/lib/src/snackbar_service.dart:74:7:
Error: Type 'SnackStatusCallback' not found.
SnackStatusCallback onStatusChanged,
^^^^^^^^^^^^^^^^^^^ /D:/dev/courses/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/stacked_services-0.4.11/lib/src/navigation_service.dart:94:35:
Error: The getter 'defaultDurationTransition' isn't defined for the
class '_GetImpl'.
'_GetImpl' is from 'package:get/get_core/src/get_main.dart' ('/D:/dev/courses/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/get-3.24.0/lib/get_core/src/get_main.dart').
Try correcting the name to the name of an existing getter, or defining
a getter or field named 'defaultDurationTransition'.
duration: duration ?? Get.defaultDurationTransition,
^^^^^^^^^^^^^^^^^^^^^^^^^ /D:/dev/courses/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/stacked_services-0.4.11/lib/src/navigation_service.dart:113:33:
Error: The getter 'defaultDurationTransition' isn't defined for the
class '_GetImpl'.
'_GetImpl' is from 'package:get/get_core/src/get_main.dart' ('/D:/dev/courses/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/get-3.24.0/lib/get_core/src/get_main.dart').
Try correcting the name to the name of an existing getter, or defining
a getter or field named 'defaultDurationTransition'.
duration: duration ?? Get.defaultDurationTransition,
^^^^^^^^^^^^^^^^^^^^^^^^^ /D:/dev/courses/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/stacked_services-0.4.11/lib/src/snackbar_service.dart:74:7:
Error: 'SnackStatusCallback' isn't a type.
SnackStatusCallback onStatusChanged,
^^^^^^^^^^^^^^^^^^^ /D:/dev/courses/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/stacked_services-0.4.11/lib/src/snackbar_service.dart:111:9:
Error: No named parameter with the name 'onStatusChanged'.
onStatusChanged: onStatusChanged,
^^^^^^^^^^^^^^^ /D:/dev/courses/flutter/flutter_windows_1.22.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/get-3.24.0/lib/get_navigation/src/snackbar/snack.dart:12:3:
Context: Found this candidate, but the arguments don't match.
GetBar({ ^^^^^^ 2
FAILURE: Build failed with an exception.
Where: Script 'D:\dev\courses\flutter\flutter_windows_1.22.5-stable\flutter\packages\flutter_tools\gradle\flutter.gradle'
line: 904