/// Flutter code sample for AnimatedSize
// This example makes a [Container] react to being touched, causing the child
// of the [AnimatedSize] widget, here a [FlutterLogo], to animate.
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
/// This is the main application widget.
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
static const String _title = 'Flutter Code Sample';
@override
Widget build(BuildContext context) {
return MaterialApp(
title: _title,
home: Scaffold(
appBar: AppBar(title: const Text(_title)),
body: const Center(
child: MyStatefulWidget(),
),
),
);
}
}
/// This is the stateful widget that the main application instantiates.
class MyStatefulWidget extends StatefulWidget {
const MyStatefulWidget({Key? key}) : super(key: key);
@override
_MyStatefulWidgetState createState() => _MyStatefulWid
Flutter动画和运动控件之图片的大小变化AnimatedSize
最新推荐文章于 2024-05-22 23:29:33 发布
这个示例展示了如何在Flutter中创建一个响应触摸的Container,当被触摸时, AnimatedSize widget内的FlutterLogo会进行动画大小变化,动画时间为1秒,曲线为EaseIn。

最低0.47元/天 解锁文章
1956

被折叠的 条评论
为什么被折叠?



