Ver a proveniência

修复了启动太快的bug

tags/0.0.1
Weller há 4 anos
ascendente
cometimento
28e47f4fa5
36 ficheiros alterados com 101 adições e 45 eliminações
  1. +1
    -1
      .dart_tool/package_config.json
  2. BIN
     
  3. +6
    -6
      example/ios/Runner/项目资源/智莺生活/image/智莺生活.xcassets/AppIcon.appiconset/Contents.json
  4. BIN
     
  5. BIN
     
  6. BIN
     
  7. BIN
     
  8. BIN
     
  9. BIN
     
  10. BIN
     
  11. BIN
     
  12. BIN
     
  13. BIN
     
  14. BIN
     
  15. BIN
     
  16. BIN
     
  17. BIN
     
  18. BIN
     
  19. BIN
     
  20. BIN
     
  21. BIN
     
  22. BIN
     
  23. BIN
     
  24. BIN
     
  25. BIN
     
  26. BIN
     
  27. BIN
     
  28. BIN
     
  29. BIN
     
  30. BIN
     
  31. BIN
     
  32. BIN
     
  33. +12
    -7
      lib/pages/goods_details_page/goods_details_page.dart
  34. +1
    -0
      lib/pages/launch_page/launch_page.dart
  35. +5
    -3
      lib/register.dart
  36. +76
    -28
      lib/widgets/home/home_slide_banner/home_slide_banner.dart

+ 1
- 1
.dart_tool/package_config.json Ver ficheiro

@@ -614,7 +614,7 @@
"languageVersion": "2.1"
}
],
"generated": "2020-09-30T08:56:02.620599Z",
"generated": "2020-09-30T09:06:30.237124Z",
"generator": "pub",
"generatorVersion": "2.7.2"
}


+ 6
- 6
example/ios/Runner/项目资源/智莺生活/image/智莺生活.xcassets/AppIcon.appiconset/Contents.json Ver ficheiro

@@ -33,7 +33,7 @@
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon-40@2x.png",
"filename" : "icon-40@2x-1.png",
"scale" : "2x"
},
{
@@ -57,25 +57,25 @@
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "icon-20-ipad.png",
"filename" : "icon-20.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "icon-20@2x-ipad.png",
"filename" : "icon-20@2x-1.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "icon-29-ipad.png",
"filename" : "icon-30.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "icon-29@2x-ipad.png",
"filename" : "icon-29@2x-1.png",
"scale" : "2x"
},
{
@@ -111,7 +111,7 @@
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "icon-1024.png",
"filename" : "iTunesArtwork@2x.png",
"scale" : "1x"
}
],































+ 12
- 7
lib/pages/goods_details_page/goods_details_page.dart Ver ficheiro

@@ -56,7 +56,8 @@ class GoodsDetailsContainer extends StatefulWidget {
class _GoodsDetailsContainerState extends State<GoodsDetailsContainer> {
bool _isEnded = false;
ScrollController _controller = ScrollController();
RefreshController _refreshController = RefreshController(initialRefresh: false);
RefreshController _refreshController =
RefreshController(initialRefresh: false);

void _onLoading() async {
// await Future.delayed(Duration(milliseconds: 1000));
@@ -133,12 +134,16 @@ class _GoodsDetailsContainerState extends State<GoodsDetailsContainer> {
return Scaffold(
backgroundColor: Colors.white,
body: Container(
color: Color(0xfff1f1f1),
child: CustomScrollView(
controller: _controller,
slivers: _createContent(context, datas ?? []),
),
),
color: Color(0xfff1f1f1),
child: Stack(
children: <Widget>[
CustomScrollView(
controller: _controller,
slivers: _createContent(context, datas ?? []),
),
_getAppBarWidget(),
],
)),

/// appBar
// Align(alignment: Alignment.topCenter, child: _getAppBarWidget()),


+ 1
- 0
lib/pages/launch_page/launch_page.dart Ver ficheiro

@@ -48,6 +48,7 @@ class _LaunchPageState extends State<LaunchPage> {
return Image.asset(
'assets/images/launch_image/launch_image.png',
package: 'zhiying_base_widget',
fit: BoxFit.cover,
);
}
}

+ 5
- 3
lib/register.dart Ver ficheiro

@@ -22,7 +22,6 @@ import 'package:zhiying_base_widget/widgets/goods_details/slide_banner/goods_det
import 'package:zhiying_base_widget/widgets/goods_details/store/store_widget.dart';
import 'package:zhiying_base_widget/widgets/goods_details/upgrade_tip/upgrade_tip_widget.dart';
import 'package:zhiying_base_widget/widgets/home/home_banner/home_banner_creater.dart';
import 'package:zhiying_base_widget/widgets/home/home_banner/home_banner_widget.dart';
import 'package:zhiying_base_widget/widgets/home/home_goods/home_goods_creater.dart';
import 'package:zhiying_base_widget/widgets/home/home_notice/home_notice_widget.dart';
import 'package:zhiying_base_widget/widgets/home/home_slide_banner/home_slide_banner_creater.dart';
@@ -84,6 +83,10 @@ class BaseWidgetRegister {
register.setupQQ("1111030588", "XoHKlrBybXy7ORBt");
SharesdkPlugin.regist(register);
});

Application.addMethod(() async {
return Future.delayed(Duration(seconds: 2));
});
}

// 注册页面
@@ -269,8 +272,7 @@ class BaseWidgetRegister {
WidgetFactory.regist('profile_my_functions',
DefaultWidgetCreater((model) => MineQuickEntry(model)));
// WidgetFactory.regist('profile_carousel', DefaultWidgetCreater((model) => HomeBannerWidget(model)));
WidgetFactory.regist('profile_carousel',
DefaultWidgetCreater((model) => HomeBannerWidget(model)));
// WidgetFactory.regist('profile_carousel', HomeBannerCreater());

// ==================== 钱包
WidgetFactory.regist(


+ 76
- 28
lib/widgets/home/home_slide_banner/home_slide_banner.dart Ver ficheiro

@@ -1,10 +1,9 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_swiper/flutter_swiper.dart';
import 'package:provider/provider.dart';
import 'package:zhiying_base_widget/pages/goods_details_page/goods_details_page.dart';
import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_bg_notifier.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

import 'bloc/bloc.dart';
@@ -28,7 +27,9 @@ class _HomeSlideBannerState extends State<HomeSlideBanner> {
@override
Widget build(BuildContext context) {
return BlocProvider<HomeSlideBannerBloc>(
create: (_) => HomeSlideBannerBloc(repository: HomeSlideBannerRepository())..add(HomeBannerInitEvent(model: widget?.model)),
create: (_) =>
HomeSlideBannerBloc(repository: HomeSlideBannerRepository())
..add(HomeBannerInitEvent(model: widget?.model)),
child: HomeSlideBannerContainer(),
);
}
@@ -36,11 +37,11 @@ class _HomeSlideBannerState extends State<HomeSlideBanner> {

class HomeSlideBannerContainer extends StatefulWidget {
@override
_HomeSlideBannerContainerState createState() => _HomeSlideBannerContainerState();
_HomeSlideBannerContainerState createState() =>
_HomeSlideBannerContainerState();
}

class _HomeSlideBannerContainerState extends State<HomeSlideBannerContainer> {

/// 子元素点击事件
void _itemOnClick(IndexCarousel model) {
print('点击了 $model');
@@ -80,7 +81,17 @@ class _HomeSlideBannerContainerState extends State<HomeSlideBannerContainer> {
}

Widget _getMainWidget(HomeSlideBannerModel datas) {
Future.delayed(Duration.zero, () {
Provider.of<MainPageBgNotifier>(context, listen: false)
.switchBg(Container(
width: double.infinity,
height: 200,
color: Colors.redAccent,
));
});

return Container(
margin: EdgeInsets.all(10),
width: double.infinity,
height: 140,
child: Swiper(
@@ -98,13 +109,15 @@ class _HomeSlideBannerContainerState extends State<HomeSlideBannerContainer> {
loop: true,
autoplay: true,
onTap: (index) => _itemOnClick(datas.index_carousel_list[index]),
pagination: _getSwiperStyleByType(datas, datas?.index_carousel_list?.length ?? 0),
pagination: _getSwiperStyleByType(
datas, datas?.index_carousel_list?.length ?? 0),
onIndexChanged: (index) {
//print('切换下一页');
Provider.of<MainPageBgNotifier>(context, listen: false).switchBg(Container(
Provider.of<MainPageBgNotifier>(context, listen: false)
.switchBg(Container(
width: double.infinity,
height: 200,
color: Colors.primaries[(index + 2) % Colors.primaries.length],
color: Colors.redAccent,
));
},
),
@@ -112,50 +125,71 @@ class _HomeSlideBannerContainerState extends State<HomeSlideBannerContainer> {
}

/// 获取进度样式
SwiperPlugin _getSwiperStyleByType(HomeSlideBannerModel model, int pageCount) {
if('1' != model.pagination_open){
SwiperPlugin _getSwiperStyleByType(
HomeSlideBannerModel model, int pageCount) {
if ('1' != model.pagination_open) {
return null;
}

if ('type_number' == model.pagination) {
return _getNumswiperPlugin(pageCount, model.pagination_select_color, model.pagination_unselect_color);
return _getNumswiperPlugin(pageCount, model.pagination_select_color,
model.pagination_unselect_color);
}
if ('type_point' == model.pagination) {
return _swiperCustomPaginationDito(pageCount, model.pagination_select_color, model.pagination_unselect_color);
return _swiperCustomPaginationDito(pageCount,
model.pagination_select_color, model.pagination_unselect_color);
}
if ('type_bar' == model.pagination) {
return _swiperCustomPagination(pageCount, model.pagination_select_color, model.pagination_unselect_color);
return _swiperCustomPagination(pageCount, model.pagination_select_color,
model.pagination_unselect_color);
}
return null;
}

/// 数字样式
SwiperPlugin _getNumswiperPlugin(int pageCount, String selectColor, String unselectColor) {
return SwiperCustomPagination(builder: (BuildContext context, SwiperPluginConfig config) {
SwiperPlugin _getNumswiperPlugin(
int pageCount, String selectColor, String unselectColor) {
return SwiperCustomPagination(
builder: (BuildContext context, SwiperPluginConfig config) {
return Align(
alignment: Alignment(0.0, 0.9),
child: Container(
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 18),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(13), color: HexColor.fromHex('#4D000000')),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(13),
color: HexColor.fromHex('#4D000000')),
child: RichText(
text: TextSpan(text: '${config.activeIndex + 1}', style: TextStyle(fontSize: 12, color: HexColor.fromHex(selectColor)), children: [
TextSpan(text: '/', style: TextStyle(fontSize: 12, color: HexColor.fromHex(unselectColor))),
TextSpan(text: '$pageCount', style: TextStyle(fontSize: 12, color: HexColor.fromHex(unselectColor))),
]),
text: TextSpan(
text: '${config.activeIndex + 1}',
style: TextStyle(
fontSize: 12, color: HexColor.fromHex(selectColor)),
children: [
TextSpan(
text: '/',
style: TextStyle(
fontSize: 12,
color: HexColor.fromHex(unselectColor))),
TextSpan(
text: '$pageCount',
style: TextStyle(
fontSize: 12,
color: HexColor.fromHex(unselectColor))),
]),
)),
);
});
}

/// 自定义进度条
SwiperPlugin _swiperCustomPagination(int pageCount, String selectColor, String unselectColor) {
SwiperPlugin _swiperCustomPagination(
int pageCount, String selectColor, String unselectColor) {
List list = [];
for (int i = 0; i < pageCount; i++) {
list.add(i);
}

return SwiperCustomPagination(builder: (BuildContext context, SwiperPluginConfig config) {
return SwiperCustomPagination(
builder: (BuildContext context, SwiperPluginConfig config) {
return Align(
alignment: Alignment(0.0, 0.9),
child: Row(
@@ -164,10 +198,13 @@ class _HomeSlideBannerContainerState extends State<HomeSlideBannerContainer> {
children: list.map((index) {
var borderRadius;
if (index == 0) {
borderRadius = BorderRadius.only(topLeft: Radius.circular(2), bottomLeft: Radius.circular(2));
borderRadius = BorderRadius.only(
topLeft: Radius.circular(2), bottomLeft: Radius.circular(2));
}
if (index == list.length - 1) {
borderRadius = BorderRadius.only(topRight: Radius.circular(2), bottomRight: Radius.circular(2));
borderRadius = BorderRadius.only(
topRight: Radius.circular(2),
bottomRight: Radius.circular(2));
}

if (index == config.activeIndex) {
@@ -177,7 +214,11 @@ class _HomeSlideBannerContainerState extends State<HomeSlideBannerContainer> {
return Container(
height: 4,
width: 25,
decoration: BoxDecoration(borderRadius: borderRadius, color: index == config.activeIndex ? HexColor.fromHex(selectColor) : HexColor.fromHex(unselectColor)),
decoration: BoxDecoration(
borderRadius: borderRadius,
color: index == config.activeIndex
? HexColor.fromHex(selectColor)
: HexColor.fromHex(unselectColor)),
);
}).toList(),
),
@@ -186,7 +227,14 @@ class _HomeSlideBannerContainerState extends State<HomeSlideBannerContainer> {
}

/// 圆形进度条
SwiperPlugin _swiperCustomPaginationDito(int pageCount, String selectColor, String unselectColor) {
return SwiperPagination(margin: const EdgeInsets.only(), builder: DotSwiperPaginationBuilder( color: HexColor.fromHex(unselectColor), activeColor: HexColor.fromHex(selectColor), size: 8, activeSize: 8));
SwiperPlugin _swiperCustomPaginationDito(
int pageCount, String selectColor, String unselectColor) {
return SwiperPagination(
margin: const EdgeInsets.only(),
builder: DotSwiperPaginationBuilder(
color: HexColor.fromHex(unselectColor),
activeColor: HexColor.fromHex(selectColor),
size: 8,
activeSize: 8));
}
}

Carregando…
Cancelar
Guardar