saveFile method

void saveFile()

Save the current content, controller.text to the opened file.

Implementation

void saveFile() {
  if (openedFile == null) {
    throw FlutterError(
      "No file found.\nPlease open a file by providing a valid filePath to the CodeForge widget",
    );
  }
  File(openedFile!).writeAsStringSync(text);
}