sudo apt-get install python3-pip
sudo pip3 install virtualenv
import 'package:flutter/material.dart'; | |
import 'dart:math' as math; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
final RegExp email = RegExp( | |
r"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]" | |
r"{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a" | |
r"-zA-Z0-9])?)*$", | |
caseSensitive: false, | |
multiLine: false); | |
final RegExp mobileBrazilianPhone = RegExp(r"^\(?0?\d{2}\)? ?9 ?\d{4}-?\d{4}$", | |
caseSensitive: false, multiLine: false); |
// Copyright 2015 The Chromium Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
import 'dart:async'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/widgets.dart'; |
Disclaimer: This is dumb. If anybody knows a better way, I'm all ears.
You have two Android projects. One is a library and one is an app that depends on that library. Both are on your local machine.
Now, say you want to test the library in the app before you publish it. Here's what you do.
You have an app and a lib:
#!/bin/bash | |
export TKN=$(curl -X POST 'http://localhost:8080/auth/realms/master/protocol/openid-connect/token' \ | |
-H "Content-Type: application/x-www-form-urlencoded" \ | |
-d "username=admin" \ | |
-d 'password=admin' \ | |
-d 'grant_type=password' \ | |
-d 'client_id=admin-cli' | jq -r '.access_token') | |
curl -X GET 'http://localhost:8080/auth/admin/realms' \ |
Pode-se afirmar que no momento Promises são a forma mais "padrão" no momento de se tratar com
assincronismo no JS. Para quem trabalha com javascript, conhecê-las é essencial.
Uma dificuldade comum é que esta API tem uma curva de aprendizado um tanto acentuada de início, especialmente
se comparado com as alternativas mais antigas: callbacks e o módulo async
. No meu caso, levei ao menos uns 3
meses pra "cair a ficha".
-- na verdade promises ainda são um remendo para o problema do assincronismo do JS. Elas ainda possuem certa dificuldade
public class MutableHttpServletRequest extends HttpServletRequestWrapper { | |
private Map<String,String[]> parameters = new HashMap<String,String[]>(); | |
public MutableHttpServletRequest(HttpServletRequest request) { | |
super(request); | |
} | |
public void setParameter(String name, String value) { | |
parameters.put(name, new String[] {value}); |