Skip to content

Instantly share code, notes, and snippets.

Guilherme de Carvalho Carneiro guilhermecarvalhocarneiro

Block or report user

Report or block guilhermecarvalhocarneiro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:a073b9db0af110067ecd79c273cfd825
return Scaffold(
body: Stack(
children: <Widget>[
CustomScrollView(
slivers: <Widget>[
SliverAppBar(
pinned: true,
leading: Container(),
expandedHeight: 300.0,
flexibleSpace: FlexibleSpaceBar(
View BuidListView
buildListView() {
// Instânciando o Provider do Feed
FeedProvider _feedProvider = Provider.of<FeedProvider>(context);
return ListView.builder(
// Se adicionar um Controller não precisa setar o physics
itemCount: _feedProvider.getItens().length,
shrinkWrap: true,
physics: ClampingScrollPhysics(),
itemBuilder: (context, index) {
var feed = _feedProvider.getItens();
View ExemploCustomScrollView
import 'package:flutter/material.dart';
class ExampleTwo extends StatefulWidget {
ExampleTwo({Key key, this.title}) : super(key: key);
final String title;
@override
_ExampleTwoState createState() => new _ExampleTwoState();
}
View gist:e0df649d497042cb3eab0e5148ee0fe8
return AnimatedOpacity(
opacity: _isVisible ? 1.0 : 0.0,
duration: Duration(milliseconds: 500),
child: Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: GestureDetector(
child: Container(
decoration: BoxDecoration(
View gist:426a5f05310a8c2c23c4431a849512c8
return Visibility(
visible: _isVisible,
child: Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: GestureDetector(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
View gist:2d79b0b69804621416f81d0d293149bc
return Expanded(
child: ListView.builder(
controller: _hideFABController,
itemCount: provider.getItens().length,
itemBuilder: (context, index) {
var feed = provider.getItens();
var post = feed[index];
// passando os dados para o Widget CardView
return feedCardView(post);
},
View gist:c6ee5f3a385fad01715de7a164e440ee
return Scaffold(
body: Stack(
children: <Widget>[
Container(
foregroundDecoration:
BoxDecoration(color: Color(myColorBackgroud)),
child: Column(
children: <Widget>[
buildHeadProfilePage(_usuario, context),
buildGroupProfilePage(_usuario),
View gist:fc8d678893713b39a1e2ba06891e872c
// Versões das libs
// image_picker: ^0.6.2+1
// image_cropper: ^1.1.1
// Função para tirar uma foto ou escolher da galeria
choiceProfilePicture({gallery = false}) async {
File fileImage;
try {
fileImage = await ImagePicker.pickImage(
View gist:d91f991a8fe9cf2277b68660bbc5f040
// Função para tirar uma foto ou escolher da galeria
choiceProfilePicture({gallery = false}) async {
UsuarioProvider _usuarioProvider =
Provider.of<UsuarioProvider>(context, listen: false);
File fileImage;
try {
final Directory savePath = await getExternalStorageDirectory();
final String savePathStr = "${savePath.path}/Pictures/Vestter";
View gist:2cecdbcd9c930c5b645d80889fbcb51b
choiceProfilePicture({gallery = false}) async {
File fileImage;
try {
final Directory savePath = await getApplicationDocumentsDirectory();
final String savePathStr = savePath.path;
fileImage = await ImagePicker.pickImage(
source: gallery ? ImageSource.gallery : ImageSource.camera);
fileImage = await _cropImage(fileImage);
You can’t perform that action at this time.