SaveText.Ru

Без имени
  1. class FullScreenImage extends StatefulWidget {
  2.   FullScreenImage(
  3.       {this.name, this.userName, this.altDescription, this.index, Key key})
  4.       : super(key: key);
  5.  
  6.   final String name;
  7.   final String userName;
  8.   final String altDescription;
  9.   final int index;
  10.  
  11.   @override
  12.   _FullScreenImageState createState() => _FullScreenImageState();
  13. }
  14.  
  15. class _FullScreenImageState extends State<FullScreenImage>
  16.     with TickerProviderStateMixin {
  17.   AnimationController _controller;
  18.  
  19.   @override
  20.   void initState() {
  21.     super.initState();
  22.  
  23.     _controller = AnimationController(
  24.       vsync: this,
  25.       duration: const Duration(milliseconds: 1500),
  26.     );
  27.  
  28.     _controller.forward();
  29.   }
  30.  
  31.   void dispose() {
  32.     _controller.dispose();
  33.     super.dispose();
  34.   }
  35.  
  36.   @override
  37.   Widget build(BuildContext context) {
  38.     return Scaffold(
  39.         appBar: AppBar(
  40.           backgroundColor: AppColors.white,
  41.           title: Text('Photo', style: TextStyle(color: AppColors.black)),
  42.           centerTitle: true,
  43.           leading: IconButton(
  44.               icon: Icon(CupertinoIcons.back, color: AppColors.grayChateau),
  45.               onPressed: () {
  46.                 Navigator.pop(context);
  47.               }),
  48.         ),
  49.         body: Column(children: <Widget>[
  50.           _buildItem(),
  51.           Divider(thickness: 2.0, color: AppColors.mercury),
  52.         ]));
  53.   }
  54.  
  55.   Widget _buildItem() {
  56.     return Column(
  57.       crossAxisAlignment: CrossAxisAlignment.start,
  58.       children: <Widget>[
  59.         Hero(
  60.             tag: 'flutterLogo-${widget.index}',
  61.             child: Photo(photoLink: kFlutterDash)),
  62.         _photoDescription(),
  63.         _BuildPhotoMeta(
  64.           name: widget.name,
  65.           userName: widget.userName,
  66.         ),
  67.         _userAction(),
  68.       ],
  69.     );
  70.   }

Share with your friends:

Print