|
@@ -19,7 +19,9 @@ class CustomQuickEntry extends StatelessWidget { |
|
|
@override |
|
|
@override |
|
|
Widget build(BuildContext context) { |
|
|
Widget build(BuildContext context) { |
|
|
return BlocProvider<CustomQuickEntryBloc>( |
|
|
return BlocProvider<CustomQuickEntryBloc>( |
|
|
create: (_) => CustomQuickEntryBloc(repository: CustomQuickEntryRepository())..add(CustomQuickEntryInitEvent(model: model)), |
|
|
|
|
|
|
|
|
create: (_) => |
|
|
|
|
|
CustomQuickEntryBloc(repository: CustomQuickEntryRepository()) |
|
|
|
|
|
..add(CustomQuickEntryInitEvent(model: model)), |
|
|
child: _CustomQuickEntryContainer(model), |
|
|
child: _CustomQuickEntryContainer(model), |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
@@ -27,7 +29,9 @@ class CustomQuickEntry extends StatelessWidget { |
|
|
|
|
|
|
|
|
class _CustomQuickEntryContainer extends StatefulWidget { |
|
|
class _CustomQuickEntryContainer extends StatefulWidget { |
|
|
final Map<String, dynamic> model; |
|
|
final Map<String, dynamic> model; |
|
|
|
|
|
|
|
|
_CustomQuickEntryContainer(this.model); |
|
|
_CustomQuickEntryContainer(this.model); |
|
|
|
|
|
|
|
|
@override |
|
|
@override |
|
|
__CustomQuickEntryContainerState createState() => __CustomQuickEntryContainerState(); |
|
|
__CustomQuickEntryContainerState createState() => __CustomQuickEntryContainerState(); |
|
|
} |
|
|
} |
|
@@ -57,8 +61,7 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> |
|
|
@override |
|
|
@override |
|
|
Widget build(BuildContext context) { |
|
|
Widget build(BuildContext context) { |
|
|
return BlocConsumer<CustomQuickEntryBloc, CustomQuickEntryState>( |
|
|
return BlocConsumer<CustomQuickEntryBloc, CustomQuickEntryState>( |
|
|
listener: (context, state) { |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
listener: (context, state) {}, |
|
|
buildWhen: (prev, current) { |
|
|
buildWhen: (prev, current) { |
|
|
return true; |
|
|
return true; |
|
|
}, |
|
|
}, |
|
@@ -69,14 +72,14 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> |
|
|
if (state is CustomQuickEntryLoadedState) { |
|
|
if (state is CustomQuickEntryLoadedState) { |
|
|
return _getMainWidget(state.model); |
|
|
return _getMainWidget(state.model); |
|
|
} |
|
|
} |
|
|
if(state is CustomQuickEntryErrorState){ |
|
|
|
|
|
|
|
|
if (state is CustomQuickEntryErrorState) { |
|
|
return Container(); |
|
|
return Container(); |
|
|
} |
|
|
} |
|
|
return CustomQuickEntrySkeleton(); |
|
|
return CustomQuickEntrySkeleton(); |
|
|
}, |
|
|
}, |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget _getMainWidget(CustomQuickEntryModel model) { |
|
|
Widget _getMainWidget(CustomQuickEntryModel model) { |
|
|
// 数据总数 |
|
|
// 数据总数 |
|
|
int totalDataSize = model?.listStyle?.length ?? 0; |
|
|
int totalDataSize = model?.listStyle?.length ?? 0; |
|
@@ -128,16 +131,18 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
return Container( |
|
|
return Container( |
|
|
margin: EdgeInsets.only(top: ParseUtil.stringParseDouble(model?.topMargin)), |
|
|
|
|
|
|
|
|
margin: EdgeInsets.only(top: double.tryParse(model?.topMargin), |
|
|
|
|
|
left: ParseUtil.stringParseDouble(model?.leftRightMargin), |
|
|
|
|
|
right: ParseUtil.stringParseDouble(model?.leftRightMargin)), |
|
|
decoration: BoxDecoration( |
|
|
decoration: BoxDecoration( |
|
|
color: HexColor.fromHex(model?.bgColor ?? ''), |
|
|
|
|
|
// color: Colors.green, |
|
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
|
topRight: Radius.circular(ParseUtil.stringParseDouble(model?.topRightRadius)), |
|
|
|
|
|
topLeft: Radius.circular(ParseUtil.stringParseDouble(model?.topLeftRadius)), |
|
|
|
|
|
bottomLeft: Radius.circular(ParseUtil.stringParseDouble(model?.bottomLeftRadius)), |
|
|
|
|
|
bottomRight: Radius.circular(ParseUtil.stringParseDouble(model?.bottomRightRadius)), |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
color: HexColor.fromHex(model?.bgColor ?? ''), |
|
|
|
|
|
//color: Colors.green, |
|
|
|
|
|
borderRadius: BorderRadius.only( |
|
|
|
|
|
topRight: Radius.circular(ParseUtil.stringParseDouble(model?.topRightRadius)), |
|
|
|
|
|
topLeft: Radius.circular(ParseUtil.stringParseDouble(model?.topLeftRadius)), |
|
|
|
|
|
bottomLeft: Radius.circular(ParseUtil.stringParseDouble(model?.bottomLeftRadius)), |
|
|
|
|
|
bottomRight: Radius.circular(ParseUtil.stringParseDouble(model?.bottomRightRadius)), |
|
|
|
|
|
) |
|
|
), |
|
|
), |
|
|
child: Container( |
|
|
child: Container( |
|
|
margin: EdgeInsets.only(top: !hasCategory ? 15 : 0, bottom: totalPage > 1 ? 15 : 0), |
|
|
margin: EdgeInsets.only(top: !hasCategory ? 15 : 0, bottom: totalPage > 1 ? 15 : 0), |
|
@@ -150,7 +155,7 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> |
|
|
|
|
|
|
|
|
Container( |
|
|
Container( |
|
|
width: double.infinity, |
|
|
width: double.infinity, |
|
|
height: hasCategory ? totalHeight - categoryHeight - categoryBottomMargin : totalHeight , |
|
|
|
|
|
|
|
|
height: hasCategory ? totalHeight - categoryHeight - categoryBottomMargin : totalHeight, |
|
|
child: Swiper( |
|
|
child: Swiper( |
|
|
controller: _controller, |
|
|
controller: _controller, |
|
|
itemCount: totalPage, |
|
|
itemCount: totalPage, |
|
@@ -274,17 +279,16 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// 行的数据 |
|
|
/// 行的数据 |
|
|
Widget _getRowWidget( |
|
|
|
|
|
{double titleHeight, |
|
|
|
|
|
double iconHeight, |
|
|
|
|
|
int totalPage, |
|
|
|
|
|
int currentPage, |
|
|
|
|
|
int columSize, |
|
|
|
|
|
int totalRowSize, |
|
|
|
|
|
int totalDataSize, |
|
|
|
|
|
CustomQuickEntryModel model, |
|
|
|
|
|
int currentRow, |
|
|
|
|
|
double itemHeight}) { |
|
|
|
|
|
|
|
|
Widget _getRowWidget({double titleHeight, |
|
|
|
|
|
double iconHeight, |
|
|
|
|
|
int totalPage, |
|
|
|
|
|
int currentPage, |
|
|
|
|
|
int columSize, |
|
|
|
|
|
int totalRowSize, |
|
|
|
|
|
int totalDataSize, |
|
|
|
|
|
CustomQuickEntryModel model, |
|
|
|
|
|
int currentRow, |
|
|
|
|
|
double itemHeight}) { |
|
|
List itemList = []; |
|
|
List itemList = []; |
|
|
for (int i = 0; i < columSize; i++) { |
|
|
for (int i = 0; i < columSize; i++) { |
|
|
itemList.add(i); |
|
|
itemList.add(i); |
|
@@ -353,6 +357,7 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> |
|
|
// color: Colors.red, |
|
|
// color: Colors.red, |
|
|
child: Column( |
|
|
child: Column( |
|
|
children: <Widget>[ |
|
|
children: <Widget>[ |
|
|
|
|
|
|
|
|
/// 图标 |
|
|
/// 图标 |
|
|
MyNetWorkImage(item.img), |
|
|
MyNetWorkImage(item.img), |
|
|
|
|
|
|
|
@@ -404,7 +409,8 @@ class __CustomQuickEntryContainerState extends State<_CustomQuickEntryContainer> |
|
|
SwiperPagination _swiperPaginationDot(CustomQuickEntryModel model) { |
|
|
SwiperPagination _swiperPaginationDot(CustomQuickEntryModel model) { |
|
|
return SwiperPagination( |
|
|
return SwiperPagination( |
|
|
margin: const EdgeInsets.only(), |
|
|
margin: const EdgeInsets.only(), |
|
|
builder: DotSwiperPaginationBuilder(color: HexColor.fromHex(model?.paginationUnselectColor), activeColor: HexColor.fromHex(model?.paginationSelectColor), size: 8, activeSize: 8)); |
|
|
|
|
|
|
|
|
builder: DotSwiperPaginationBuilder( |
|
|
|
|
|
color: HexColor.fromHex(model?.paginationUnselectColor), activeColor: HexColor.fromHex(model?.paginationSelectColor), size: 8, activeSize: 8)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 自定义进度条 条形 |
|
|
// 自定义进度条 条形 |
|
@@ -465,7 +471,6 @@ class MyNetWorkImage extends StatelessWidget { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Widget _getMainWidget(CustomQuickEntryModel model) { |
|
|
// Widget _getMainWidget(CustomQuickEntryModel model) { |
|
|
// // 数据总数 |
|
|
// // 数据总数 |
|
|
// int totalDataSize = model?.listStyle?.length ?? 0; |
|
|
// int totalDataSize = model?.listStyle?.length ?? 0; |
|
|