Last active
December 12, 2019 11:23
-
-
Save tirth-aubergine/beee39887554c1fc906a0ee282219ab5 to your computer and use it in GitHub Desktop.
Platypus - export config Utils
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future exportCurrentPlatypusConfig(HomeProvider homeProvider) async { | |
final Directory downloadPath = await getApplicationDocumentsDirectory(); | |
final File configFile = File( | |
'${downloadPath.path}/platypus-config-${DateTime.now().toString()}.json'); | |
final Map<String, dynamic> config = { | |
'horizontal_padding': | |
homeProvider.horizontalPaddingBetweenCodeAndBackground, | |
'vertical_padding': homeProvider.verticalPaddingBetweenCodeAndBackground, | |
'font_size': homeProvider.codeFontSize, | |
'window_circles_style': homeProvider.windowThreeCirclesStyle, | |
'window_circles_position': homeProvider.windowThreeCirclesPosition, | |
'highlight_theme': homeProvider.codeHighlightTheme, | |
'line_height': homeProvider.codeLineHeight, | |
'show_shadow': homeProvider.showShadow, | |
'programming_language': homeProvider.codeProgrammingLanguage, | |
'source_code': homeProvider.codeTextEditingController.text, | |
'background_color': homeProvider.codeBackgroundColor.value, | |
}; | |
final generatedConfigFile = | |
await configFile.writeAsString(jsonEncode(config)); | |
return generatedConfigFile; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment