AppwriteにFlutterから接続する時、Androidエミュレータのときのみなぜか繋がらない問題が起きました。
(*dockerでローカルでAppwriteを起動しています。)
下記がエラー
ClientException with SocketException: Connection refused (OS Error: Connection refused, errno = 111), address = 127.0.0.1, port = 33098,
エミュレータをAndroid Studioから削除→再構築
など試してみましたがうまくいかず、
youtubeで検索してたところなぜかこの方法で解決。
Appwriteに接続する時の接続先を
endPoint = 'http://10.0.2.2/v1';
のように、「10.0.2.2」にします。
こうするとうまくいきました。(なんで?)
参考Youtube動画