Skip to content

Instantly share code, notes, and snippets.

@mono0926
Last active April 17, 2019 04:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mono0926/c488daaa3fd121b4075fec9408f17506 to your computer and use it in GitHub Desktop.
Save mono0926/c488daaa3fd121b4075fec9408f17506 to your computer and use it in GitHub Desktop.
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