diff --git a/.dart_tool/build_resolvers/sdk.sum b/.dart_tool/build_resolvers/sdk.sum
new file mode 100644
index 0000000..a788675
Binary files /dev/null and b/.dart_tool/build_resolvers/sdk.sum differ
diff --git a/.dart_tool/build_resolvers/sdk.sum.deps b/.dart_tool/build_resolvers/sdk.sum.deps
new file mode 100644
index 0000000..1c10e44
--- /dev/null
+++ b/.dart_tool/build_resolvers/sdk.sum.deps
@@ -0,0 +1 @@
+{"sdk":"2.7.2 (Mon Mar 23 22:11:27 2020 +0100) on \"macos_x64\"","analyzer":"/Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.39.14","build_resolvers":"/Users/fnuser/.pub-cache/hosted/pub.flutter-io.cn/build_resolvers-1.3.11"}
\ No newline at end of file
diff --git a/.dart_tool/package_config.json b/.dart_tool/package_config.json
index d336421..fe58bac 100644
--- a/.dart_tool/package_config.json
+++ b/.dart_tool/package_config.json
@@ -680,7 +680,7 @@
"languageVersion": "2.1"
}
],
- "generated": "2020-09-07T03:45:53.992384Z",
+ "generated": "2020-09-08T07:00:40.458603Z",
"generator": "pub",
"generatorVersion": "2.7.2"
}
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..a55e7a1
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/saveactions_settings.xml b/.idea/saveactions_settings.xml
new file mode 100644
index 0000000..6025467
--- /dev/null
+++ b/.idea/saveactions_settings.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/fonts/DIN-Bold.otf b/assets/fonts/DIN-Bold.otf
new file mode 100644
index 0000000..782e68e
Binary files /dev/null and b/assets/fonts/DIN-Bold.otf differ
diff --git a/assets/fonts/DIN-Medium.otf b/assets/fonts/DIN-Medium.otf
new file mode 100644
index 0000000..ceed4be
Binary files /dev/null and b/assets/fonts/DIN-Medium.otf differ
diff --git a/assets/fonts/DIN-Regular.otf b/assets/fonts/DIN-Regular.otf
new file mode 100644
index 0000000..2ea9379
Binary files /dev/null and b/assets/fonts/DIN-Regular.otf differ
diff --git a/lib/pages/main_page/main_page.dart b/lib/pages/main_page/main_page.dart
index 5b7b843..b3b0e8c 100644
--- a/lib/pages/main_page/main_page.dart
+++ b/lib/pages/main_page/main_page.dart
@@ -2,7 +2,6 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/pages/main_page/main_page_bloc.dart';
import 'package:zhiying_base_widget/pages/main_page/main_page_notifier.dart';
-import 'package:zhiying_base_widget/pages/main_page/main_page_sk.dart';
import 'package:zhiying_comm/zhiying_comm.dart';
import 'package:provider/provider.dart';
import 'package:zhiying_comm/util/base_bloc.dart';
@@ -25,11 +24,13 @@ class _MainPageState extends State {
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xfff9f9f9),
- body: ChangeNotifierProvider(
- create: (context) => MainPageNotifier(),
- child: BlocProvider(
- bloc: MainPageBloc(),
- child: _MainPageContainer(widget.data),
+ body: SafeArea(
+ child: ChangeNotifierProvider(
+ create: (context) => MainPageNotifier(),
+ child: BlocProvider(
+ bloc: MainPageBloc(),
+ child: _MainPageContainer(widget.data),
+ ),
),
),
);
@@ -46,29 +47,16 @@ class _MainPageContainer extends StatefulWidget {
}
class _MainPageContainerState extends State<_MainPageContainer> {
- WidgetType _type = WidgetType.normal;
bool _isEnded = false;
ScrollController _controller = ScrollController();
MainPageBloc _bloc;
-
- List items = ["1", "2", "3", "4", "5", "6", "7", "8"];
RefreshController _refreshController =
RefreshController(initialRefresh: false);
- void _onRefresh() async {
- // monitor network fetch
- await Future.delayed(Duration(milliseconds: 1000));
- // if failed,use refreshFailed()
- _refreshController.refreshCompleted();
- }
-
void _onLoading() async {
- // monitor network fetch
- await Future.delayed(Duration(milliseconds: 1000));
- // if failed,use loadFailed(),if no data return,use LoadNodata()
- items.add((items.length + 1).toString());
- if (mounted) setState(() {});
- _refreshController.loadComplete();
+ // await Future.delayed(Duration(milliseconds: 1000));
+ // if (mounted) setState(() {});
+ // _refreshController.loadComplete();
}
@override
@@ -80,7 +68,6 @@ class _MainPageContainerState extends State<_MainPageContainer> {
@override
void initState() {
_bloc = BlocProvider.of(context);
- _reload();
_controller.addListener(() {
// print('${_controller.offset} ${_controller.position.maxScrollExtent}');
if (_controller.offset >= _controller.position.maxScrollExtent &&
@@ -97,79 +84,16 @@ class _MainPageContainerState extends State<_MainPageContainer> {
super.initState();
}
- void _reload() {
- setState(() {
- _type = WidgetType.skeleton;
- });
- WidgetModel model = WidgetModel.fromJson(widget.data);
- if ((model?.components?.length ?? 0) > 0) {
- _bloc.loadData(model.components.map((item) => item.modId).toList());
- }
-
- // Future.delayed(Duration(seconds: 3), () {
- // setState(() {
- // _type = WidgetType.normal;
- // });
- // });
- }
-
- List _createContent(BuildContext context) {
- List list = List();
- list.add(SliverToBoxAdapter(
- child: RaisedButton(
- onPressed: () {
- Provider.of(context, listen: false).loadMore();
- _reload();
- },
- child: Text('重置'),
- ),
- ));
- list.addAll(WidgetFactory.create('index_carousel',
- type: _type,
- isSliver: true,
- model: Map.from({'aaaaa': 'bbbb'})));
- list.addAll(WidgetFactory.create('home_quick_entry', type: _type, isSliver: true));
- list.addAll(WidgetFactory.create('index_recommend_list',
- type: _type, isSliver: true));
- return list;
- }
-
@override
Widget build(BuildContext context) {
- return StreamBuilder>>>(
+ return StreamBuilder