text
stringlengths
1
372
child: opacity(
opacity: 0.2,
child: FlutterLogo(
size: 400,
),
),
);
}
widget _buildContent() {
return column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 16),
..._buildlistitems(),
const spacer(),
_buildGetStartedButton(),
],
);
}
List<Widget> _buildListItems() {
final listItems = <widget>[];
for (var i = 0; i < _menuTitles.length; ++i) {
listItems.add(
AnimatedBuilder(
animation: _staggeredController,
builder: (context, child) {
final animationPercent = Curves.easeOut.transform(
_itemSlideIntervals[i].transform(_staggeredController.value),
);
final opacity = animationPercent;
final slideDistance = (1.0 - animationPercent) * 150;
return opacity(
opacity: opacity,
child: transform.translate(
offset: Offset(slideDistance, 0),
child: child,
),
);
},
child: padding(
padding: const EdgeInsets.symmetric(horizontal: 36, vertical: 16),
child: text(
_menuTitles[i],
textAlign: TextAlign.left,
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
),
),
),
),
);
}
return listItems;
}
widget _buildGetStartedButton() {
return SizedBox(
width: double.infinity,
child: padding(
padding: const EdgeInsets.all(24),
child: AnimatedBuilder(
animation: _staggeredController,
builder: (context, child) {
final animationPercent = Curves.elasticOut.transform(
_buttonInterval.transform(_staggeredController.value));
final opacity = animationPercent.clamp(0.0, 1.0);
final scale = (animationpercent * 0.5) + 0.5;
return opacity(
opacity: opacity,
child: transform.scale(
scale: scale,
child: child,
),
);
},
child: ElevatedButton(
style: ElevatedButton.styleFrom(
shape: const StadiumBorder(),
backgroundColor: colors.blue,
padding: const EdgeInsets.symmetric(horizontal: 48, vertical: 14),
),
onPressed: () {},
child: const text(
'get started',
style: TextStyle(
color: colors.white,
fontSize: 22,
),
),
),
),
),
);
}
}
<code_end>
<topic_end>
<topic_start>
animations API overview
the animation system in flutter is based on typed