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
// https://gist.github.com/Esgrima/c0d4bff4b0d3909daf8994410cd659ce | |
// https://dartpad.dev/c0d4bff4b0d3909daf8994410cd659ce | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
import 'package:boolean_selector/boolean_selector.dart'; | |
// (TODO: Tip # 1) Consider making frequently used variables/values constants | |
const _fooConst1 = ''; | |
const _fooConst2 = ''; |
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'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
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
class ContactBook { | |
ContactBook._sharedInstance(); | |
static final ContactBook _shared = ContactBook._sharedInstance(); | |
factory ContactBook() => _shared; | |
} |
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
class LoginApi implements LoginApiProtocol { | |
const LoginApi._sharedInstance(); | |
static const LoginApi _shared = LoginApi._sharedInstance(); | |
factory LoginApi.instance() => _shared; | |
@override | |
Future<LoginHandle?> login( | |
{required String email, required String password}) { |
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
[ | |
{ | |
"name": "Foo 2", | |
"age": 20 | |
}, | |
{ | |
"name": "Foo 2", | |
"age": 20 | |
}, | |
{ |
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
[ | |
{ | |
"name": "Foo 1", | |
"age": 20 | |
}, | |
{ | |
"name": "Foo 1", | |
"age": 20 | |
}, | |
{ |
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
// Player | |
AnimatedAlign( | |
alignment: _playerAlignment, | |
duration: Duration(milliseconds: 250), | |
curve: Curves.easeInOut, | |
child: Container( | |
width: 100, | |
height: 100, | |
decoration: BoxDecoration( | |
color: _targetData.color, |
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 'dart:developer' as devtools show log; | |
extension Log on Object { | |
void log() => devtools.log(toString()); | |
} |
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
class StatusCategoryButton extends StatelessWidget { | |
const StatusCategoryButton({ | |
required this.icon, | |
required this.title, | |
Key? key, | |
}) : super(key: key); | |
final String icon; | |
final String title; |
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
return (jsonDecode(response.body) as List) | |
.map((i) => PostModel.fromJson(jsonEncode(i))) | |
.toList(); |