Skip to content

Instantly share code, notes, and snippets.

@tiagolpadua
Created August 7, 2020 15:57
Show Gist options
  • Save tiagolpadua/a1c6a998a3a4495e88fbe420c6cf2500 to your computer and use it in GitHub Desktop.
Save tiagolpadua/a1c6a998a3a4495e88fbe420c6cf2500 to your computer and use it in GitHub Desktop.
Annimation Challange
import 'package:bytebank/screens/transfer/list.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() => runApp(BytebankApp());
class BytebankApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
primaryColor: Colors.green[900],
accentColor: Colors.blueAccent[700],
buttonTheme: ButtonThemeData(
buttonColor: Colors.blueAccent[700],
textTheme: ButtonTextTheme.primary,
),
),
home: Dashboard(),
);
}
}
class Dashboard extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Dashboard'),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
FutureBuilder<double>(
initialData: 0.2,
future: Future.delayed(Duration(microseconds: 100))
.then((value) => 1.0),
builder: (context, snapshot) {
debugPrint('${snapshot.data}');
return AnimatedOpacity(
opacity: snapshot.data,
curve: Curves.easeInCubic,
duration: Duration(seconds: 2),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Image.asset('images/bytebank_logo.png'),
),
);
},
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
// new code
padding: EdgeInsets.all(8.0),
height: 100,
width: 150,
color: Theme.of(context).primaryColor,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Icon(
Icons.people,
color: Colors.white,
size: 24.0,
),
Text(
'Contacts',
style: TextStyle(
color: Colors.white,
fontSize: 16.0,
),
),
],
),
),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment