|
@@ -48,46 +48,13 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker |
|
|
int _currentIndex = 0; |
|
|
int _currentIndex = 0; |
|
|
List<Map<String, dynamic>> _data = List(); |
|
|
List<Map<String, dynamic>> _data = List(); |
|
|
static const EventChannel _eventChannel = const EventChannel('JAVA_TO_FLUTTER'); |
|
|
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 |
|
|
@override |
|
|
void initState() { |
|
|
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(); |
|
|
initAsync(); |
|
|
|
|
|
|
|
|
///打开动画 |
|
|
|
|
|
// Timer(Duration(milliseconds: 0), () { |
|
|
|
|
|
// animationController.forward(); |
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
///打开动画 |
|
|
|
|
|
Timer(Duration(milliseconds: 1000), () { |
|
|
|
|
|
initFinish = true; |
|
|
|
|
|
setState(() {}); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
setState(() {}); |
|
|
|
|
|
super.initState(); |
|
|
super.initState(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -108,6 +75,8 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker |
|
|
Constants.isShowIntellectDialog = false; |
|
|
Constants.isShowIntellectDialog = false; |
|
|
|
|
|
|
|
|
TaobaoAuth.initAuth(context); |
|
|
TaobaoAuth.initAuth(context); |
|
|
|
|
|
//弹窗 |
|
|
|
|
|
_showPolicy(); |
|
|
|
|
|
|
|
|
Moblink.uploadPrivacyPermissionStatus(1, (bool success) {}); |
|
|
Moblink.uploadPrivacyPermissionStatus(1, (bool success) {}); |
|
|
SharesdkPlugin.uploadPrivacyPermissionStatus(1, (bool success) {}); |
|
|
SharesdkPlugin.uploadPrivacyPermissionStatus(1, (bool success) {}); |
|
@@ -159,7 +128,6 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker |
|
|
@override |
|
|
@override |
|
|
void dispose() { |
|
|
void dispose() { |
|
|
WidgetsBinding.instance.removeObserver(this); |
|
|
WidgetsBinding.instance.removeObserver(this); |
|
|
animationController.dispose(); |
|
|
|
|
|
super.dispose(); |
|
|
super.dispose(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -196,31 +164,6 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver, Ticker |
|
|
//底部导航栏 |
|
|
//底部导航栏 |
|
|
bottomNavigationBar: createBottomNavigationBar(tabs), |
|
|
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) { |
|
|
Widget createBottomNavigationBar(List<Map<String, dynamic>> tabs) { |
|
|