Last active
April 7, 2018 21:49
-
-
Save scheglov/4aed80727855aafd627cd4137dfeeea7 to your computer and use it in GitHub Desktop.
Example of Flutter code to demonstrate Flutter Outline with preview.
This file contains hidden or 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'; | |
class MyWidget extends StatelessWidget { | |
final String firstText; | |
MyWidget(this.firstText); | |
factory MyWidget.forDesignTime() { | |
return new MyWidget('AA'); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return new Column( | |
crossAxisAlignment: CrossAxisAlignment.center, | |
children: <Widget>[ | |
buildText(firstText), | |
buildText('BBBB'), | |
buildText('CCCCCC'), | |
buildText('DDDDDDDD'), | |
], | |
); | |
} | |
Text buildText(String text) { | |
return new Text(text, style: const TextStyle(fontSize: 24.0)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment