Nardine
Nardine

Reputation: 23

Error: No named parameter with the name 'List'

When i run my flutter app on vs code,I get this error : lib/ui/pages/home_pages/ads_view.dart:65:39: Error: No named parameter with the name 'List'.

                                      ^^^^
../../../Desktop/flutter/packages/flutter/lib/src/painting/gradient.dart:366:9: Context: Found this candidate, but the arguments don't match.
  const LinearGradient({
        ^^^^^^^^^^^^^^

and this is the code :

Container(
  decoration: BoxDecoration(
    gradient: LinearGradient(
      List: [Colors.black87, Colors.transparent],
      begin: Alignment.bottomCenter,
      end: Alignment.center,
    ),
  ),
)

Upvotes: 0

Views: 964

Answers (1)

CopsOnRoad
CopsOnRoad

Reputation: 267664

Use colors property instead of List.

Container(
  decoration: BoxDecoration(
    gradient: LinearGradient(
      colors: [Colors.black87, Colors.transparent], // Here it is
      begin: Alignment.bottomCenter,
      end: Alignment.center,
    ),
  ),
)

Upvotes: 1

Related Questions