티스토리 뷰

728x90

In Flutter, triple single-quotation marks (`'''`) are used to create multi-line string literals, also known as multi-line string constants. This syntax allows you to define a string that spans multiple lines while preserving the line breaks and formatting within the string. This is particularly useful for long strings or strings that contain line breaks, such as text blocks or code snippets.

Here's an example of how to use triple single-quotation marks to create a multi-line string in Flutter:

// >>>Code

String multiLineString = '''
  This is a multi-line string
  in Flutter using triple single-quotation marks.
  It allows you to include line breaks and maintain formatting.
  You can also use it for code blocks or long text.
''';
// <<<Code
In the above example, the `multiLineString` variable contains a multi-line string that spans three lines, and the line breaks and formatting within the string are preserved.

You can use triple single-quotation marks for various purposes, such as defining textual content for your Flutter widgets or embedding code snippets within your Dart code. They provide a convenient way to create well-formatted, multi-line strings in your Flutter applications.

728x90

'DevMobile > Flutter' 카테고리의 다른 글

Widget Tree (Flutter App Structure)  (0) 2023.08.27
댓글
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
글 보관함