Skip to content

Instantly share code, notes, and snippets.

View pedromassango's full-sized avatar

Pedro Massango pedromassango

View GitHub Profile
@slightfoot
slightfoot / order_progress.dart
Last active July 1, 2023 16:02
Custom Order progress bar example - by Simon Lightfoot - 26/10/2020 - Using keys to access other parts of the UI in your RenderObject
// MIT License
//
// Copyright (c) 2020 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@pedromassango
pedromassango / search_app_bar.dart
Created June 2, 2019 21:36
Fixed issue of Search App Bar
import 'package:flutter/material.dart';
void main() => runApp(SearchAppBar());
class SearchAppBar extends StatefulWidget {
@override
_SearchAppBarState createState() => new _SearchAppBarState();
}
class _SearchAppBarState extends State<SearchAppBar> {
@slightfoot
slightfoot / rubber_range_picker.dart
Last active January 19, 2023 01:09
Rubber Range Picker - Based on https://dribbble.com/shots/6101178-Rubber-Range-Picker-Open-Source by Cuberto - 14th March 2019
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
void main() => runApp(ExampleApp());
class ExampleApp extends StatelessWidget {
@override
@stefanJi
stefanJi / wave_card.dart
Last active February 26, 2022 08:33
flutter wave card example
import 'package:flutter/widgets.dart';
class WaveCard extends StatelessWidget {
WaveCard({Key key, padding: EdgeInsets}) : super(key: key);
@override
Widget build(BuildContext context) {
final painter = WavePainter(Color.fromRGBO(96, 204, 184, 0.2));
return CustomPaint(
painter: painter,
@slightfoot
slightfoot / always_scrollbar.dart
Created March 4, 2019 18:20
Always Visible Scrollbar for Flutter - 4th March 2019
import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primaryColor: Colors.indigo,
@pedromassango
pedromassango / slipt_screen_in_two_parts.dart
Created December 27, 2018 23:11
This code split a flutter app into two parts.
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: <Widget>[
Positioned(
top: 0,
bottom: MediaQuery.of(context).size.height / 2,
width: double.maxFinite,
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@b-cancel
b-cancel / main.dart
Last active November 29, 2021 19:41
FLUTTER => Overriding Back Button in Flutter
import 'package:flutter/material.dart';
import 'dart:async';
void main() => runApp(new BackButtonOverrideDemoWidget());
class BackButtonOverrideDemoWidget extends StatefulWidget{
@override
_BackButtonOverrideDemoWidgetState createState() => new _BackButtonOverrideDemoWidgetState();
}
@slightfoot
slightfoot / bottom_sheet.dart
Last active February 1, 2024 18:24
Modal Bottom Sheet with Input Fields fix for Flutter (Fix issue with overlap with keyboard and fix for tapping to dismiss)
// 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';
@Sloy
Sloy / FirebaseCoroutinesExtensions.kt
Last active January 20, 2021 11:48
Reading Firebase Database as Kotlin coroutines
/*
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING!!!
NO, SERIOUSLY. REAL WARNING!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!