打开Android Studio
依次打开 Preferences | Editor | File and Code Templates
找到Dart File
class ${NAME} extends StatefulWidget {
@override
State<${NAME}> createState() => _${NAME}State();
}
class _${NAME}State extends State<${NAME}> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
child: new Container(
color: Color.fromRGBO(0, 0, 0, 0),
),
);
}
}
然后就可以快乐的按照模版新建Dart文件了。
网友评论