Skip to content

Instantly share code, notes, and snippets.

@tirth-aubergine tirth-aubergine/utils.dart
Last active Dec 12, 2019

Embed
What would you like to do?
Platypus - export config Utils
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
You can’t perform that action at this time.