0

I am working for a flutter application with android studio ide. I am using a supporting libraries for casting video using dart_chromecast my application. Initially i can see the code implementation of supporting library. Like methods and callbacks.

Problem is: Now due to some changes in my Android studio ide, i am not able to see the code implementation of supporting libraries. Still can navigate to the library classes but the code is not in readable format. I know that clearly, the problem is not because of using supporting library.

Please find the attached screen for the problem. And let me know how to reset my android studio to show the code again.

screen: enter image description here

More information:

Here is the git hub link for one of the problematic file.

https://github.com/terrabythia/dart_chromecast/blob/master/lib/casting/cast_sender.dart

Attached is the screen of problematic file which is not readable through Android studio ide.

enter image description here

Raghu Mudem
  • 6,793
  • 13
  • 48
  • 69
  • 1
    The file shown doesn't appear to be code. It seems to be a PNG by the 3 byte tag at the beginning of the file. – Christopher Moore Jun 18 '20 at 18:19
  • Thanks for the response. The file is actually dart code class. I was able to read from the file explored and open the file with notepad. – Raghu Mudem Jun 18 '20 at 18:23
  • 1
    That seems highly unlikely as the text data that can actually be read is consistent with tags from PNG file blocks such as pHYs, IHDR, and ICC profiles. If this is really true please share an image of the _same_ file opened in notepad. – Christopher Moore Jun 18 '20 at 18:36
  • @ChristopherMoore Sorry for the delay in response. I have edited the question with more information you can check the file and screenshot. – Raghu Mudem Jun 18 '20 at 19:34

2 Answers2

1

Looks like cast_sender.dart is actually a PNG file. Try to change this file extension from dart to png.

Here is an example of PNG file opened as text file:

enter image description here

Jenea Vranceanu
  • 4,530
  • 2
  • 18
  • 34
  • Thanks for the response. The file is actually dart code class. I was able to read from the file explored and open the file with notepad. – Raghu Mudem Jun 18 '20 at 18:23
  • 1
    @RaghuMudem, Could you upload the problematic file online and share in your question? If you open any other dart file in this IDE how is it presented? – Jenea Vranceanu Jun 18 '20 at 18:25
  • Sorry for the delay in response. I have edited the question with more information you can check the file and screenshot. – Raghu Mudem Jun 18 '20 at 19:35
1

After so much research on my problem, i have identified the solution. Posting this information to help other with this kind of rare scenario.

Root cause: Identified a folder with the name .pub_cache under flutter sdk folder.(path_to_flutter_sdk/flutter/.pub_cache)

Solution: 1. Closed Android Studio and emulator. 2. Deleted .pub_cache folder from flutter sdk folder through file explorer. 3. Launched android studio again. 4. Run 'pub get' command for my flutter application.

Problem solved and actual code showing.

Raghu Mudem
  • 6,793
  • 13
  • 48
  • 69