'flutter in android studio says cannot find declaration to go to......i am using the latest version of it v1.7.8+hotfix.4

i can't find defination of any of the flutter function or class if i want to see the defination or implementation of FAB(floating action button) it says cannot find the declaration to go to. here you can see the attached files:

https://drive.google.com/open?id=1cgv1pNb43SxZtupl_gAYC0gZrd7CQDy_

i have tried deleting the idea folder and restarting the android studio

import 'package:flutter/material.dart';

enter code here

class ReusableBox extends StatelessWidget {
  ReusableBox({@required this.colour, this.cardChild, this.onPress});
  final Color colour;
  final Widget cardChild;
  final Function onPress;
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onPress,
      child: Container(
        child: cardChild,
        margin: EdgeInsets.all(15),
        decoration: BoxDecoration(
          color: colour,
          borderRadius: BorderRadius.circular(10),
        ),
      ),
    );
  }
}


Solution 1:[1]

It's likely that the Flutter plugin hasn't load the references properly. The Flutter app usually should still be able to run if it doesn't have any errors.

Cannot find declaration

What you can do here is try running flutter clean and flutter pub get to rebuild the references. If that didn't work, you can restart Android Studio and try running the app.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Omatt