Skip to content

Instantly share code, notes, and snippets.

View braulio94's full-sized avatar
👨‍💻

Braulio Cassule braulio94

👨‍💻
View GitHub Profile
@braulio94
braulio94 / main.dart
Last active June 15, 2021 18:07
Flutter - Making a gradeint app body background using decoration
import 'package:flutter/material.dart';
//
// Created by Braulio Cassule
// 30 December 2017
//
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
Future<Null> _handleSignIn() async {
print("handleSignIn");
try {
GoogleSignInAccount googleUser = await _googleSignIn.signIn();
GoogleSignInAuthentication googleAuth = await googleUser.authentication;
await _auth.signInWithGoogle(
accessToken: googleAuth.accessToken,
idToken: googleAuth.idToken,
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
if (drawable instanceof Animatable2) {
avd = (AnimatedVectorDrawable) drawable;
avd.registerAnimationCallback(new Animatable2.AnimationCallback() {
@Override
public void onAnimationStart(Drawable drawable) {
super.onAnimationStart(drawable);
//Animation started
}
if (drawable instanceof Animatable) {
((Animatable) drawable).start();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
startActivity(new Intent(SplashActivity.this, MainActivity.class));
}
}, 3000);
}
ImageView flagImage = findViewById(R.id.flag_image);
Drawable drawable = flagImage.getDrawable();
AnimatedVectorDrawable avd;
<ImageView
android:id="@+id/flag_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="@drawable/angolan_flag"
android:layout_gravity="center"
android:scaleType="centerCrop"
android:padding="50dp"/>
@braulio94
braulio94 / flutter_navigator.dart
Created February 21, 2018 17:39
Example of navigation and route in flutter
import 'package:flutter/material.dart';
import 'package:test_app/other_page.dart';
void main() => runApp(
new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
primarySwatch: Colors.blue,
),
home: new HomePage(),
@braulio94
braulio94 / google_maps_fkutter
Created November 3, 2018 16:06
exception caught
╞═══════════════════════════════════════════════════════════
[ +18 ms] I/flutter (29191): The following _CompileTimeError was thrown building GoogleMap(dirty, state: _GoogleMapState#5fffc):
[ ] I/flutter (29191): 'file:///C:/Users/Braulio/AppData/Roaming/Pub/Cache/git/plugins-5b45f58ccab7009d473d6c767e9e40ddcabedde3/packages/google_maps_flutter/lib/src/google_map.dart':
[ ] I/flutter (29191): error: line 42 pos 36:
[ ] I/flutter (29191): file:///C:/Users/Braulio/AppData/Roaming/Pub/Cache/git/plugins-5b45f58ccab7009d473d6c767e9e40ddcabedde3/packages/google_maps_flutter/lib/src/google_map.dart:42:36:
[ ] I/flutter (29191): Error: The argument type 'dart.core::Set<invalid-type>' can't be assigned to the parameter type
[ ] I/flutter (29191): 'dart.core::List<#lib1::OneSequenceGestureRecognizer>'.
[ ] I/flutter (29191): Try changing the type of the parameter, or casting the argument to
[ ] I/flutter (29191): 'dart.core::List<#lib1::OneSequenceGestureRecognizer>'.
[
class ClippedCard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ClipPath(
clipper: CardClipper(35.0),
child: Container(
@braulio94
braulio94 / holiday.go
Last active August 21, 2019 19:15
a go SOAP client that consumes a Holiday WebService
package main
import (
"encoding/xml"
"fmt"
"github.com/tiaguinho/gosoap"
"log"
)
type GetHolidaysForMonthResponse struct {