Home > Net >  Missing type arguments for generic type 'Future<dynamic>'. Try adding an explicit ty
Missing type arguments for generic type 'Future<dynamic>'. Try adding an explicit ty

Time:05-07

How do I resolve this issue without removing the implicit-dynamic form analysis options file?

Error:

enter image description here

My Code:

Future<void> _scrollToBottomOnKeyboardOpen() async {
        while (!isKeyboardVisible) {
          await Future.delayed(const Duration(milliseconds: 50));
        }
    
        await Future.delayed(const Duration(milliseconds: 250));
    
        await scrollController.animateTo(
          scrollController.position.maxScrollExtent,
          duration: const Duration(milliseconds: 250),
          curve: Curves.easeIn,
        );
      }

CodePudding user response:

Add the specific type void and thus make it not generic:

Future<void>.delayed(...)

  • Related