|
|
@@ -5,12 +5,9 @@ import 'package:flutter/material.dart'; |
|
|
|
import 'package:provider/provider.dart'; |
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/intellect_create.dart'; |
|
|
|
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_goods_dialog.dart'; |
|
|
|
import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/intellect_search_no_goods_dialog.dart'; |
|
|
|
import 'package:zhiying_base_widget/pages/main_page/main_page_bloc.dart'; |
|
|
|
import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_bg_notifier.dart'; |
|
|
|
import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_notifier.dart'; |
|
|
|
import 'package:zhiying_base_widget/utils/contants.dart'; |
|
|
|
import 'package:zhiying_base_widget/widgets/home/home_auth/home_auth.dart'; |
|
|
|
import 'package:zhiying_base_widget/widgets/others/mine_header_bg_widget.dart'; |
|
|
|
import 'package:zhiying_base_widget/widgets/refresh/refresh_header/refresh_header.dart'; |
|
|
@@ -20,7 +17,8 @@ import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
|
class MainPage extends StatefulWidget { |
|
|
|
final Map<String, dynamic> data; |
|
|
|
|
|
|
|
MainPage(this.data, { |
|
|
|
MainPage( |
|
|
|
this.data, { |
|
|
|
Key key, |
|
|
|
}) : super(key: key); |
|
|
|
|
|
|
@@ -59,7 +57,7 @@ class _MainPageContainerState extends State<_MainPageContainer> |
|
|
|
ScrollController _controller = ScrollController(); |
|
|
|
MainPageBloc _bloc; |
|
|
|
RefreshController _refreshController = |
|
|
|
RefreshController(initialRefresh: false); |
|
|
|
RefreshController(initialRefresh: false); |
|
|
|
|
|
|
|
Widget _floatWidget; |
|
|
|
|
|
|
@@ -81,7 +79,12 @@ class _MainPageContainerState extends State<_MainPageContainer> |
|
|
|
@override |
|
|
|
void didChangeAppLifecycleState(AppLifecycleState state) async { |
|
|
|
///智能粘贴板 |
|
|
|
IntellectCreate.checkAndCreate(state, context); |
|
|
|
String indentifier = widget.data['skip_identifier']; |
|
|
|
if (indentifier == 'pub.flutter.index') { |
|
|
|
// 只在首页弹窗 |
|
|
|
IntellectCreate.checkAndCreate(state, context); |
|
|
|
} |
|
|
|
|
|
|
|
super.didChangeAppLifecycleState(state); |
|
|
|
} |
|
|
|
|
|
|
@@ -122,10 +125,7 @@ class _MainPageContainerState extends State<_MainPageContainer> |
|
|
|
|
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
double top = MediaQueryData |
|
|
|
.fromWindow(window) |
|
|
|
.padding |
|
|
|
.top; |
|
|
|
double top = MediaQueryData.fromWindow(window).padding.top; |
|
|
|
return StreamBuilder<List<Map<String, dynamic>>>( |
|
|
|
stream: _bloc.outData, |
|
|
|
builder: (BuildContext context, AsyncSnapshot snapshot) { |
|
|
@@ -135,7 +135,7 @@ class _MainPageContainerState extends State<_MainPageContainer> |
|
|
|
backgroundColor: Color(0xfff9f9f9), |
|
|
|
floatingActionButton: _floatWidget, |
|
|
|
floatingActionButtonLocation: |
|
|
|
FloatingActionButtonLocation.centerDocked, |
|
|
|
FloatingActionButtonLocation.centerDocked, |
|
|
|
body: MediaQuery.removePadding( |
|
|
|
removeTop: true, |
|
|
|
context: context, |
|
|
@@ -169,12 +169,12 @@ class _MainPageContainerState extends State<_MainPageContainer> |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
List<Widget> _createContent(BuildContext context, |
|
|
|
List<Map<String, dynamic>> datas) { |
|
|
|
List<Widget> _createContent( |
|
|
|
BuildContext context, List<Map<String, dynamic>> datas) { |
|
|
|
List<Widget> list = List(); |
|
|
|
for (int i = 0; i < datas.length; i++) { |
|
|
|
WidgetModel item = |
|
|
|
WidgetModel.fromJson(Map<String, dynamic>.from(datas[i])); |
|
|
|
WidgetModel.fromJson(Map<String, dynamic>.from(datas[i])); |
|
|
|
|
|
|
|
print('item.modName ${item.modName}'); |
|
|
|
if (item.modName == 'index_taobao_auth_tip') { |
|
|
|