Last active
April 17, 2019 04:04
-
-
Save mono0926/c488daaa3fd121b4075fec9408f17506 to your computer and use it in GitHub Desktop.
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
import 'package:flutter/material.dart'; | |
import 'widgets.dart'; | |
class ItemizedText extends StatelessWidget { | |
const ItemizedText( | |
this.texts, { | |
Key key, | |
}) : super(key: key); | |
final List<Text> texts; | |
@override | |
Widget build(BuildContext context) { | |
return Column( | |
children: texts | |
.map( | |
(text) => _ItemizedTextRow(text), | |
) | |
.toList(), | |
); | |
} | |
} | |
class _ItemizedTextRow extends StatelessWidget { | |
const _ItemizedTextRow( | |
this.text, { | |
Key key, | |
}) : super(key: key); | |
final Text text; | |
@override | |
Widget build(BuildContext context) { | |
final l10n = L10n.of(context); | |
return Row( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: [ | |
Text( | |
l10n.bullet, | |
style: text.style, | |
), | |
Expanded(child: text), | |
], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment