Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
4d788b10
Unverified
Commit
4d788b10
authored
Nov 16, 2023
by
Ian Hickson
Committed by
GitHub
Nov 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce animations further when --no-cli-animations is set. (#133598)
parent
d8c98c11
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
48 additions
and
12 deletions
+48
-12
executable.dart
packages/flutter_tools/lib/executable.dart
+5
-2
runner.dart
packages/flutter_tools/lib/runner.dart
+3
-0
context.dart
packages/flutter_tools/lib/src/base/context.dart
+3
-0
terminal.dart
packages/flutter_tools/lib/src/base/terminal.dart
+25
-5
context_runner.dart
packages/flutter_tools/lib/src/context_runner.dart
+2
-2
features.dart
packages/flutter_tools/lib/src/features.dart
+0
-2
globals.dart
packages/flutter_tools/lib/src/globals.dart
+3
-0
custom_devices_test.dart
...ols/test/commands.shard/hermetic/custom_devices_test.dart
+6
-0
logger_test.dart
...es/flutter_tools/test/general.shard/base/logger_test.dart
+1
-1
No files found.
packages/flutter_tools/lib/executable.dart
View file @
4d788b10
...
...
@@ -124,13 +124,16 @@ Future<void> main(List<String> args) async {
windows:
globals
.
platform
.
isWindows
,
);
},
Terminal:
()
{
Ansi
Terminal:
()
{
return
AnsiTerminal
(
stdio:
globals
.
stdio
,
platform:
globals
.
platform
,
now:
DateTime
.
now
(),
isCliAnimationEnabled:
featureFlags
.
isCliAnimationEnabled
,
// So that we don't animate anything before calling applyFeatureFlags, default
// the animations to disabled in real apps.
defaultCliAnimationEnabled:
false
,
);
// runner.run calls "terminal.applyFeatureFlags()"
},
PreRunValidator:
()
=>
PreRunValidator
(
fileSystem:
globals
.
fs
),
},
...
...
packages/flutter_tools/lib/runner.dart
View file @
4d788b10
...
...
@@ -18,6 +18,7 @@ import 'src/base/logger.dart';
import
'src/base/process.dart'
;
import
'src/context_runner.dart'
;
import
'src/doctor.dart'
;
import
'src/features.dart'
;
import
'src/globals.dart'
as
globals
;
import
'src/reporting/crash_reporting.dart'
;
import
'src/reporting/reporting.dart'
;
...
...
@@ -44,6 +45,8 @@ Future<int> run(
}
return
runInContext
<
int
>(()
async
{
globals
.
terminal
.
applyFeatureFlags
(
featureFlags
);
reportCrashes
??=
!
await
globals
.
isRunningOnBot
;
final
FlutterCommandRunner
runner
=
FlutterCommandRunner
(
verboseHelp:
verboseHelp
);
commands
().
forEach
(
runner
.
addCommand
);
...
...
packages/flutter_tools/lib/src/base/context.dart
View file @
4d788b10
...
...
@@ -7,6 +7,9 @@ import 'dart:collection';
import
'package:meta/meta.dart'
;
// TODO(ianh): We should remove AppContext's mechanism and replace it with
// passing dependencies directly in constructors, methods, etc.
/// Generates an [AppContext] value.
///
/// Generators are allowed to return `null`, in which case the context will
...
...
packages/flutter_tools/lib/src/base/terminal.dart
View file @
4d788b10
...
...
@@ -3,6 +3,7 @@
// found in the LICENSE file.
import
'../convert.dart'
;
import
'../features.dart'
;
import
'io.dart'
as
io
;
import
'logger.dart'
;
import
'platform.dart'
;
...
...
@@ -69,6 +70,7 @@ class OutputPreferences {
}
/// The command line terminal, if available.
// TODO(ianh): merge this with AnsiTerminal, the abstraction isn't giving us anything.
abstract
class
Terminal
{
/// Create a new test [Terminal].
///
...
...
@@ -81,9 +83,12 @@ abstract class Terminal {
/// to perform animations.
bool
get
supportsColor
;
/// Whether
to show animations on this terminal
.
/// Whether
animations should be used in the output
.
bool
get
isCliAnimationEnabled
;
/// Configures isCliAnimationEnabled based on a [FeatureFlags] object.
void
applyFeatureFlags
(
FeatureFlags
flags
);
/// Whether the current terminal can display emoji.
bool
get
supportsEmoji
;
...
...
@@ -158,11 +163,12 @@ class AnsiTerminal implements Terminal {
required
io
.
Stdio
stdio
,
required
Platform
platform
,
DateTime
?
now
,
// Time used to determine preferredStyle. Defaults to 0001-01-01 00:00.
this
.
is
CliAnimationEnabled
=
true
,
bool
default
CliAnimationEnabled
=
true
,
})
:
_stdio
=
stdio
,
_platform
=
platform
,
_now
=
now
??
DateTime
(
1
);
_now
=
now
??
DateTime
(
1
),
_isCliAnimationEnabled
=
defaultCliAnimationEnabled
;
final
io
.
Stdio
_stdio
;
final
Platform
_platform
;
...
...
@@ -207,7 +213,14 @@ class AnsiTerminal implements Terminal {
bool
get
supportsColor
=>
_platform
.
stdoutSupportsAnsi
;
@override
final
bool
isCliAnimationEnabled
;
bool
get
isCliAnimationEnabled
=>
_isCliAnimationEnabled
;
bool
_isCliAnimationEnabled
;
@override
void
applyFeatureFlags
(
FeatureFlags
flags
)
{
_isCliAnimationEnabled
=
flags
.
isCliAnimationEnabled
;
}
// Assume unicode emojis are supported when not on Windows.
// If we are on Windows, unicode emojis are supported in Windows Terminal,
...
...
@@ -419,7 +432,14 @@ class _TestTerminal implements Terminal {
final
bool
supportsColor
;
@override
bool
get
isCliAnimationEnabled
=>
supportsColor
;
bool
get
isCliAnimationEnabled
=>
supportsColor
&&
_isCliAnimationEnabled
;
bool
_isCliAnimationEnabled
=
true
;
@override
void
applyFeatureFlags
(
FeatureFlags
flags
)
{
_isCliAnimationEnabled
=
flags
.
isCliAnimationEnabled
;
}
@override
final
bool
supportsEmoji
;
...
...
packages/flutter_tools/lib/src/context_runner.dart
View file @
4d788b10
...
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'package:process/process.dart'
;
...
...
@@ -84,6 +82,8 @@ Future<T> runInContext<T>(
return
runner
();
}
// TODO(ianh): We should split this into two, one for tests (which should be
// in test/), and one for production (which should be in executable.dart).
return
context
.
run
<
T
>(
name:
'global fallbacks'
,
body:
runnerWrapper
,
...
...
packages/flutter_tools/lib/src/features.dart
View file @
4d788b10
...
...
@@ -5,8 +5,6 @@
import
'base/context.dart'
;
/// The current [FeatureFlags] implementation.
///
/// If not injected, a default implementation is provided.
FeatureFlags
get
featureFlags
=>
context
.
get
<
FeatureFlags
>()!;
/// The interface used to determine if a particular [Feature] is enabled.
...
...
packages/flutter_tools/lib/src/globals.dart
View file @
4d788b10
...
...
@@ -49,6 +49,9 @@ import 'runner/flutter_command.dart';
import
'runner/local_engine.dart'
;
import
'version.dart'
;
// TODO(ianh): We should remove all the global variables and replace them with
// arguments (to constructors, methods, etc, as appropriate).
Artifacts
?
get
artifacts
=>
context
.
get
<
Artifacts
>();
BuildSystem
get
buildSystem
=>
context
.
get
<
BuildSystem
>()!;
Cache
get
cache
=>
context
.
get
<
Cache
>()!;
...
...
packages/flutter_tools/test/commands.shard/hermetic/custom_devices_test.dart
View file @
4d788b10
...
...
@@ -20,6 +20,7 @@ import 'package:flutter_tools/src/cache.dart';
import
'package:flutter_tools/src/commands/custom_devices.dart'
;
import
'package:flutter_tools/src/custom_devices/custom_device_config.dart'
;
import
'package:flutter_tools/src/custom_devices/custom_devices_config.dart'
;
import
'package:flutter_tools/src/features.dart'
;
import
'package:flutter_tools/src/runner/flutter_command_runner.dart'
;
import
'../../src/common.dart'
;
...
...
@@ -241,6 +242,11 @@ class FakeTerminal implements Terminal {
@override
bool
get
isCliAnimationEnabled
=>
terminal
.
isCliAnimationEnabled
;
@override
void
applyFeatureFlags
(
FeatureFlags
flags
)
{
// ignored
}
@override
bool
get
supportsEmoji
=>
terminal
.
supportsEmoji
;
...
...
packages/flutter_tools/test/general.shard/base/logger_test.dart
View file @
4d788b10
...
...
@@ -1292,7 +1292,7 @@ void main() {
terminal:
AnsiTerminal
(
stdio:
fakeStdio
,
platform:
_kNoAnsiPlatform
,
is
CliAnimationEnabled:
false
,
default
CliAnimationEnabled:
false
,
),
stdio:
fakeStdio
,
stopwatchFactory:
FakeStopwatchFactory
(
stopwatch:
FakeStopwatch
()),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment