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
/* | |
* This class assumes that you use both RXJava and Dagger 2 in your project | |
* | |
*/ | |
public abstract class BaseLocalService<T> { | |
protected ResourceProvider mResourceProvider; | |
protected Gson mGson; |
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:math'; | |
import 'dart:typed_data'; | |
import "package:pointycastle/export.dart"; | |
import "package:asn1lib/asn1lib.dart"; | |
List<int> decodePEM(String pem) { | |
var startsWith = [ | |
"-----BEGIN PUBLIC KEY-----", | |
"-----BEGIN PRIVATE KEY-----", |
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
Debug mode on device (including simulators, emulators): | |
Turns on all the assertions in the world, includes all debugging information, enables all the debugger aids (e.g. observatory) and service extensions. | |
Optimizes for fast develop/run cycles. Does not optimize for execution speed, binary size, or deployment. | |
Used by flutter run. Built with sky/tools/gn --android or sky/tools/gn --ios. | |
Also sometimes called "checked mode" or "slow mode". |
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
// file: src/firebase_login.dart | |
class LoginManager { | |
LoginManager._(); | |
static final LoginManager instance = LoginManager._(); | |
String login(String username, String password) => "Firebased $username"; | |
} |
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
// file: src/server_login.dart | |
class LoginManager { | |
LoginManager._(); | |
static final LoginManager instance = LoginManager._(); | |
String login(String username, String password) => "Servered $username"; | |
} |
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
#!/bin/bash | |
BLUE='\x1b[34m\x1b[1m' | |
NC='\x1b[0m' # No Color | |
echo "" | |
printf "${BLUE}[ 🏗️ ] Build models${NC} \n" | |
cd modules/models | |
flutter packages pub run build_runner build --delete-conflicting-outputs | |
cd ../.. |
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
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override |
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
enum StarterPokemonEnum { bulbasaur, charmander, squirtle, } | |
/// This extension will give us the possibility to return a String | |
/// when we call the [name] getter | |
extension StarterPokemonToString on StarterPokemonEnum { | |
String get name { | |
switch (this) { | |
case StarterPokemonEnum.bulbasaur: | |
return "Bulbasaur"; | |
case StarterPokemonEnum.charmander: |