Skip to content

Instantly share code, notes, and snippets.

View wendellrocha's full-sized avatar
🎯
Focusing

Wendell Rocha wendellrocha

🎯
Focusing
View GitHub Profile
import "package:intl/intl.dart";
extension FormatDate on DateTime {
/// Receive a date ([DateTime]) and an optional format (dafalts to [Constants.dateFormat])
/// and return a formated date
String formatDate([String format = 'yyyy-MM-dd']) =>
DateFormat(format).format(this);
}
class PostModel {
@wendellrocha
wendellrocha / main.dart
Created November 18, 2022 14:26
ValueListenableBuilder example
// 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
@wendellrocha
wendellrocha / circular_bottom_bar.dart
Created September 13, 2021 17:37
Circular Bottom Bar
// 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 {
/**
* @author Wendell Rocha
*
* This file is required to override the LoginHandler method at server for Google oAuth/Facebook Login API/Apple Login API from enhanced_meteorify package.
* https://github.com/wendellrocha/enhanced_meteorify
*/
Accounts.registerLoginHandler(function (options) {
if (options.googleLoginPlugin || options.facebookLoginPlugin || options.appleLoginPlugin) {
var user;
package adt.queue;
import adt.stack.Stack;
import adt.stack.StackImpl;
import adt.stack.StackOverflowException;
import adt.stack.StackUnderflowException;
public class QueueUsingStack<T> implements Queue<T> {
private Stack<T> stack1;
public void sort(T[] array, int leftIndex, int rightIndex) {
if(array == null || rightIndex > array.length)
throw new IllegalArgumentException();
int gap = rightIndex - leftIndex;
boolean trocou = true;
int i;
while(gap > 1 || trocou) {
if(gap > 1) {
gap = (int) (gap / 1.25);
/**
* Data Structures and Algorithms Laboratory
* Período 2017.1
* @author Wendell Rocha
*/
class ExtendedCoutingSort {
public void sort(Integer[] array, int leftIndex, int rightIndex) {
if(array == null || rightIndex > array.length)
throw new IllegalArgumentException();
/**
* Data Structures and Algorithms Laboratory
* Período 2017.1
* @author Wendell Rocha
*/
import java.util.*;
public class CountingSort {
public void sort(Integer[] array, int leftIndex, int rightIndex) {