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
Future<T> _reAuthenticate<T>(GenericRequestObject request) async { | |
var remainingTries = MAX_REMAINING_LENGTH; | |
do { | |
remainingTries--; | |
try { | |
return await request.fetch(); | |
} on ErrorModel catch (e) { | |
if (e.statusCode == 401) { | |
final response = await refreshToken(); | |
SharedManager().token = response.data.token; |
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
//https://stackoverflow.com/questions/61263795/flutter-raisedbutton-stays-null | |
import 'package:flutter/material.dart'; | |
class FormValidationView extends StatefulWidget { | |
@override | |
_FormValidationViewState createState() => _FormValidationViewState(); | |
} | |
class _FormValidationViewState extends State<FormValidationView> { | |
TextEditingController _userNameController; |
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 'package:flutter/material.dart'; | |
class GridFabView extends StatefulWidget { | |
@override | |
_GridFabViewState createState() => _GridFabViewState(); | |
} | |
class _GridFabViewState extends State<GridFabView> { | |
@override | |
Widget build(BuildContext context) { |
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 'package:flutter/material.dart'; | |
import 'custom_card.dart'; | |
class SwitchView extends StatefulWidget { | |
@override | |
_SwitchViewState createState() => _SwitchViewState(); | |
} | |
class _SwitchViewState extends State<SwitchView> { |
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
abstract class BaseModel<T> { | |
Map<String, Object> toJson(); | |
T fromJson(Map<String, Object> json); | |
} |
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 'package:flutter/material.dart'; | |
main(List<String> args) { | |
runApp(MaterialApp( | |
home: new Scaffold( | |
appBar: AppBar( | |
title: Text("Flutter Dersleri"), | |
), | |
floatingActionButton: FloatingActionButton( | |
onPressed: () {}, |
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
{ | |
"Magic number": { | |
"scope": "dart", | |
"prefix": "hwaMagicNumber", | |
"body": "static const $1 = $2;", | |
"description": "Hwa Magic Number Create" | |
}, | |
"Singleton Eager": { | |
"scope": "dart", | |
"prefix": "hwaEager", |
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 ApplicationConstants { | |
static const LANG_ASSET_PATH = "asset/lang"; | |
static const IPAD_NAME = "IPAD"; | |
} |
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
{ | |
"Magic number": { | |
"scope": "dart", | |
"prefix": "hwaMagicNumber", | |
"body": "static const $1 = $2;", | |
"description": "Hwa Magic Number Create" | |
}, | |
"SIngleton Eager": { | |
"scope": "dart", |
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 'dart:convert'; | |
import 'dart:io'; | |
main() { | |
print('1 + 1 = ...'); | |
var line = stdin.readLineSync(encoding: Encoding.getByName('utf-8')); | |
print(line.trim() == '2' ? 'Yup!' : 'Nope :('); | |
} |