Skip to content

Instantly share code, notes, and snippets.

View cristianfb1989's full-sized avatar

Cristian Fabian Bustos cristianfb1989

View GitHub Profile
@rodydavis
rodydavis / flutter_web_github_workflow.yml
Last active June 19, 2022 11:15
Build and Deploy Flutter Website to Flirebase Hosting
name: Build and Deploy Website
on: push
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
@escamoteur
escamoteur / nextField.dart
Created September 13, 2019 12:22
So easy is it now to implement a next field behavior for forms, meaning that the focus is moved as soon the user tabs the next button on the keyboard
class _MyHomePageState extends State<MyHomePage>
with SingleTickerProviderStateMixin {
TabController _tabController;
FocusScopeNode _node = FocusScopeNode(); /// <-----------------
@override
void initState() {
_tabController = TabController(length: 3, vsync: this);
import 'dart:async';
import 'dart:math' as math;
import 'package:flutter/material.dart';
class AirHockey extends StatefulWidget {
@override
_AirHockeyState createState() => _AirHockeyState();
}
@slightfoot
slightfoot / page_turn.dart
Created September 9, 2019 21:28
Page Turn Effect - By Simon Lightfoot. Replicating this behaviour. https://www.youtube.com/watch?v=JqvtZwIJMLo
// 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:
@lukepighetti
lukepighetti / extents_page_view.dart
Last active January 19, 2025 11:24
Flutter PageView that loads the next/previous page off-screen
import 'package:flutter/gestures.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart' hide PageView;
/// This is copy-pasted from the Flutter framework with a support added for building
/// pages off screen using [Viewport.cacheExtents] and a [LayoutBuilder]
///
/// Based on commit 3932ffb1cd5dfa0c3891c60977ee4f9cd70ade66 on channel dev
// Having this global (mutable) page controller is a bit of a hack. We need it
@roipeker
roipeker / camera_frame_test.dart
Created September 7, 2019 00:02
very quick flutter test, to draw a frame in foreground of the camera.
import 'package:camera/camera.dart';
import 'package:flutter/material.dart';
class CameraFrameTest extends StatefulWidget {
@override
_CameraFrameTestState createState() => _CameraFrameTestState();
}
class _CameraFrameTestState extends State<CameraFrameTest> {
CameraDescription firstCamera;
@slightfoot
slightfoot / multi_select.dart
Last active January 11, 2025 08:28
Multi Select GridView in Flutter - by Simon Lightfoot (Drag to select multiple items) Try now here: https://dartpad.dev/?id=a002dd1e031f5f012f810c6d5da14a11
// 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:
@tudor07
tudor07 / custom_dropdown.dart
Created September 2, 2019 10:15
DropdownButton with custom height for list of options
/// DropdownButton from material.dart does not allow to set a height
/// for the list of options inside it.
/// This is a copy of the Flutter's code which allows setting height also.
/// Once Flutter adds this in the framework this should be removed.
// 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:math' as math;
@Schwusch
Schwusch / tiltable_stack.dart
Last active October 29, 2022 12:58
A tiltable stack, an idea originated from 2dimensions
import 'package:flutter/material.dart';
class TiltableStack extends StatefulWidget {
final List<Widget> children;
final Alignment alignment;
const TiltableStack({
Key key,
this.children,
this.alignment = Alignment.center,
@PetreaLoredana
PetreaLoredana / main.dart
Last active August 8, 2021 13:52
This code generates a screen with a custom bidirectional and infinite scrollable PageView in Flutter. Replace your own assets names. More details can be found on Medium. https://medium.com/p/dfff43649c23/edit
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() => runApp(CustomPageViewApp());
class CustomPageViewApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,