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
// GOOD | |
void main() { } | |
_Foo _bar() => _Foo(); | |
class _Foo { | |
int _foo() => 42; | |
} |
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
// BAD | |
main() { } | |
_bar() => _Foo(); | |
class _Foo { | |
_foo() => 42; | |
} |
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
linter: | |
rules: | |
- always_declare_return_types | |
- always_put_control_body_on_new_line |
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
linter: | |
rules: | |
- always_declare_return_types | |
- always_put_control_body_on_new_line | |
- always_put_required_named_parameters_first | |
- always_require_non_null_named_parameters | |
- always_specify_types | |
- annotate_overrides | |
- avoid_annotating_with_dynamic | |
- avoid_as |
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
class CustomText extends StatelessWidget { | |
final String text; | |
CustomText({ @required this.text }); | |
@override | |
Widget build(BuildContext context) { | |
return Center( | |
child: Text(text), | |
); |
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
class MyCount extends StatefulWidget { | |
@override | |
_MyCountState createState() => _MyCountState(); | |
} | |
class _MyCountState extends State<MyCount> { | |
int _counter = 0; | |
void _incrementCounter() { | |
setState(() { |
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
class CustomText extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Center( | |
child: Text('Flutter'), | |
); | |
} | |
} |
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
import { StatusBar, StatusBarStyle } from 'react-native' | |
import { useEffect } from 'react' | |
function useStatusBar(style: StatusBarStyle) { | |
useEffect(() => { | |
StatusBar.setBarStyle(style, true) | |
}, []) | |
} | |
export default useStatusBar |
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
// Response da query acima | |
{ | |
"data": { | |
"peopleByIdOne": { | |
"name": "Luke Skywalker" | |
}, | |
"peopleByIdTwo": { | |
"name": "C-3PO" | |
} | |
} |
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
# Query que consulta múltiplos dados | |
query { | |
peopleByIdOne: people(id: "1") { | |
name | |
} | |
peopleByIdTwo: people(id: "2") { | |
name | |
} | |
} |