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

Error: Type 'PopInvokedWithResultCallback' not found. PopInvokedWithResultCallback<T>? onPopInvoked, #3201

Open
zhao004 opened this issue Aug 30, 2024 · 2 comments
Assignees

Comments

@zhao004
Copy link

zhao004 commented Aug 30, 2024

Flutter Version:

Flutter 3.22.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b0850beeb2 (6 weeks ago) • 2024-07-16 21:43:41 -0700
Engine • revision 235db911ba
Tools • Dart 3.4.4 • DevTools 2.34.3

Getx Version:

get: ^5.0.0-release-candidate-9.2

Describe:

errorimage

I used getx init to initialize the project and an error occurred when I ran it.

example:

import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../controllers/home_controller.dart';

class HomeView extends GetView<HomeController> {
  const HomeView({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('HomeView'),
        centerTitle: true,
      ),
      body: Column(
        children: [
          Container(
            width: Get.width,
            height: Get.height * 0.3,
            color: Colors.blue,
          ),
          Container(
            width: context.width,
            height: Get.height * 0.3,
            color: Colors.red,
          ),
          const Center(
            child: Text(
              'HomeView is working',
              style: TextStyle(fontSize: 20),
            ),
          ),
        ],
      ),
    );
  }
}

Error messages:

/F:/Flutterpubcache/hosted/pub.dev/get-5.0.0-release-candidate-9.2/lib/get_navigation/src/routes/get_route.dart:134:5: Error: Type 'PopInvokedWithResultCallback' not found.
    PopInvokedWithResultCallback<T>? onPopInvoked,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/F:/Flutterpubcache/hosted/pub.dev/get-5.0.0-release-candidate-9.2/lib/get_navigation/src/routes/get_route.dart:90:11: Error: No named parameter with the name 'canPop'.
    super.canPop,
          ^^^^^^
/F:/Flutterpubcache/hosted/pub.dev/get-5.0.0-release-candidate-9.2/lib/get_navigation/src/routes/get_route.dart:134:5: Error: 'PopInvokedWithResultCallback' isn't a type.
    PopInvokedWithResultCallback<T>? onPopInvoked,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/F:/Flutterpubcache/hosted/pub.dev/get-5.0.0-release-candidate-9.2/lib/get_navigation/src/routes/get_route.dart:169:30: Error: The getter 'canPop' isn't defined for the class 'GetPage<T>'.
 - 'GetPage' is from 'package:get/get_navigation/src/routes/get_route.dart' ('/F:/Flutterpubcache/hosted/pub.dev/get-5.0.0-release-candidate-9.2/lib/get_navigation/src/routes/get_route.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'canPop'.
      canPop: canPop ?? this.canPop,
                             ^^^^^^
/F:/Flutterpubcache/hosted/pub.dev/get-5.0.0-release-candidate-9.2/lib/get_navigation/src/routes/get_route.dart:170:42: Error: The getter 'onPopInvoked' isn't defined for the class 'GetPage<T>'.
 - 'GetPage' is from 'package:get/get_navigation/src/routes/get_route.dart' ('/F:/Flutterpubcache/hosted/pub.dev/get-5.0.0-release-candidate-9.2/lib/get_navigation/src/routes/get_route.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'onPopInvoked'.
      onPopInvoked: onPopInvoked ?? this.onPopInvoked,
                                         ^^^^^^^^^^^^
/F:/Flutterpubcache/hosted/pub.dev/get-5.0.0-release-candidate-9.2/lib/get_navigation/src/extension_navigation.dart:175:5: Error: Type 'PopInvokedWithResultCallback' not found.
    PopInvokedWithResultCallback<T>? onWillPop,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/F:/Flutterpubcache/hosted/pub.dev/get-5.0.0-release-candidate-9.2/lib/get_navigation/src/extension_navigation.dart:175:5: Error: 'PopInvokedWithResultCallback' isn't a type.
    PopInvokedWithResultCallback<T>? onWillPop,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/F:/Flutterpubcache/hosted/pub.dev/get-5.0.0-release-candidate-9.2/lib/get_navigation/src/extension_navigation.dart:272:15: Error: No named parameter with the name 'onPopInvokedWithResult'.
              onPopInvokedWithResult: (didPop, result) =>
              ^^^^^^^^^^^^^^^^^^^^^^
/D:/fluttersdk/default/packages/flutter/lib/src/widgets/pop_scope.dart:55:9: Context: Found this candidate, but the arguments don't match.
  const PopScope({
        ^^^^^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\fluttersdk\default\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 4s
Error: Gradle task assembleDebug failed with exit code 1
@zhao004 zhao004 changed the title Get:9.2 | Error: Type 'PopInvokedWithResultCallback' not found. PopInvokedWithResultCallback<T>? onPopInvoked, Error: Type 'PopInvokedWithResultCallback' not found. PopInvokedWithResultCallback<T>? onPopInvoked, Aug 30, 2024
@ajayld
Copy link

ajayld commented Aug 30, 2024

I'm facing the same. Any ETA on this issue?

@Frefro
Copy link

Frefro commented Aug 30, 2024

PopInvokedWithResultCallback got introduced in flutter 3.24.0. So maybe updating your flutter version might help.

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

4 participants