Add a stful-page live template
See original GitHub issueSuggestion
Add a stful-page live template.
https://gist.github.com/branflake2267/3a27c6597bf8e1819228178b924f433c - source https://www.youtube.com/watch?v=Me7n92nH6FY&index=13&list=PLBbgqtDgdc_RUWUCInIqxpY--C94C6Xjh - used in this video
Version info
13
Example
Something like this would be useful for creating pages quickly.
class $NAME$ extends StatefulWidget {
$NAME$({Key key, this.title}) : super(key: key);
static const String routeName = "/$NAME$";
final String title;
@override
_$NAME$State createState() => new _$NAME$State();
}
/// // 1. After the page has been created, register it with the app routes
/// routes: <String, WidgetBuilder>{
/// $NAME$.routeName: (BuildContext context) => new $NAME$(title: "$NAME$"),
/// },
///
/// // 2. Then this could be used to navigate to the page.
/// Navigator.pushNamed(context, $NAME$.routeName);
///
class _$NAME$State extends State<$NAME$> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
),
body: new Container($END$),
floatingActionButton: new FloatingActionButton(
onPressed: _onFloatingActionButtonPressed,
tooltip: 'Add',
child: new Icon(Icons.add),
),
);
}
void _onFloatingActionButtonPressed() {
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Live templates | IntelliJ IDEA Documentation - JetBrains
To configure live templates, open the Editor | Live Templates page of the IDE settings Ctrl+Alt+S . On the Live Templates page, you...
Read more >How to Add a Page Template | Vision Help Center
A Basic Page Template typically has four widgets on it: Main Menu ... A Form Detail template has all four basic widgets +...
Read more >Bedford template family - Squarespace Help Center
The versatile Bedford template family (Anya, Bedford, Bryant, ... Add full-bleed banner images and videos to the top of your pages, ...
Read more >Creating page templates - Broadcast theme documentation
Page templates hold the content and settings of sections you've customized in the Theme editor. If you create a second FAQ page and...
Read more >How to Create a Full-Width Page in WordPress With a Free ...
1. Use the Fullwidth Templates plugin · 2. Manually add a full-width template to your theme.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @stevemessick. Good tips on sharing with export/import. The patterns are young, it’ll be fun to see how they grow.
File -> Export Settings (uncheck all except Live Templates), File ->Import Settings.