Flutter pattern
create_page
create_page(path, module, page, isResponsive=False) -> dict[list[str], list[str]]
Create the necessary files for a new page in a Flutter module.
This function creates Dart files for UI, binding, and controller layers of a new page in the specified module. It returns the status of each file creation.
Args: - path (str): The file system path where the Flutter project is located. - module (str): The module in which the page will be created. - page (str): The name of the page to be created.
Returns: - dict: A dictionary with two lists, 'File' and 'Status', indicating the names of created files and their creation status respectively.
Source code in izio_cli/pattern/flutter_pattern.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |
getFlutterFlavors
getFlutterFlavors(root: str, flutterProject='loyalty2_0')
Retrieve the list of Flutter modules excluding certain predefined directories.
This function checks for the existence of 'pubspec.yaml' and 'lib' folder in the specified path and then lists all the directories that are considered Flutter modules.
Args: - path (str): The file system path where the Flutter project is located.
Returns: - list: A sorted list of Flutter module names.
Raises: - Exception: If 'pubspec.yaml' or 'lib' folder is not found in the given path.
Source code in izio_cli/pattern/flutter_pattern.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
getFlutterModules
getFlutterModules(path: str)
Retrieve the list of Flutter modules excluding certain predefined directories.
This function checks for the existence of 'pubspec.yaml' and 'lib' folder in the specified path and then lists all the directories that are considered Flutter modules.
Args: - path (str): The file system path where the Flutter project is located.
Returns: - list: A sorted list of Flutter module names.
Raises: - Exception: If 'pubspec.yaml' or 'lib' folder is not found in the given path.
Source code in izio_cli/pattern/flutter_pattern.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
getFlutterPages
getFlutterPages(path: str, module: str)
Retrieve the list of Flutter pages from a specified module.
This function lists all Dart files that end with '_page.dart' in the 'ui' directory of a given module.
Args: - path (str): The file system path where the Flutter project is located. - module (str): The name of the module to search for pages.
Returns: - list: A sorted list of Flutter page names.
Source code in izio_cli/pattern/flutter_pattern.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
getModules
getModules(path: str)
Retrieve the list of Flutter modules from a given path.
This function gets all Flutter module directories in the specified path, as a module. It adds "Cancel" and "New Module" options to the list of modules for user interaction.
Args: - path (str): The file system path where Flutter modules are located.
Returns: - list: A list of module names including "Cancel" and "New Module" options.
Source code in izio_cli/pattern/flutter_pattern.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
new_module
new_module(path, module) -> dict[list[str], list[str]]
Create a new module with subdirectories for a Flutter project.
This function creates a new module directory and all the required subdirectories in the Flutter project. It returns the status of each directory creation.
Args: - path (str): The file system path where the Flutter project is located. - module (str): The name of the module to be created.
Returns: - dict: A dictionary with two lists, 'Directory' and 'status', indicating the names of created directories and their creation status respectively.
Source code in izio_cli/pattern/flutter_pattern.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |