Skip to content

Instantly share code, notes, and snippets.

View diegoveloper's full-sized avatar

Diego Velásquez diegoveloper

View GitHub Profile
class Persona {
final String nombre;
final String edad;
//modo 1 , parametros con nombre opcionales
//Persona({this.nombre, this.edad});
//modo 2 , valores obligatorios con posición fija
// Persona(this.nombre, this.edad);
class AnimatedItem extends StatefulWidget {
final String title;
const AnimatedItem({Key key, this.title}) : super(key: key);
@override
_AnimatedItemState createState() => _AnimatedItemState();
}
class _AnimatedItemState extends State<AnimatedItem>
class SampleCardList extends StatelessWidget {
final items = 20;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
Expanded(
flex: 2,
double _valorSlider = 50;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
backgroundColor: Colors.grey,
body: SliderTheme(
data: Theme.of(context)
.sliderTheme
void main() {
const Map mymap = {
'status': {
'start': ['Start', 'ok', 'go'],
},
'update': {
'now': ['Start', 'ok', 'go'],
},
'time': [
class _MyPage2State extends State<MyPage2> {
String dropdownValue = "One";
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: DropdownButton<String>(
value: dropdownValue,
onChanged: (String newValue) {
// 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';
import 'package:flutter/material.dart';
class AnimatedLine extends StatefulWidget {
@override
_AnimatedLineState createState() => _AnimatedLineState();
}
class _AnimatedLineState extends State<AnimatedLine>
with SingleTickerProviderStateMixin {
AnimationController _controller;
class Sample2 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Material(
child: CustomScrollView(
slivers: [
SliverPersistentHeader(
delegate: MySliverAppBar(expandedHeight: 200),
pinned: true,
import 'package:flutter/material.dart';
class Sample1 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
drawer: Drawer(),
appBar: MyCustomAppBar(
height: 150,