Skip to content
Back

[SOLVED] TypeError (type 'List<dynamic>' is not a subtype of type 'List<String>')

  • 0
  • Flutter
  • Cloud
frankenstein
1 Jan, 2025, 15:17

am getting this error on all sdk functions, from account.get onwards

TL;DR
Developers were getting a TypeError stating that type 'List<dynamic>' is not a subtype of type 'List<String>'. The issue was resolved by properly initializing the Account class before calling its functions. The correct format is: ```ts const account = new Account(client); const res = await account.get(); ```
Kenny
1 Jan, 2025, 15:20

Initialize the account class first, the use it.

TypeScript
const account =  new Account(client);
const res = await account.get();
frankenstein
1 Jan, 2025, 15:22

same issue

frankenstein
1 Jan, 2025, 15:22

and its happening to Databases(client).listDocuments

Kenny
1 Jan, 2025, 15:23

what is .timeout

frankenstein
1 Jan, 2025, 15:23

timeout is the timeout of the function to 59 seconds

Kenny
1 Jan, 2025, 15:24

If you use exactly what is in the docs, does it not work?

TypeScript
import 'package:appwrite/appwrite.dart';

Client client = Client()
    .setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
    .setProject('<YOUR_PROJECT_ID>'); // Your project ID

Account account = Account(client);

User result = await account.get();
frankenstein
1 Jan, 2025, 15:26

it worked thanks

Kenny
1 Jan, 2025, 15:27

Thanks :)

Kenny
1 Jan, 2025, 15:28

[SOLVED] TypeError (type 'List<dynamic>' is not a subtype of type 'List<String>')

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more