question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a stful-page live template

See original GitHub issue

Suggestion

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:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
branflake2267commented, Apr 22, 2017

Thanks @stevemessick. Good tips on sharing with export/import. The patterns are young, it’ll be fun to see how they grow.

0reactions
alexander-doroshkocommented, Apr 21, 2017

I wonder if there is a simple way to share files that define templates and can just be dropped into an IntelliJ installation?

File -> Export Settings (uncheck all except Live Templates), File ->Import Settings.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found