| // Copyright 2014 The Flutter Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| import 'dart:io'; |
| |
| import 'package:flutter/foundation.dart'; |
| import 'package:flutter/widgets.dart'; |
| |
| // Sets a platform override for desktop to avoid exceptions. See |
| // https://flutter.dev/desktop#target-platform-override for more info. |
| // TODO(gspencergoog): Remove once TargetPlatform includes all desktop platforms. |
| void _enablePlatformOverrideForDesktop() { |
| if (!kIsWeb && (Platform.isWindows || Platform.isLinux)) { |
| debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia; |
| } |
| } |
| |
| void main() { |
| _enablePlatformOverrideForDesktop(); |
| runApp(const Directionality( |
| textDirection: TextDirection.ltr, |
| child: Center( |
| child: Text('flutter run -t xxx.dart'), |
| ), |
| )); |
| } |