Skip to content

Instantly share code, notes, and snippets.

View cristianfb1989's full-sized avatar

Cristian Fabian Bustos cristianfb1989

View GitHub Profile
@uqmessias
uqmessias / devices-model-resolution.md
Last active February 29, 2024 03:27
Some Android devices dimensions
@collinjackson
collinjackson / main.dart
Last active August 17, 2023 20:06
PageView example with dots indicator
// Copyright 2017, the Flutter 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 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(new MyApp());
}
@sethladd
sethladd / flutter_localized_title.dart
Last active July 29, 2021 08:05
Flutter example of a localized title
// Copyright 2017 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.
// Note: I'm not the original author, I'm sharing via Gist to make
// it easy for folks to check it out. Please email
// [email protected] if you have questions about that.
// A simple "rough and ready" example of localizing a Flutter app.
// Spanish and English (locale language codes 'en' and 'es') are
@branflake2267
branflake2267 / main.dart
Last active May 7, 2021 03:36
Flutter - Navigation Drawer Left or Right
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
@Blasanka
Blasanka / infinite_pageview.dart
Last active November 25, 2019 17:30
This is a example source code for infinite pageview in flutter. Read the tutorial here: https://slcoderlk.blogspot.com/2018/05/motiv-quote-app-pageview-for-swipe.html
import 'package:flutter/material.dart';
void main() => runApp(LimeApp());
class LimeApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Lime',
theme: ThemeData(
class _BiblePageState extends State<BiblePage> {
final scrollDirection = Axis.vertical;
AutoScrollController controller;
@override
void initState() {
super.initState();
controller = AutoScrollController(
viewportBoundaryGetter: () => Rect.fromLTRB(0, 0, 0, MediaQuery.of(context).padding.bottom),
axis: scrollDirection
@roipeker
roipeker / image_color_picker_widget.dart
Last active August 27, 2024 07:51
Basic image pixel color detection in Flutter (supports screenshots of the widget tree)
//////////////////////////////
//
// 2019, roipeker.com
// screencast - demo simple image:
// https://youtu.be/EJyRH4_pY8I
//
// screencast - demo snapshot:
// https://youtu.be/-LxPcL7T61E
//
//////////////////////////////
@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,
@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,
@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;