icon_text.dart 845 B

1234567891011121314151617181920212223242526272829
  1. import 'package:douyin_demo/widgets/FavAnimation.dart';
  2. import 'package:flutter/material.dart';
  3. class IconText extends StatelessWidget {
  4. const IconText({Key? key,required this.icon,required this.text}) : super(key: key);
  5. final AnimatedIconWidget icon;
  6. final String text;
  7. @override
  8. Widget build(BuildContext context) {
  9. double rpx = MediaQuery.of(context).size.width / 750;
  10. return Container(
  11. child: Column(
  12. mainAxisSize: MainAxisSize.min,
  13. mainAxisAlignment: MainAxisAlignment.center,
  14. crossAxisAlignment: CrossAxisAlignment.center,
  15. children: [
  16. icon,
  17. Container(
  18. // alignment: Alignment.center,
  19. child: Text(
  20. text,
  21. style: TextStyle(color: Colors.white, fontSize: 25 * rpx),
  22. )),
  23. ],
  24. ),
  25. );
  26. }
  27. }