Skip to content

Instantly share code, notes, and snippets.

View darwin-morocho's full-sized avatar

Darwin Morocho darwin-morocho

View GitHub Profile

Ejemplos de datos en Firestore

Colección users:

{
  "id": "uid1234",
  "username": "johndoe",
  "email": "johndoe@example.com",
  "photoUrl": "https://example.com/photo.jpg"
@darwin-morocho
darwin-morocho / main.dart
Created January 26, 2023 16:09
flying-aurora-8609
void main() {
final list = List.generate(10000, (index) => index);
imperative(list);
declarative(list);
}
void imperative(List<int> list) {
final start = DateTime.now();
int result = 0;
import 'package:flutter/material.dart';
import 'package:flutter_meedu/meedu.dart';
import 'package:flutter_meedu/ui.dart';
typedef CounterState = State<int>;
class CounterController extends SimpleNotifier with StateMixin<int> {
CounterController() {
/// initState must be calle before any state update
initState(
{
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false
@darwin-morocho
darwin-morocho / CountryCodes.json
Created March 13, 2022 21:01 — forked from anubhavshrimal/CountryCodes.json
Country and Dial or Phone codes in JSON format
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"
import 'package:flutter/material.dart';
class WithBottomScrollableContent extends StatefulWidget {
final Widget child;
final Widget? bottomContent;
const WithBottomScrollableContent({
Key? key,
required this.child,
this.bottomContent,
}) : super(key: key);
@darwin-morocho
darwin-morocho / login_controller.dart
Last active September 19, 2021 14:36
What is flutter_meedu?
import 'package:flutter_meedu/meedu.dart';
class LoginController extends StateNotifier<LoginState> {
// you need pass an inital state using super
LoginController():super(LoginState.initialState);
void onEmailChanged(String email) {
state = state.copyWith(email: email);
}
@darwin-morocho
darwin-morocho / App.md
Created September 11, 2021 21:52 — forked from kcak11/App.md
Country Codes

Country Codes

List of all Country Codes (ISO & Dialing) sorted in alphabetical order.

@darwin-morocho
darwin-morocho / geolocator_wrapper.dart
Last active September 2, 2022 12:25
Flutter - A class to wrap the static methods of the geolocator plugin, with this you can mock the wrapper for unit testing or widget testing
import 'dart:async';
import 'package:geolocator/geolocator.dart';
class GeolocatorWrapper {
StreamController<Position>? _positionController;
StreamController<bool>? _serviceEnabledController;
StreamSubscription? _positionSubscription, _serviceEnabledSubscription;
/// check if the Location Service is Enabled
Future<bool> get isLocationServiceEnabled => Geolocator.isLocationServiceEnabled();

Crear usuario

adduser username

Agregar permission de administrador

usermod -aG sudo username