Add --empty to the flutter create command (#113873)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# {{projectName}}
|
||||
|
||||
{{description}}
|
||||
{{^withEmptyMain}}
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -14,3 +15,4 @@ A few resources to get you started if this is your first Flutter project:
|
||||
For help getting started with Flutter development, view the
|
||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
||||
{{/withEmptyMain}}
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
import 'package:flutter/material.dart';
|
||||
{{#withEmptyMain}}
|
||||
|
||||
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!'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
{{/withEmptyMain}}
|
||||
{{^withEmptyMain}}
|
||||
{{#withPlatformChannelPluginHook}}
|
||||
import 'dart:async';
|
||||
|
||||
@@ -248,3 +270,4 @@ class _MyAppState extends State<MyApp> {
|
||||
}
|
||||
}
|
||||
{{/withFfiPluginHook}}
|
||||
{{/withEmptyMain}}
|
||||
|
||||
@@ -1,6 +1,25 @@
|
||||
name: {{projectName}}
|
||||
description: {{description}}
|
||||
{{#withEmptyMain}}
|
||||
publish_to: 'none'
|
||||
version: 0.1.0
|
||||
|
||||
environment:
|
||||
sdk: {{dartSdkVersionBounds}}
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_lints: ^2.0.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
{{/withEmptyMain}}
|
||||
{{^withEmptyMain}}
|
||||
# The following line prevents the package from being accidentally published to
|
||||
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
@@ -100,3 +119,4 @@ flutter:
|
||||
#
|
||||
# For details regarding fonts from package dependencies,
|
||||
# see https://flutter.dev/custom-fonts/#from-packages
|
||||
{{/withEmptyMain}}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{{^withEmptyMain}}
|
||||
# This file configures the analyzer, which statically analyzes Dart code to
|
||||
# check for errors, warnings, and lints.
|
||||
#
|
||||
@@ -7,7 +8,9 @@
|
||||
|
||||
# The following line activates a set of recommended lints for Flutter apps,
|
||||
# packages, and plugins designed to encourage good coding practices.
|
||||
{{/withEmptyMain}}
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
{{^withEmptyMain}}
|
||||
|
||||
linter:
|
||||
# The lint rules applied to this project can be customized in the
|
||||
@@ -27,3 +30,4 @@ linter:
|
||||
|
||||
# Additional information about this file can be found at
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
{{/withEmptyMain}}
|
||||
|
||||
Reference in New Issue
Block a user