Gerry
Gerry

Reputation: 1479

Text over multiple lines flutter

I need to include a list of all the third party libraries I've used and thinking of just pasting all the licences into a string but I can't have a string over multiple lines in flutter.

  String licences = 'asfasdf
  asdf';

The above is an example and this shows an error: Expected to find ';'.dart(expected_token) Unterminated string literal.dart(unterminated_string_literal)

How can I achieve this so I can paste all the licences into a string?

Upvotes: 1

Views: 3366

Answers (1)

Aldair Sanchez
Aldair Sanchez

Reputation: 81

You can use triple quote for multiple lines

String licences = '''asfasdf
                     asdf''';

https://api.dart.dev/stable/2.8.0/dart-core/String-class.html

Upvotes: 4

Related Questions