Line data Source code
1 : /// Organizer is an abstract model which helps to 2 : /// structure Categories, WidgetElements and Stories in the folder tree. 3 : abstract class Organizer { 4 : /// Used to display the name of the Folder or WidgetElement 5 : final String name; 6 : 7 : /// Used for navigation and matching hot reloaded elements with existing 8 2 : String get path { 9 6 : String path = name.replaceAll(' ', '-').toLowerCase(); 10 2 : Organizer? current = parent; 11 1 : while (current?.parent != null) { 12 4 : path = '${current!.name.replaceAll(' ', '-').toLowerCase()}${'/$path'}'; 13 1 : current = current.parent; 14 : } 15 : return path; 16 : } 17 : 18 : /// The Organizer hosting this element. 19 : Organizer? parent; 20 : 21 2 : Organizer(this.name); 22 : }