Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: migrate windows/application_package.dart to null-safety #88081

Merged
merged 1 commit into from Aug 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 7 additions & 11 deletions packages/flutter_tools/lib/src/windows/application_package.dart
Expand Up @@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// @dart = 2.8

import 'package:meta/meta.dart';

import '../application_package.dart';
import '../base/file_system.dart';
import '../base/utils.dart';
Expand All @@ -15,7 +11,7 @@ import '../cmake_project.dart';
import '../globals_null_migrated.dart' as globals;

abstract class WindowsApp extends ApplicationPackage {
WindowsApp({@required String projectBundleId}) : super(id: projectBundleId);
WindowsApp({required String projectBundleId}) : super(id: projectBundleId);

/// Creates a new [WindowsApp] from a windows sub project.
factory WindowsApp.fromWindowsProject(WindowsProject project) {
Expand All @@ -41,7 +37,7 @@ abstract class WindowsApp extends ApplicationPackage {

class PrebuiltWindowsApp extends WindowsApp {
PrebuiltWindowsApp({
@required String executable,
required String executable,
}) : _executable = executable,
super(projectBundleId: executable);

Expand All @@ -56,14 +52,14 @@ class PrebuiltWindowsApp extends WindowsApp {

class BuildableWindowsApp extends WindowsApp {
BuildableWindowsApp({
@required this.project,
required this.project,
}) : super(projectBundleId: project.parent.manifest.appName);

final WindowsProject project;

@override
String executable(BuildMode buildMode) {
final String binaryName = getCmakeExecutableName(project);
final String? binaryName = getCmakeExecutableName(project);
return globals.fs.path.join(
getWindowsBuildDirectory(),
'runner',
Expand All @@ -77,12 +73,12 @@ class BuildableWindowsApp extends WindowsApp {
}

class BuildableUwpApp extends ApplicationPackage {
BuildableUwpApp({@required this.project}) : super(id: project.packageGuid);
BuildableUwpApp({required this.project}) : super(id: project.packageGuid ?? 'com.example.placeholder');

final WindowsUwpProject project;

String get projectVersion => project.packageVersion;
String? get projectVersion => project.packageVersion;

@override
String get name => getCmakeExecutableName(project);
String? get name => getCmakeExecutableName(project);
}