enter image description here当我尝试在按下的on中执行if语句时,出现错误,这是使用不相关类型的引用进行的=> 'Equality '==‘调用
final List<Movie> movies = [
Movie(
imageUrl: 'assets/images/5s.PNG',
title: 'video 1',
categories: 'Fantasy, Sci-fi',
year: 2018,
country: 'uk',
length: 60,
description:
'Our friendly neighborhood Super Hero decides to join his best friends Ned, MJ, and the rest of the gang on a European vacation. However, Peter\'s plan to leave super heroics behind for a few weeks are quickly scrapped when he begrudgingly agrees to help Nick Fury uncover the mystery of several elemental creature attacks, creating havoc across the continent.',
screenshots: [
'assets/images/1.PNG',
'assets/images/2.PNG',
'assets/images/3.PNG',
],
),
Movie(
imageUrl: 'assets/images/Star.PNG',
title: 'Star',
categories: 'Adventure, Family, Fantasy',
year: 2000,
country: 'US',
length: 100,
description:
'All Clara wants is a key - a one-of-a-kind key that will unlock a box that holds a priceless gift from her late mother. A golden thread, presented to her at godfather Drosselmeyer\'s annual holiday party, leads her to the coveted key-which promptly disappears into a strange and mysterious parallel world. It\'s there that Clara encounters a soldier named Phillip, a gang of mice and the regents who preside over three Realms: Land of Snowflakes, Land of Flowers, and Land of Sweets. Clara and Phillip must brave the ominous Fourth Realm, home to the tyrant Mother Ginger, to retrieve Clara\'s key and hopefully return harmony to the unstable world.',
screenshots: [
'assets/images/l1.PNG',
'assets/images/nl2.PNG',
'assets/images/kl3.PNG',
],
),
Movie(
imageUrl: 'assets/images/johnyjohny.PNG',
title: 'Johny',
categories: 'Adventure, Fantasy',
year: 2019,
country: 'ire',
length: 65,
description:
'Woody, Buzz Lightyear and the rest of the gang embark on a road trip with Bonnie and a new toy named Forky. The adventurous journey turns into an unexpected reunion as Woody\'s slight detour leads him to his long-lost friend Bo Peep. As Woody and Bo discuss the old days, they soon start to realize that they\'re two worlds apart when it comes to what they want from life as a toy.',
screenshots: [
'assets/images/johny.PNG',
'assets/images/johny.PNG',
'assets/images/johny.PNG',
],
),
];`发布于 2020-04-17 00:10:06
你会得到这个错误,因为你试图比较不同的类型;电影(列表)和电影0,它们永远不可能相等。您为什么要使用" if“语句如果您解释一下,我们可能会帮助您更容易。
发布于 2020-04-17 02:00:35
https://stackoverflow.com/questions/61250404
复制相似问题