LoginSignup
1
2

[Flutter] 新規プロジェクト作成時にサンプルコード & コメント無しで始める

Last updated at Posted at 2023-10-10
flutter create -e your_project_name

と、-e フラグを付けてプロジェクト作成すると、以下の様にテキスト表示のみのアプリが作成されます。コメントもつきません :no_good:

main.dart
import 'package:flutter/material.dart';

void main() {
  runApp(const MainApp());
}

class MainApp extends StatelessWidget {
  const MainApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(
        body: Center(
          child: Text('Hello World!'),
        ),
      ),
    );
  }
}
pubspec.yaml
name: your_project_name
description: A new Flutter project.
publish_to: 'none'
version: 0.1.0

environment:
  sdk: '>=3.1.0 <4.0.0'

dependencies:
  flutter:
    sdk: flutter

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^2.0.0

flutter:
  uses-material-design: true

関連

Add --empty to the flutter create command #113873

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2