Last active
March 1, 2019 14:10
-
-
Save ruan65/6246d5042884c1b8bef3a5815133dfbb to your computer and use it in GitHub Desktop.
Android Studio Live Templates code snippets /home/a/.AndroidStudio3.3/config/templates/user.xml on Ubuntu /Users/a/Library/Preferences/AndroidStudio3.3/templates/user.xml on Mac
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
<templateSet group="user"> | |
<template name="imf" value="import 'package:flutter/material.dart';" description="Import flutter material" toReformat="false" toShortenFQNames="true"> | |
<context> | |
<option name="DART" value="true" /> | |
</context> | |
</template> | |
<template name="fblo" value="import 'dart:async'; import 'package:bloc/bloc.dart'; class $name$Bloc extends Bloc<$event$, $state$> { @override $name$State get initialState => null; @override Stream<$name$State> mapEventToState($state$ currentState, $event$ event) { $cursor$ return null; } }" description="flutter bloc class template" toReformat="false" toShortenFQNames="true"> | |
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="event" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="state" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="cursor" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="DART" value="true" /> | |
</context> | |
</template> | |
<template name="bvh" value="library $lib$; import 'dart:convert'; import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; part '$lib$.g.dart';" description="Built value header" toReformat="false" toShortenFQNames="true"> | |
<variable name="lib" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="DART" value="true" /> | |
</context> | |
</template> | |
<template name="bvb" value="abstract class $className$ implements Built<$className$, $className$Builder> { String get brand; $className$._(); factory $className$([updates($className$Builder b)]) = _${$className$}; }" description="built value body" toReformat="false" toShortenFQNames="true"> | |
<variable name="className" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="DART" value="true" /> | |
</context> | |
</template> | |
<template name="slw" value="import 'package:flutter/material.dart'; class $class$Widget extends StatelessWidget { @override Widget build(BuildContext context) => $outer$( ); }" description="Stateless widget" toReformat="false" toShortenFQNames="true"> | |
<variable name="class" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="outer" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="DART" value="true" /> | |
</context> | |
</template> | |
<template name="sfw" value="import 'package:flutter/material.dart'; class $className$ extends StatefulWidget { @override State<StatefulWidget> createState() => _$className$State(); } class _$className$State extends State<$className$> { @override Widget build(BuildContext context) => $widget$( ); }" description="Flutter Statefull widget" toReformat="false" toShortenFQNames="true"> | |
<variable name="className" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="widget" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="DART" value="true" /> | |
</context> | |
</template> | |
<template name="equ" value="import 'package:equatable/equatable.dart'; abstract class $class$Event extends Equatable { $class$Event([List props = const []]) : super(props); }" description="Equatable abstract class for events" toReformat="false" toShortenFQNames="true"> | |
<variable name="class" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="DART" value="true" /> | |
</context> | |
</template> | |
<template name="bv" value="abstract class $CLASS_NAME$ implements Built<$CLASS_NAME$, $CLASS_NAME$Builder> { $CLASS_NAME$._(); factory $CLASS_NAME$([updates($CLASS_NAME$Builder b)]) = _$$$CLASS_NAME$; }" description="Built value class" toReformat="false" toShortenFQNames="true"> | |
<variable name="CLASS_NAME" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="DART_TOPLEVEL" value="true" /> | |
</context> | |
</template> | |
<template name="bvs" value="library serializers; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:built_collection/built_collection.dart'; import 'article.dart'; part 'serializers.g.dart'; @SerializersFor(const [ ]) final Serializers serializers = _$serializers; Serializers standardSerializers = (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build();" description="Build value serializers" toReformat="false" toShortenFQNames="true"> | |
<context> | |
<option name="DART_TOPLEVEL" value="true" /> | |
</context> | |
</template> | |
</templateSet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment