Adding a rotate method to Position and a drawWhere method to utils

This commit is contained in:
Luan Nico
2017-12-30 21:59:45 -02:00
parent fbaec30724
commit 5eee726d92
2 changed files with 16 additions and 0 deletions

View File

@ -5,6 +5,8 @@ import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart' as material;
import 'package:flutter/services.dart';
import 'position.dart';
class Util {
void fullScreen() {
SystemChrome.setEnabledSystemUIOverlays([]);
@ -46,4 +48,10 @@ class Util {
}
});
}
void drawWhere(Canvas c, Position p, void Function(Canvas) fn) {
c.translate(p.x, p.y);
fn(c);
c.translate(-p.x, -p.y);
}
}