Skip to content

Instantly share code, notes, and snippets.

View deven98's full-sized avatar
:octocat:
Fluttering away the hours

Deven Joshi deven98

:octocat:
Fluttering away the hours
View GitHub Profile
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
AnimationController controller;
Animation colorAnimation;
Animation sizeAnimation;
@override
void initState() {
super.initState();
controller = AnimationController(vsync: this, duration: Duration(seconds: 2));
colorAnimation = ColorTween(begin: Colors.blue, end: Colors.yellow).animate(controller);
sizeAnimation = Tween<double>(begin: 100.0, end: 200.0).animate(controller);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Animation Demo"),
),
body: Center(
child: Container(
height: sizeAnimation.value,
width: sizeAnimation.value,
// In initState
controller.addListener(() {
setState(() {});
});
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
double x = 0;
double y = 0;
double z = 0;
class _DiamondBorder extends ShapeBorder {
const _DiamondBorder();
@override
EdgeInsetsGeometry get dimensions {
return const EdgeInsets.only();
}
@override
Path getInnerPath(Rect rect, { TextDirection textDirection }) {
class GoogleMapsDemo extends StatefulWidget {
@override
_GoogleMapsDemoState createState() => _GoogleMapsDemoState();
}
class _GoogleMapsDemoState extends State<GoogleMapsDemo> {
GoogleMapController mapController;
Location location = Location();
Marker marker;
class GetLocationPage extends StatefulWidget {
@override
_GetLocationPageState createState() => _GetLocationPageState();
}
class _GetLocationPageState extends State<GetLocationPage> {
var location = new Location();
Map<String, double> userLocation;
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
import 'package:stream_chat_localizations/stream_chat_localizations.dart';
import 'package:flutter_chess_board/flutter_chess_board.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
import 'dart:async';
import 'dart:math';
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
import 'package:stream_chat_localizations/stream_chat_localizations.dart';
import 'package:ezanimation/ezanimation.dart';
void main() async {