Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
58e88a6
Testing implicit animations on docs/codelabs/implicit-animations
legalcodes Aug 21, 2019
9ae73c4
Test ffw example w/o animations
legalcodes Aug 22, 2019
a759e76
Added 3 examples, title, description
legalcodes Sep 30, 2019
a35344d
Merge branch 'master' of https://github.com/flutter/website into impl…
legalcodes Sep 30, 2019
2131bb0
Added static example without diff
legalcodes Oct 2, 2019
f2dedfd
Added first code diff (full file)
legalcodes Oct 2, 2019
b67d770
Added complete instructions for AnimatedOpacity
legalcodes Oct 7, 2019
d089f12
Added AnimatedContainer example instructions
legalcodes Oct 10, 2019
90eb167
Polished language
legalcodes Oct 10, 2019
6f1426a
Merge branch 'master' of https://github.com/flutter/website into impl…
legalcodes Oct 15, 2019
4f37b80
Updated language + added explanation to part 1
legalcodes Oct 16, 2019
47f9459
Added additional step demonstrating how to change animation curve
legalcodes Oct 16, 2019
d94950a
Merge branch 'master' of https://github.com/flutter/website into impl…
legalcodes Oct 16, 2019
6919ef8
Update with suggestions from sfshaza2
legalcodes Oct 21, 2019
86a44c3
Added play button for animations example (still needs resizing)
legalcodes Oct 22, 2019
b59b688
Update instructions for examples
legalcodes Oct 22, 2019
1bfb7f8
Update w/ changes from goderbauer
legalcodes Oct 24, 2019
5c62659
Refreshed code excerpts
legalcodes Oct 24, 2019
194052b
Update section 1 steps w/ summary points throughout.
legalcodes Oct 28, 2019
f7b87a1
Merge branch 'master' of https://github.com/flutter/website into impl…
legalcodes Oct 28, 2019
7440311
Update toc
legalcodes Oct 29, 2019
1978a48
Add google form survey
legalcodes Oct 29, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# markdown-spellcheck spelling configuration file
# Format - lines beginning # are comments
# global dictionary is at the start, file overrides afterwards
# one word per line, to define a file override use ' - filename'
# where filename is relative to this configuration file
codelab
stateful
DartPad
DartPads
ui
ImplicitlyAnimatedWidget
AnimatedOpacity
main.dart
AnimatedContainer
borderRadius
api
codelabs
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ social:
dart-site: https://dart.dev
news: https://news.dartlang.org
api: https://api.flutter.dev
master-api: https://master-api.flutter.dev
pub: https://pub.dev
pub-api: https://pub.dev/documentation
pub-pkg: https://pub.dev/packages
Expand Down
67 changes: 67 additions & 0 deletions examples/animation/implicit/container0/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import 'package:flutter_web/material.dart';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need license headers for all the .dart files?

import 'package:flutter_web_test/flutter_web_test.dart';
import 'package:flutter_web_ui/ui.dart' as ui;
import 'dart:math';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a blank line between package: and dart: imports. Also, the dart: imports should be before the package: imports.


double randomBorderRadius() {
return Random().nextDouble() * 64;
}

double randomMargin() {
return Random().nextDouble() * 64;
}

Color randomColor() {
return Color(0xFFFFFFFF & Random().nextInt(0xFFFFFFFF));
}

class AnimatedContainerDemo extends StatelessWidget {
final color = randomColor();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indent these lines by only two spaces.

final borderRadius = randomBorderRadius();
final margin = randomMargin();

Widget build(BuildContext context) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add: @override

return Scaffold(
body: Center(
child: Column(
children: <Widget>[
SizedBox(
width: 128,
height: 128,
child: Container(
margin: EdgeInsets.all(margin),
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(borderRadius),
),
),
),
MaterialButton(
color: Theme.of(context).primaryColor,
child: Text(
'change',
style: TextStyle(color: Colors.white),
),
onPressed: () => null,
),
],
),
),
);
}
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: AnimatedContainerDemo(),
);
}
}

Future<void> main() async {
await ui.webOnlyInitializePlatform();
runApp(MyApp());
}
77 changes: 77 additions & 0 deletions examples/animation/implicit/container1/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import 'package:flutter_web/material.dart';
import 'package:flutter_web_test/flutter_web_test.dart';
import 'package:flutter_web_ui/ui.dart' as ui;
import 'dart:math';

double randomBorderRadius() {
return Random().nextDouble() * 64;
}

double randomMargin() {
return Random().nextDouble() * 64;
}

Color randomColor() {
return Color(0xFFFFFFFF & Random().nextInt(0xFFFFFFFF));
}

class AnimatedContainerDemo extends StatefulWidget {
_AnimatedContainerDemoState createState() => _AnimatedContainerDemoState();
}

class _AnimatedContainerDemoState extends State<AnimatedContainerDemo> {
Color color;
double borderRadius;
double margin;

initState() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@override
void initState() {
  super.initState();

final color = randomColor();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the "final" on these lines? Not sure what that even means...

final borderRadius = randomBorderRadius();
final margin = randomMargin();
}

Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
children: <Widget>[
SizedBox(
width: 128,
height: 128,
child: Container(
margin: EdgeInsets.all(margin),
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(borderRadius),
),
),
),
MaterialButton(
color: Theme.of(context).primaryColor,
child: Text(
'change',
style: TextStyle(color: Colors.white),
),
onPressed: () => null,
),
],
),
),
);
}
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: AnimatedContainerDemo(),
);
}
}

Future<void> main() async {
await ui.webOnlyInitializePlatform();
runApp(MyApp());
}
89 changes: 89 additions & 0 deletions examples/animation/implicit/container10/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import 'package:flutter_web/material.dart';
import 'package:flutter_web_test/flutter_web_test.dart';
import 'package:flutter_web_ui/ui.dart' as ui;
import 'dart:math';

const _duration = Duration(milliseconds: 400);

double randomBorderRadius() {
return Random().nextDouble() * 64;
}

double randomMargin() {
return Random().nextDouble() * 64;
}

Color randomColor() {
return Color(0xFFFFFFFF & Random().nextInt(0xFFFFFFFF));
}

class AnimatedContainerDemo extends StatefulWidget {
_AnimatedContainerDemoState createState() => _AnimatedContainerDemoState();
}

class _AnimatedContainerDemoState extends State<AnimatedContainerDemo> {
Color color;
double borderRadius;
double margin;

void initState() {
super.initState();
color = Colors.deepPurple;
borderRadius = randomBorderRadius();
margin = randomMargin();
}

void change() {
setState(() {
color = randomColor();
borderRadius = randomBorderRadius();
margin = randomMargin();
});
}

Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
children: <Widget>[
SizedBox(
width: 128,
height: 128,
child: AnimatedContainer(
margin: EdgeInsets.all(margin),
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(borderRadius),
),
duration: _duration,
),
),
MaterialButton(
color: Theme.of(context).primaryColor,
child: Text(
'change',
style: TextStyle(color: Colors.white),
),
onPressed: () => change(),
),
],
),
),
);
}
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: AnimatedContainerDemo(),
);
}
}

Future<void> main() async {
await ui.webOnlyInitializePlatform();
runApp(MyApp());
}
77 changes: 77 additions & 0 deletions examples/animation/implicit/container2/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import 'package:flutter_web/material.dart';
import 'package:flutter_web_test/flutter_web_test.dart';
import 'package:flutter_web_ui/ui.dart' as ui;
import 'dart:math';

double randomBorderRadius() {
return Random().nextDouble() * 64;
}

double randomMargin() {
return Random().nextDouble() * 64;
}

Color randomColor() {
return Color(0xFFFFFFFF & Random().nextInt(0xFFFFFFFF));
}

class AnimatedContainerDemo extends StatefulWidget {
_AnimatedContainerDemoState createState() => _AnimatedContainerDemoState();
}

class _AnimatedContainerDemoState extends State<AnimatedContainerDemo> {
Color color;
double borderRadius;
double margin;

initState() {
final color = randomColor();
final borderRadius = randomBorderRadius();
final margin = randomMargin();
}

Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
children: <Widget>[
SizedBox(
width: 128,
height: 128,
child: AnimatedContainer(
margin: EdgeInsets.all(margin),
decoration: BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(borderRadius),
),
),
),
MaterialButton(
color: Theme.of(context).primaryColor,
child: Text(
'change',
style: TextStyle(color: Colors.white),
),
onPressed: () => null,
),
],
),
),
);
}
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: AnimatedContainerDemo(),
);
}
}

Future<void> main() async {
await ui.webOnlyInitializePlatform();
runApp(MyApp());
}
Loading