In short, you’re hitting a use-case where FlatPak is not ideal for your needs. @ahkok has a post here that I think is worth reading:
@daviessd shared some tips about how they got FlatPak vscode working for dart-sdk