瀏覽代碼

1.清除flutter启动动画的一些代码

tags/0.0.3+6
“yanghuaxuan” 4 年之前
父節點
當前提交
6de43d30c4
共有 8 個檔案被更改,包括 30 行新增88 行删除
  1. 二進制
     
  2. 二進制
     
  3. 二進制
     
  4. 二進制
     
  5. 二進制
     
  6. +27
    -27
      example/android/app/build.gradle
  7. +2
    -59
      lib/pages/home_page/home_page.dart
  8. +1
    -2
      lib/pages/launch_page/launch_page.dart

二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


二進制
查看文件


+ 27
- 27
example/android/app/build.gradle 查看文件

@@ -108,33 +108,33 @@ android {


// 应用信息配置
// productFlavors {
// // 智夜生活
// zhiying {
// applicationId "cn.zhios.zhiying"
// versionCode 22
// dimension "app"
// versionName '1.2.2'
// // 签名信息
// signingConfig signingConfigs.zhiying
// }
// }
//
// // 打包脚本
// android.applicationVariants.all { variant ->
// if (variant.buildType.name != "debug") {
// variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk")
// }
//
// variant.outputs.all { output ->
// def outputFile = output.outputFile
// if (outputFile != null && outputFile.name.endsWith('.apk')) {
// //这里修改apk文件名
// def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk"
// outputFileName = fileName
// }
// }
// }
productFlavors {
// 智夜生活
zhiying {
applicationId "cn.zhios.zhiying"
versionCode 26
dimension "app"
versionName '1.2.26'
// 签名信息
signingConfig signingConfigs.zhiying
}
}
// 打包脚本
android.applicationVariants.all { variant ->
if (variant.buildType.name != "debug") {
variant.getPackageApplicationProvider().get().outputDirectory = new File(project.rootDir.absolutePath + "/app/build/outputs/apk")
}
variant.outputs.all { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
//这里修改apk文件名
def fileName = "${variant.productFlavors[0].name}_${releaseTime()}01_&V${variant.productFlavors[0].versionCode}.apk"
outputFileName = fileName
}
}
}

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->


+ 2
- 59
lib/pages/home_page/home_page.dart 查看文件

@@ -48,46 +48,13 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
int _currentIndex = 0;
List<Map<String, dynamic>> _data = List();
static const EventChannel _eventChannel = const EventChannel('JAVA_TO_FLUTTER');
AnimationController animationController;
Animation<double> scaleAnimation;
Animation<double> opacityAnimation;
double opacity = 1.0;

bool initFinish = false;

double maxRatio = 5.0;

@override
void initState() {
animationController = AnimationController(vsync: this, duration: Duration(milliseconds: 500));
CurvedAnimation curvedAnimation = CurvedAnimation(parent: animationController, curve: Curves.ease);
scaleAnimation = Tween<double>(begin: 1.0, end: maxRatio).animate(curvedAnimation);
opacityAnimation = Tween<double>(begin: 0.7, end: 0).animate(curvedAnimation);
animationController.addListener(() {
print(scaleAnimation.value);

if (scaleAnimation.value == maxRatio) {
// 动画结束后显示弹窗
_showPolicy();
setState(() {});
}
});

///初始化一些数据
initAsync();

///打开动画
// Timer(Duration(milliseconds: 0), () {
// animationController.forward();
// });

///打开动画
Timer(Duration(milliseconds: 1000), () {
initFinish = true;
setState(() {});
});

setState(() {});
super.initState();
}

@@ -108,6 +75,8 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
Constants.isShowIntellectDialog = false;

TaobaoAuth.initAuth(context);
//弹窗
_showPolicy();

Moblink.uploadPrivacyPermissionStatus(1, (bool success) {});
SharesdkPlugin.uploadPrivacyPermissionStatus(1, (bool success) {});
@@ -159,7 +128,6 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
animationController.dispose();
super.dispose();
}

@@ -196,31 +164,6 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker
//底部导航栏
bottomNavigationBar: createBottomNavigationBar(tabs),
);
// return Stack(
// alignment: Alignment.topCenter,
// children: <Widget>[
// Scaffold(
// body: IndexedStack(
// index: _currentIndex,
// children: contentWidgets,
// ),
// //底部导航栏
// bottomNavigationBar: createBottomNavigationBar(tabs),
// ),
// (scaleAnimation.value != maxRatio || !initFinish)
// ? Container(
// height: initFinish?0:null,
// width: double.infinity,
// child: Image.asset(
// 'assets/images/launch_image/launch_image.png',
// package: 'zhiying_base_widget',
// fit: BoxFit.cover,
// ),
// )
// : Container(width: 0
// ,height: 0,)
// ],
// );
}

Widget createBottomNavigationBar(List<Map<String, dynamic>> tabs) {


+ 1
- 2
lib/pages/launch_page/launch_page.dart 查看文件

@@ -36,8 +36,7 @@ class LaunchPage extends StatefulWidget {
_LaunchPageState createState() => _LaunchPageState();
}

class _LaunchPageState extends State<LaunchPage> {
final GlobalKey navigatorKey = new GlobalKey();

class _LaunchPageState extends State<LaunchPage> with TickerProviderStateMixin {
final GlobalKey navigatorKey = new GlobalKey();



Loading…
取消
儲存