Skip to content

Instantly share code, notes, and snippets.

@vanpav
vanpav / main.dart
Created March 10, 2020 17:02
Simple custom drawer
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'counter.dart';
void main() => runApp(MyApp());
class MyModel extends ChangeNotifier {
bool isDrawerOpened = false;
@vanpav
vanpav / main.dart
Last active February 6, 2020 19:29
import 'dart:math';
import 'package:flutter/material.dart';
class MyFailureApp extends StatefulWidget{
@override
State<MyFailureApp> createState() => new MyFailureAppState();
}
@vanpav
vanpav / http.js
Last active August 28, 2020 09:20
Small wrapper around Axios lib for post requests in Django
import Promise from 'promise-polyfill';
window.Promise = window.Promise || Promise;
import axios from 'axios';
import qs from 'qs';
const DJANGO_DEFAULTS = {
xsrfCookieName: 'csrftoken',
xsrfHeaderName: 'X-CSRFToken',
headers: {