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
extension IterableExtension<T> on Iterable<T?> { | |
List<T> makeSafe() { | |
return where((element) => element != null).cast<T>().toList(); | |
} | |
} | |
class VB10ViewModel { | |
List<User> dummyListToSafe() { | |
final userList = <User?>[ | |
const User(), |
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
extension on String { | |
/// Decode your [jsonString] value with safety | |
Future<dynamic> safeJsonDecodeCompute() async { | |
try { | |
return await compute<String, dynamic>( | |
jsonDecode, | |
this, | |
); | |
} catch (e) { | |
Logger().e('Json decode error'); |
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
"explorer.fileNesting.patterns": { | |
"pubspec.yaml": ".flutter-plugins, .packages, .dart_tool, .flutter-plugins-dependencies, .metadata, .packages, pubspec.lock, build.yaml, analysis_options.yaml, all_lint_rules.yaml", | |
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*", | |
"readme.*": "authors, backers.md, changelog*, citation*, code_of_conduct.md, codeowners, contributing.md, contributors, copying, credits, governance.md, history.md, license*, maintainers, readme*, security.md, sponsors.md", | |
"*.dart": "$(capture).g.dart, $(capture).freezed.dart", | |
}, | |
"[dart]": { | |
"editor.formatOnSave": true, | |
"editor.formatOnType": true, | |
"editor.rulers": [ |
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
extension IntExtension on int? { | |
StatusCode get httpStatusCode { | |
if (this == null) return StatusCode.unknown; | |
switch (this!) { | |
case < 200: | |
return StatusCode.continue_; | |
case >= 200 && <= 300: | |
return StatusCode.ok; | |
case 401: |
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 requests | |
import json | |
# GitHub API'ya gönderilecek olan veriler | |
base_url = "https://api.github.com/repos/{owner}/{repo}" | |
owner = "vb10" | |
repo = "2023-staj" | |
comment_body = f"""Merhaba arkadaşlar, sizler için elimden geldiğince herkese yazdım, LinkedIn postları paylaştım ve elimden gelen bir çok arkadaşa erişip staj bulmasına yardımcı oldum. Bu saate kadar size verebileceğim 'ben olsaydım' diyeceğim: | |
- Bu repoyu LinkedIn'de paylaşıp sadece kendim için değil, benim gibi arkadaşlar için staj arıyoruz demeniz. |
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 _LoginViewState extends State<LoginView> with LoginController { | |
late final ClearTextAction textAction; | |
late final ControllerCleaner _controllerCleaner; | |
String _value = ''; | |
@override | |
void initState() { | |
super.initState(); | |
textAction = ClearTextAction(); | |
_controllerCleaner = ControllerCleaner(textAction); | |
} |
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 CompleteDialogInherited extends InheritedWidget { | |
CompleteDialogInherited({ | |
required super.child, | |
super.key, | |
}); | |
static CompleteDialogInherited of(BuildContext context) { | |
final result = | |
context.dependOnInheritedWidgetOfExactType<CompleteDialogInherited>(); | |
assert(result != null, 'No CompleteDialogInherited found in 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
[ | |
{ | |
"city": "Adana", | |
"name": "Bahçe?ehir Koleji", | |
"url": "https://twitter.com/zeydankaralar01/status/1622644817506205709?s=46&t=BPAhJVUaSEp-FhJyk7mw2A", | |
"validation_date": "08/02/2023", | |
"latitude": "37.0185766", | |
"longitude": "35.2510051" | |
}, | |
{ |
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 GlobalException { | |
static Future<T?> make<T>(AsyncValueGetter<T?> onOperation) async { | |
try { | |
final response = await onOperation.call(); | |
if (response == null) { | |
throw Exception('$T data is null $response'); | |
} | |
return response; | |
} catch (e) { | |
//logger |
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 'package:kartal/kartal.dart'; | |
class AnimatedPageSwitch extends StatelessWidget { | |
const AnimatedPageSwitch( | |
{super.key, | |
required this.isPageLoaded, | |
required this.loaderChild, | |
required this.completedChild}); | |
final bool isPageLoaded; |