From 80cb92db58760ed4dfa0bd0d2c2fe0611acbcb09 Mon Sep 17 00:00:00 2001 From: Kiboom Date: Fri, 21 Feb 2020 18:33:49 +0900 Subject: [PATCH 1/2] Fixed duplicate commas after BoxShadow in TextStyle --- src/text_style.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/text_style.js b/src/text_style.js index 41a6ca5..974aca4 100644 --- a/src/text_style.js +++ b/src/text_style.js @@ -71,9 +71,6 @@ export function toDart(context, textStyle, depth = 1, useName = true) { fontStyleElement = `\n${depthStr}fontStyle: FontStyle.${textStyle.fontStyle},`; } } - if (textStyle.shadows != null) { - shadowElements = `\n${depthStr}shadows: ${boxShadows.toDart(context, textStyle.shadows)},`; - } if (textStyle.letterSpacing != null) { if (!options.skipLetterSpacing(context)) { @@ -88,9 +85,13 @@ export function toDart(context, textStyle, depth = 1, useName = true) { } } } + + if (textStyle.shadows != null) { + shadowElements = `\n${depthStr}shadows: ${boxShadows.toDart(context, textStyle.shadows)}`; + } return `TextStyle( -${depthStr}color: ${color.toDart(context, textStyle.color, 1)},${fontSizeElement}${fontFamilyElement}${fontWeightElement}${fontStyleElement}${letterSpacingElement}${shadowElements}${lineHeightElement} +${depthStr}color: ${color.toDart(context, textStyle.color, 1)},${fontSizeElement}${fontFamilyElement}${fontWeightElement}${fontStyleElement}${letterSpacingElement}${lineHeightElement}${shadowElements} ${endDepthStr})`; } From 7eabe5727d3cd3942fdd7dd61da1fbace53f4f4b Mon Sep 17 00:00:00 2001 From: Kiboom Date: Fri, 21 Feb 2020 18:40:35 +0900 Subject: [PATCH 2/2] update BoxShadow indentation --- src/text_style.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text_style.js b/src/text_style.js index 974aca4..cb2a265 100644 --- a/src/text_style.js +++ b/src/text_style.js @@ -87,7 +87,7 @@ export function toDart(context, textStyle, depth = 1, useName = true) { } if (textStyle.shadows != null) { - shadowElements = `\n${depthStr}shadows: ${boxShadows.toDart(context, textStyle.shadows)}`; + shadowElements = `\n${depthStr}shadows: ${boxShadows.toDart(context, textStyle.shadows, depth + 1)}`; } return `TextStyle(