Skip to content

Instantly share code, notes, and snippets.

View felipecastrosales's full-sized avatar
🏆
Trabalhe, sirva, seja forte e não encha o saco!

Felipe Sales felipecastrosales

🏆
Trabalhe, sirva, seja forte e não encha o saco!
View GitHub Profile
@felipecastrosales
felipecastrosales / my_clipper.dart
Created January 19, 2023 00:02
my_clipper.dart
class MyClipper extends CustomClipper<Path> {
final double _borderRadius;
final double _angle;
MyClipper({
double? borderRadius,
double? angle,
}) : _borderRadius = borderRadius ?? .1,
_angle = angle ?? degToRad(80);
void main() {
var a = 'A';
var b = 'B';
var page1 = 'A';
var page2 = 'B';
var page1Impl = page1 == a;
var page2Impl = page2 == a;
@felipecastrosales
felipecastrosales / column_row_center.dart
Created January 4, 2023 17:40
column_row_center.dart
import 'package:flutter/material.dart';
void main(){
runApp(const Alinhamento());
}
class Alinhamento extends StatelessWidget {
const Alinhamento({Key? key}) : super(key: key);
import 'package:flutter/material.dart';
class OverlayImage extends StatelessWidget {
const OverlayImage({super.key});
@override
Widget build(BuildContext context) {
return Material(
type: MaterialType.transparency,
child: SafeArea(
import 'dart:io';
import 'package:dialog/overlayimage/overlay.dart';
import 'package:dialog/show_overlay_method.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:network_image_mock/network_image_mock.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
// error
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test:
Navigator operation requested with a context that does not include a Navigator.
The context used to push or pop routes from the Navigator must be that of a widget that is a
descendant of a Navigator widget.
// method
import 'package:dialog/overlayimage/overlay.dart';
@felipecastrosales
felipecastrosales / change_value.dart
Last active November 4, 2022 22:37
POC - Change Value
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
@felipecastrosales
felipecastrosales / solid.dart
Last active October 24, 2022 23:50
solid.dart
abstract class Model{}
abstract class DatabaseLocal<T extends Model> {
Future<T> getById();
Future<T> create(T data);
Future<T> update(T data);
Future<T> delete(T data);
Future<T> createIndex(T data);
class Sum {
num add(int a, int b) {
return a + b;
}
}
class Divide {
int divide(int a, int b) {
return a ~/ b;
}
// Player
// Objetivo: Tocar musicas em mais de uma fonte (Spotify e Dezer)
// Construir as classes baseado no principio SOLID e CLEAN para esse player
// 1) search music by artist
// 2) search music by id
// 3) play music
// 4) pause music