Bizarre Flutter bug – case insesitivity
For the last month or two, I’ve seen this error come up. I’m developing on Windows 11 and using the most update Flutter/Dart in Quail 2 (Android Studio).
error: The argument type 'HexGridManager (where HexGridManager is defined in d:\development\Onslaught\onclient\lib\flags.dart)' can't be assigned to the parameter type 'HexGridManager (where HexGridManager is defined in D:\development\Onslaught\onclient\lib\flags.dart)'. (argument_type_not_assignable at [tiled_game_app] lib\tiled_game.dart:298)
The error is it thinks a class that is defined in a file is not the same class as that same class in that same file (yep bizarre!) because the capitalisation of the Drive path differs. D vs d.
I’ve searched the whole project folder for the path using Notepad++ and it turns up surprisingly in 1473 places but when I copied that and looked for a path with a lower case d: it found none.
There is a simple fix. Just close Android Studio and then reopen it. The bug is no longer there.
I thought maybe the non-tiled hex map program mentioned in my last blog entry would be easier to work with and as fast but just to be on the safe side, I measured the frame rate of both programs.
Originally I was going to use Tiled to draw hexagons in a Flutter web game. But it seemed easier to do it manually without having to worry about working with the .tmx format which is an all singing format based on a XML file structure, and seems more suited to static maps.