Flutter/モジュール分割
提供: 初心者エンジニアの簡易メモ
lib/main.dart
import 'package:flutter/material.dart'; import 'gallery/app.dart'; void main() { runApp(const GalleryApp()); }
gallery/app.dart
class GalleryApp extends StatefulWidget { @override Widget build(BuildContext context) { return new MaterialApp( title: 'Hello Wolrd', home: new Scaffold( body: new Center( child: new Text('Hello World'), ), ), ); } }