import 'package:flutter/material.dart';
import 'package:english_words/english_words.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
final wordPair = WordPair.random();
return MaterialApp(
theme: ThemeData(primaryColor: Colors.purple[900]),
home: Scaffold(
appBar: AppBar(title: Text('WorldPair Generator')),
`enter code here`body: Center(child: Text(wordPair.asPascaLCase))));
错误消息: lib / main.dart:10:22:错误:未为类“ MyApp”定义吸气剂“ WordPair”。
答案 0 :(得分:0)
答案 1 :(得分:0)
english_words
的作者实际上已经关闭了该命令,因此它不起作用。但是,如果您想生成一些随机单词,则可以使用pub.dev中的SuperHeroName Generator
>