Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 颤振英雄动画在ios上的行为不同_Android_Ios_Flutter_Dart - Fatal编程技术网

Android 颤振英雄动画在ios上的行为不同

Android 颤振英雄动画在ios上的行为不同,android,ios,flutter,dart,Android,Ios,Flutter,Dart,我正在尝试使用英雄动画制作图像。。问题是,它在android中正常运行,但当我在iphone上运行构建时,屏幕从左到右而不是从下到上 import 'package:Minipoc/screens/main_screen.dart'; import 'package:animate_do/animate_do.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart' show ti

我正在尝试使用英雄动画制作图像。。问题是,它在android中正常运行,但当我在iphone上运行构建时,屏幕从左到右而不是从下到上

import 'package:Minipoc/screens/main_screen.dart';
import 'package:animate_do/animate_do.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart' show timeDilation;
import 'package:lottie/lottie.dart';
import '../widgets/carousel_cards.dart';

class Music extends StatefulWidget {
  final int index;
  bool playClick;
  bool show;
  Music({Key key, this.playClick, this.index, this.show}) : super(key: key);

  @override
  _MusicState createState() => _MusicState();
}

class _MusicState extends State<Music> {
  double _currentSliderValue = 20;
  double hig = 400.0;
  Size size;
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    Future.delayed(Duration(seconds: 1)).then((value) {
      setState(() {
        hig = size.height / 8;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    size = MediaQuery.of(context).size;
    return Scaffold(
      body: Container(
        // Set background to blue to emphasize that it's a new route.
        color: Colors.blue,
        //padding: const EdgeInsets.all(16.0),
        alignment: Alignment.bottomCenter,
        child: SingleChildScrollView(
          child: SafeArea(
            child: Stack(
              children: [
                Container(
                  height: size.height,
                  width: size.width,
                  child: Image.asset(
                    "assets/images/Catcandysleep-background.jpg",
                    fit: BoxFit.cover,
                  ),
                ),
                Positioned(
                  top: 10,
                  left: 160,
                  child: Container(
                      height: size.height * 0.06,
                      width: size.width * 0.13,
                      decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(30),
                          image: DecorationImage(
                            image: NetworkImage(
                                'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'),
                            fit: BoxFit.cover,
                          ))),
                ),
                Positioned(
                  top: 60,
                  left: 70,
                  child: Text(
                    "NARRATED BY PAULINE",
                    style: TextStyle(
                        color: Colors.white,
                        fontSize: 30,
                        fontFamily: 'RaeDunnFarmhouseII'),
                  ),
                ),
                Positioned(
                  top: 90,
                  left: 100,
                  child: Container(
                    height: size.height * 0.22,
                    width: size.width * 0.45,
                    decoration: BoxDecoration(
                        borderRadius: BorderRadius.only(
                            bottomLeft: Radius.circular(size.width * 0.05),
                            bottomRight: Radius.circular(size.width * 0.05))),
                    child: ClipRRect(
                      borderRadius: BorderRadius.only(
                          bottomLeft: Radius.circular(size.width * 0.05),
                          bottomRight: Radius.circular(size.width * 0.05)),
                      child: PhotoHero(
                        photo: "assets/images/candycat.png",
                        width: 150.0,
                        index: widget.index,
                        onTap: () {
                          timeDilation = 10.0;
                          Navigator.of(context).pop(setState(() {
                            widget.show = true;
                          }));
                          // Future.delayed(Duration(seconds: 2), () {
                          //   Navigator.push(
                          //       context,
                          //       MaterialPageRoute(
                          //           builder: (context) => MainScreen(
                          //                 playClick: true,
                          //                 currentSliderValue: 50,
                          //               )));
                          // });

                          ///////////////////////////
                        },
                      ),
                    ),
                  ),
                ),
                Column(
                  children: [
                    SizedBox(
                      height: size.height / 1.3,
                    ),
                    Container(
                      width: size.width,
                      height: size.width / 2.2,
                      child: Padding(
                        padding:
                            EdgeInsets.symmetric(horizontal: size.width * 0.1),
                        child: Column(
                          children: [
                            SlideInUp(
                              animate: true,
                              duration: Duration(milliseconds: 200),
                              child: Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Column(
                                    children: [
                                      // SizedBox(
                                      //   height: 25,
                                      // ),
                                      Image.asset(
                                        "assets/images/loop_button_icon.png",
                                        height: 50,
                                        width: 50,
                                      ),
                                    ],
                                  ),
                                  Column(
                                    children: [
                                      // SizedBox(
                                      //   height: 35,
                                      // ),
                                      Icon(
                                        Icons.fast_rewind,
                                        color: Colors.white,
                                        size: 40,
                                      ),
                                    ],
                                  ),
                                  widget.playClick == false
                                      ? GestureDetector(
                                          onTap: () {
                                            Future.delayed(
                                                const Duration(
                                                    milliseconds: 300), () {
                                              setState(() {
                                                widget.playClick = true;
                                                widget.show = true;
                                                _currentSliderValue = 10;
                                              });
                                            });
                                          },
                                          //child: SizedBox(
                                          //  width: 110,
                                          // child: Lottie.asset(
                                          //   notesBigSizeIconAnimation,
                                          //   fit: BoxFit.cover,
                                          //   frameRate: FrameRate.max,
                                          // ),
                                          child: SizedBox(
                                            height: 60,
                                            child: Image.asset(
                                              "assets/images/play_button_icon.png",
                                              fit: BoxFit.cover,
                                            ),
                                          ),
                                        )
                                      : GestureDetector(
                                          onTap: () {
                                            setState(() {
                                              widget.playClick = false;
                                              widget.show = false;
                                              _currentSliderValue = 10;
                                            });
                                          },
                                          child: Column(
                                            children: [
                                              SizedBox(
                                                width: 80,
                                                height: 80,
                                                child: Lottie.asset(
                                                  "assets/json/notes_big.json",
                                                  fit: BoxFit.fill,
                                                  frameRate: FrameRate.max,
                                                ),
                                              ),
                                              SizedBox(
                                                height: 10,
                                              )
                                            ],
                                          )),
                                  Column(
                                    children: [
                                      // SizedBox(
                                      //   height: 35,
                                      // ),
                                      Icon(
                                        Icons.fast_forward,
                                        color: Colors.white,
                                        size: 40,
                                      ),
                                    ],
                                  ),
                                ],
                              ),
                            ),
                            SlideInUp(
                              duration: Duration(milliseconds: 1000),
                              animate: true,
                              child: SliderTheme(
                                data: SliderTheme.of(context).copyWith(
                                  activeTrackColor: Colors.pink,
                                  inactiveTrackColor: Colors.grey,
                                  trackShape: RectangularSliderTrackShape(),
                                  trackHeight: 3.0,
                                  thumbColor: Colors.white,
                                ),
                                child: Slider(
                                  value: _currentSliderValue,
                                  min: 0,
                                  max: 100,
                                  label: _currentSliderValue.round().toString(),
                                  onChanged: (double value) {
                                    setState(() {
                                      _currentSliderValue = value;
                                    });
                                  },
                                ),
                              ),
                            ),
                          ],
                        ),
                      ),
                    ),
                  ],
                )
                // Center(
                //   child: Column(
                //     crossAxisAlignment: CrossAxisAlignment.center,
                //     children: [
                //       Spacer(),
                //       Row(
                //         mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                //         children: [
                //           Column(
                //             children: [
                //               // SizedBox(
                //               //   height: 25,
                //               // ),
                //               Image.asset(
                //                 "assets/images/loop_button_icon.png",
                //                 height: 50,
                //                 width: 50,
                //               ),
                //             ],
                //           ),
                //           Column(
                //             children: [
                //               // SizedBox(
                //               //   height: 35,
                //               // ),
                //               Icon(
                //                 Icons.fast_rewind,
                //                 color: Colors.white,
                //                 size: 40,
                //               ),
                //             ],
                //           ),
                //           //  playClick == false
                //           //?
                //           GestureDetector(
                //             onTap: () {
                //               Future.delayed(const Duration(milliseconds: 300), () {
                //                 // setState(() {
                //                 //   playClick = true;
                //                 //   _currentSliderValue = 10;
                //                 // });
                //               });
                //             },
                //             //child: SizedBox(
                //             //  width: 110,
                //             // child: Lottie.asset(
                //             //   notesBigSizeIconAnimation,
                //             //   fit: BoxFit.cover,
                //             //   frameRate: FrameRate.max,
                //             // ),
                //             child: SizedBox(
                //               height: 70,
                //               child: Image.asset(
                //                 "assets/images/play_button_icon.png",
                //                 fit: BoxFit.cover,
                //               ),
                //             ),
                //           ),
                //           // : GestureDetector(
                //           //     onTap: () {
                //           //       // setState(() {
                //           //       //   playClick = false;
                //           //       //   _currentSliderValue = 10;
                //           //       // });
                //           //     },
                //           //     child: Column(
                //           //       children: [
                //           //         // SizedBox(
                //           //         //   height: 50,
                //           //         // ),
                //           //         Image.asset(
                //           //           "assets/images/rewind_button_icon.png",
                //           //           // width: 70,
                //           //           height: 70,
                //           //           color: Colors.white,
                //           //         ),
                //           //       ],
                //           //     ),
                //           //   ),
                //           Column(
                //             children: [
                //               // SizedBox(
                //               //   height: 35,
                //               // ),
                //               Icon(
                //                 Icons.fast_forward,
                //                 color: Colors.white,
                //                 size: 40,
                //               ),
                //             ],
                //           ),
                //         ],
                //       ),
                //       SliderTheme(
                //         data: SliderTheme.of(context).copyWith(
                //           activeTrackColor: Colors.pink,
                //           inactiveTrackColor: Colors.grey,
                //           trackShape: RectangularSliderTrackShape(),
                //           trackHeight: 3.0,
                //           thumbColor: Colors.white,
                //         ),
                //         child: Slider(
                //           value: _currentSliderValue,
                //           min: 0,
                //           max: 100,
                //           label: _currentSliderValue.round().toString(),
                //           onChanged: (double value) {
                //             // setState(() {
                //             //   _currentSliderValue = value;
                //             // });
                //           },
                //         ),
                //       )
                //     ],
                //   ),
                // ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
import'包:Minipoc/screens/main_screen.dart';
导入“package:animate_do/animate_do.dart”;
进口“包装:颤振/材料.省道”;
导入“包:flatter/scheduler.dart”显示时间膨胀;
导入“包:lottie/lottie.dart”;
导入“../widgets/carousel_cards.dart”;
类音乐扩展了StatefulWidget{
最终整数指数;
布尔播放点击;
布尔秀;
音乐({Key-Key,this.playClick,this.index,this.show}):super(Key:Key);
@凌驾
_MusicState createState();
}
类_MusicState扩展状态{
double _currentSliderValue=20;
双hig=400.0;
大小;
@凌驾
void initState(){
//TODO:实现initState
super.initState();
Future.delayed(持续时间(秒:1))。然后((值){
设置状态(){
hig=尺寸。高度/8;
});
});
}
@凌驾
小部件构建(构建上下文){
size=MediaQuery.of(context).size;
返回脚手架(
主体:容器(
//将背景设置为蓝色,以强调这是一条新路线。
颜色:颜色,蓝色,
//填充:常数边集全部(16.0),
对齐:对齐.bottomCenter,
子:SingleChildScrollView(
儿童:安全区(
子:堆栈(
儿童:[
容器(
高度:size.height,
宽度:size.width,
子:Image.asset(
“assets/images/Catcandysleep background.jpg”,
适合:BoxFit.cover,
),
),
定位(
前10名,
左:160,
子:容器(
高度:size.height*0.06,
宽度:size.width*0.13,
装饰:盒子装饰(
边界半径:边界半径。圆形(30),
图像:装饰图像(
图片:NetworkImage(
'https://flutter.github.io/assets-for-api-docs/assets/widgets/owl-2.jpg'),
适合:BoxFit.cover,
))),
),
定位(
排名:60,
左:70,
子:文本(
“由波林叙述”,
样式:TextStyle(
颜色:颜色,白色,
尺寸:30,
fontFamily:“RaeDunnFarmhouseII”),
),
),
定位(
排名:90,
左:100,,
子:容器(
高度:size.height*0.22,
宽度:size.width*0.45,
装饰:盒子装饰(
borderRadius:仅限borderRadius(
左下角:半径.圆形(尺寸.宽度*0.05),
右下角:半径.圆形(尺寸.宽度*0.05)),
孩子:ClipRRect(
borderRadius:仅限borderRadius(
左下角:半径.圆形(尺寸.宽度*0.05),
右下角:半径.圆形(尺寸.宽度*0.05)),
孩子:摄影英雄(
照片:“assets/images/candycat.png”,
宽度:150.0,
索引:widget.index,
onTap:(){
时间膨胀=10.0;
Navigator.of(context.pop(setState)(){
widget.show=true;
}));
//未来。延迟(持续时间(秒:2),(){
//导航器。推(
//背景,
//材料路线(
//生成器:(上下文)=>主屏幕(
//playClick:对,
//currentSliderValue:50,
//               )));
// });
///////////////////////////
},
),
),
),
),
纵队(
儿童:[
大小盒子(
高度:尺寸。高度/1.3,
),
容器(
宽度:size.width,
高度:尺寸。宽度/2.2,
孩子:填充(
衬垫:
边缘组。对称(水平:尺寸。宽度*0.1),
子:列(
儿童:[
滑梯(
动画:对,
持续时间:持续时间(毫秒:200),
孩子:排(
主轴对准:
MainAxisAlignment.spaceBetween,
儿童:[
纵队(
儿童:[
//大小盒子(
//身高:25,
// ),
影像资产(
“assets/images/loop_button_icon.png”,
身高:50,
宽度:50,