createNewTemplate method

void createNewTemplate(
  1. String name,
  2. String ratio,
  3. int width,
  4. int height,
)

Implementation

void createNewTemplate(String name, String ratio, int width, int height) {
  _currentTemplate = TemplateModel(
    id: DateTime.now().millisecondsSinceEpoch.toString(),
    name: name,
    ratio: ratio,
    canvas: CanvasModel(
      width: width,
      height: height,
      background: BackgroundModel(type: 'image'),
    ),
    layers: [],
  );
  _selectedLayer = null;
  _isEditing = true;
  notifyListeners();
}