简体   繁体   中英

EXCEPTION CAUGHT BY WIDGETS LIBRARY in flutter app

When i am trying to run my own flutter app in android studio it gives error like this

This is my app screenshot:

This is my logcat:

The problem is that Colors.black is a single color, but primarySwatch expects a palette of multiple colors. If you look at the documentation for Colors , the different built in palettes are shown. For example, Colors.blue is a blue palette, and can be passed to primarySwatch .

new MaterialApp(theme: new ThemeData(primarySwatch: Colors.blue))

在单引号中查看您的空间,您应该这样写: var first = ['answer':'black','white',...];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM