Russel Rias M K
Russel Rias M K

Reputation: 11

Error: Too many positional arguments: 0 allowed, but 2 found

Error: Too many positional arguments: 0 allowed, but 2 found. Try removing the extra positional arguments. configuration.dimensions = VideoDimensions(1920, 1080);

This error happen when I use Agora video call in Flutter.

Upvotes: 0

Views: 536

Answers (1)

Mohan Sai Manthri
Mohan Sai Manthri

Reputation: 3189

Error says it doesnt have any positional arguments, instead it has named arguments

which means you need to pass like this

VideoDimensions(width: 1920, height: 1080),

Position arguments can be created as

void functionName(int a, intb); => functionName(3,6)

Optional arguments but named

void functionName({int a, intb}); => functionName(a: 4)

Named and required

void functionName({ required int a, requried intb}); => functionName(a: 3, b: 6)

Optional but not named

void functionName([int a, intb]); => functionName(3,6)

Upvotes: 2

Related Questions