I hereby claim:
- I am christopher2k on github.
- I am christopher2k (https://keybase.io/christopher2k) on keybase.
- I have a public key ASBbLb-XbTgjxD_4tBXA5mbRgFfx4b7rGzk3BaomHEsllgo
To claim this, I am signing this object:
@use "sass:color"; | |
@use "sass:math"; | |
@use "sass:map"; | |
@use "theme"; | |
@function generate_color_shades($base_color, $color_name) { | |
$colors: (); | |
$base_lightness: math.ceil(color.lightness($base_color)); | |
// Snippets de code utilisés dans l'article | |
// 1. | |
let myArray = []; | |
// 2. | |
let myArray = []; | |
myArray.push("hello"); | |
myArray.push("world"); | |
myArray.push("today", "is", "a", "beautiful", "day", 44); |
import 'package:flutter/material.dart'; | |
class ListViewWithExtraElements<T> extends StatelessWidget { | |
final List<T> elements; | |
final List<Widget> leadingElements; | |
final List<Widget> trailingElements; | |
final Widget Function(BuildContext context, T element) itemBuilder; | |
ListViewWithExtraElements({ | |
this.leadingElements = const [], |
class Widget extends StatelessWidget { | |
final GlobalKey<ScaffoldState> _drawerKey = GlobalKey(); | |
void _openDrawer () { | |
_drawerKey.currentState.openDrawer(); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( |
class MyWidget extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
backgroundColor: Colors.transparent, | |
elevation: 0, | |
title: const Text('Hello !'), | |
), | |
extendBodyBehindAppBar: true, |
class MyWidget extends StatelessWidget { | |
void _clearStackAndPush (BuildContext context) { | |
Navigator.of(context).pushNamedAndRemoveUntil( | |
'/screen-name', | |
() => false, | |
); | |
} | |
@override | |
Widget build(BuildContext context) { |
I hereby claim:
To claim this, I am signing this object:
// with [email protected] & [email protected] | |
import { combineLatest } from 'rxjs/observable/combineLatest'; | |
import { ajax } from 'rxjs/observable/dom/ajax'; | |
import { tap, map } from 'rxjs/operators'; | |
const BASE_URL = 'http://myurl.com'; | |
// Retour un observable AJAX formé par un argument | |
function loginUserAccordingToData({ someDataThis }) { | |
return ajax.post(`${BASE_URL}/data`, { someDataThis }) |
// with [email protected] & [email protected] | |
import { ajax } from 'rxjs/observable/dom/ajax'; | |
import { tap } from 'rxjs/operators'; | |
const request = ajax.getJSON('http://myurl.com/data') | |
.pipe( | |
tap((jsonData) => console.log(jsonData)) | |
); | |
// Appel HTTP |
const url = 'http://myurl.com'; | |
const options = { method: 'GET' }; | |
// Appel de l'API Fetch | |
fetch(url, options) | |
.then((response) => response.json()) // Récupération des données | |
.then((data) => { // Callback de succès | |
window.alert('SUCCESS'); | |
console.log(data); | |
}) |