首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在on pressed方法中关联列表

在on pressed方法中关联列表
EN

Stack Overflow用户
提问于 2020-04-16 20:36:28
回答 2查看 46关注 0票数 0

enter image description here当我尝试在按下的on中执行if语句时,出现错误,这是使用不相关类型的引用进行的=> 'Equality '==‘调用

代码语言:javascript
复制
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',
    ],
  ),

];`
EN

回答 2

Stack Overflow用户

发布于 2020-04-17 00:10:06

你会得到这个错误,因为你试图比较不同的类型;电影(列表)和电影0,它们永远不可能相等。您为什么要使用" if“语句如果您解释一下,我们可能会帮助您更容易。

票数 0
EN

Stack Overflow用户

发布于 2020-04-17 02:00:35

enter image description here

[][2]

这两个图像显示了我的代码,我希望当用户单击箭头播放按钮时,将他带到其他页面,在那里视频将根据电影列表显示

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61250404

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档