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:8638b4d7d2b081a063a8c5f3a3f04127
class DataCache {
static final DataCache _dataCache = new DataCache.internal();
factory DataCache() {
return _dataCache;
}
DataCache.internal();
}
View android_app_build_gradel
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
View android_build_gradle
buildscript {
ext.kotlin_version = '1.2.71'
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
View pubspec.yaml
version: 1.1.0+9
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
url_launcher: ^5.0.2
transparent_image: ^1.0.0
View autenticacao.dart
Future<Null> _ensureLoggedIn(String teamID) async {
if (currentUser == null)
// Não está logado
currentUser = await _googleSignIn.signInSilently();
if (currentUser == null) currentUser = await _googleSignIn.signIn();
if (await _auth.currentUser() == null) {
// Verificando se o usuário no Firebase é nulo
GoogleSignInAuthentication credentials =
await _googleSignIn.currentUser.authentication;
// Gerando a chave usando as credenciais do Google
View cidade.dart
import 'package:bloc_pattern/bloc_pattern.dart';
import 'package:flutter/material.dart';
import 'package:minhacidade/domain/cidade_domain.dart';
import 'package:minhacidade/main.dart';
import 'package:transparent_image/transparent_image.dart';
import 'package:minhacidade/blocs/cidade_bloc.dart';
class CidadeDetailPage extends StatefulWidget {
final Cidade cidadeDetail;
View evento_domain.dart
import 'package:dio/dio.dart';
import 'package:minhacidade/utils/config.dart';
import 'package:minhacidade/utils/util.dart';
class Evento {
int id;
String titulo;
String horario;
String valor;
String foto;
View eventos_bloc.dart
import 'dart:async';
import 'package:bloc_pattern/bloc_pattern.dart';
import 'package:rxdart/rxdart.dart';
import 'package:minhacidade/blocs/cidade_bloc.dart';
import 'package:minhacidade/domain/evento_domain.dart';
class EventoBloc extends BlocBase {
final _controller = BehaviorSubject<List<Evento>>();
get stream => _controller.stream;
View eventos.dart
import 'package:bloc_pattern/bloc_pattern.dart';
import 'package:flutter/material.dart';
import 'package:minhacidade/blocs/evento_bloc.dart';
import 'package:minhacidade/pages/evento_page.dart';
import 'package:minhacidade/widgets/card_widget.dart';
class EventosPage extends StatefulWidget {
EventosPage({Key key}) : super(key: key);
_EventosPageState createState() => _EventosPageState();
@guilhermecarvalhocarneiro
guilhermecarvalhocarneiro / main.dart
Created Jul 23, 2019
BottomNavigationBar mantendo o estado dos dados carregados
View main.dart
import 'package:bloc_pattern/bloc_pattern.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:location/location.dart';
import 'package:minhacidade/blocs/atrativo_bloc.dart';
import 'package:minhacidade/blocs/cidade_bloc.dart';
import 'package:minhacidade/blocs/estabelecimento_bloc.dart';
import 'package:minhacidade/blocs/evento_bloc.dart';
import 'package:minhacidade/blocs/foursquare_bloc.dart';
import 'package:minhacidade/blocs/roteiro_bloc.dart';
You can’t perform that action at this time.