Commit dd2bde19 authored by Devon Carew's avatar Devon Carew

add a service extension for repaint rainbow (#3409)

* add a service extension for repaint rainbow

* review comments
parent 6dc440bd
...@@ -41,10 +41,11 @@ abstract class Renderer extends Object with Scheduler, Services ...@@ -41,10 +41,11 @@ abstract class Renderer extends Object with Scheduler, Services
@override @override
void initServiceExtensions() { void initServiceExtensions() {
super.initServiceExtensions(); super.initServiceExtensions();
assert(() { assert(() {
// this service extension only works in checked mode // this service extension only works in checked mode
registerBoolServiceExtension( registerBoolServiceExtension(
name: 'debugPaint', name: 'debugPaint',
getter: () => debugPaintSizeEnabled, getter: () => debugPaintSizeEnabled,
setter: (bool value) { setter: (bool value) {
if (debugPaintSizeEnabled == value) if (debugPaintSizeEnabled == value)
...@@ -60,8 +61,19 @@ abstract class Renderer extends Object with Scheduler, Services ...@@ -60,8 +61,19 @@ abstract class Renderer extends Object with Scheduler, Services
); );
return true; return true;
}); });
}
assert(() {
// this service extension only works in checked mode
registerBoolServiceExtension(
name: 'repaintRainbow',
getter: () => debugRepaintRainbowEnabled,
setter: (bool value) {
debugRepaintRainbowEnabled = value;
}
);
return true;
});
}
void initRenderView() { void initRenderView() {
if (renderView == null) { if (renderView == null) {
......
...@@ -214,7 +214,7 @@ class _AnsiStatus extends Status { ...@@ -214,7 +214,7 @@ class _AnsiStatus extends Status {
_AnsiStatus(this.message) { _AnsiStatus(this.message) {
stopwatch = new Stopwatch()..start(); stopwatch = new Stopwatch()..start();
stdout.write('${message.padRight(50)} '); stdout.write('${message.padRight(51)} ');
stdout.write('${_progress[0]}'); stdout.write('${_progress[0]}');
timer = new Timer.periodic(new Duration(milliseconds: 100), _callback); timer = new Timer.periodic(new Duration(milliseconds: 100), _callback);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment