forked from lxm_flutter/FlutterUnit
优化条目点击事件
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_star/flutter_star.dart';
|
||||
import 'package:flutter_unit/app/res/cons.dart';
|
||||
import 'package:flutter_unit/app/res/style/shape/coupon_shape_border.dart';
|
||||
import 'package:flutter_unit/app/router/unit_router.dart';
|
||||
import 'package:flutter_unit/widget_system/blocs/widget_system_bloc.dart';
|
||||
|
||||
import 'package:flutter_unit/components/permanent/circle_image.dart';
|
||||
@@ -26,26 +27,24 @@ class CouponWidgetListItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(bottom: 10,top:2,left: 10,right: 10),
|
||||
final CouponShapeBorder couponShapeBorder = CouponShapeBorder(
|
||||
hasTopHole: hasTopHole,
|
||||
hasBottomHole: hasBottomHole,
|
||||
hasLine: false,
|
||||
edgeRadius: 25,
|
||||
lineRate: 0.20);
|
||||
|
||||
child: Stack(
|
||||
return Stack(
|
||||
children: <Widget>[
|
||||
isClip
|
||||
? ClipPath(
|
||||
clipper: ShapeBorderClipper(
|
||||
shape: CouponShapeBorder(
|
||||
hasTopHole: hasTopHole,
|
||||
hasBottomHole: hasBottomHole,
|
||||
hasLine: false,
|
||||
edgeRadius: 25,
|
||||
lineRate: 0.20)),
|
||||
shape: couponShapeBorder),
|
||||
child: buildContent(),
|
||||
)
|
||||
: buildContent(),
|
||||
_buildCollectTag(Theme.of(context).primaryColor)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_unit/app/res/style/shape/coupon_shape_border.dart';
|
||||
import 'package:flutter_unit/app/res/style/shape/techno_shape.dart';
|
||||
import 'package:flutter_unit/widget_system/repositories/model/enums.dart';
|
||||
import 'package:flutter_unit/widget_system/repositories/model/widget_model.dart';
|
||||
import 'package:flutter_unit/components/project/items/widget/simple_widget_list_item.dart';
|
||||
@@ -13,6 +15,30 @@ import 'techno_widget_list_item.dart';
|
||||
/// 说明:
|
||||
|
||||
class HomeItemSupport {
|
||||
|
||||
static Map<int,ShapeBorder> shapeBorderMap={
|
||||
1: TechnoShapeBorder(),
|
||||
2: RoundedRectangleBorder(borderRadius: BorderRadius.circular(6)),
|
||||
3: CouponShapeBorder(
|
||||
hasTopHole: true,
|
||||
hasBottomHole: false,
|
||||
hasLine: false,
|
||||
edgeRadius: 25,
|
||||
lineRate: 0.20),
|
||||
4: CouponShapeBorder(
|
||||
hasTopHole: false,
|
||||
hasBottomHole: false,
|
||||
hasLine: false,
|
||||
edgeRadius: 25,
|
||||
lineRate: 0.20),
|
||||
5: CouponShapeBorder(
|
||||
hasTopHole: true,
|
||||
hasBottomHole: false,
|
||||
hasLine: false,
|
||||
edgeRadius: 25,
|
||||
lineRate: 0.20),
|
||||
};
|
||||
|
||||
static Widget get(
|
||||
WidgetModel model,
|
||||
int index,
|
||||
|
||||
@@ -24,12 +24,11 @@ class SimpleWidgetListItem extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
|
||||
decoration: BoxDecoration(
|
||||
color: itemColor.withAlpha(66),
|
||||
borderRadius: BorderRadius.circular(6)
|
||||
),
|
||||
margin: const EdgeInsets.only(bottom: 10,top:2,left: 10,right: 10),
|
||||
// margin: const EdgeInsets.only(bottom: 10,top:2,left: 10,right: 10),
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Container(
|
||||
|
||||
@@ -18,9 +18,7 @@ class TechnoWidgetListItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(bottom: 10,top:2,left: 10,right: 10),
|
||||
child: Stack(
|
||||
return Stack(
|
||||
children: <Widget>[
|
||||
Material(
|
||||
color: itemColor.withAlpha(66),
|
||||
@@ -62,8 +60,7 @@ class TechnoWidgetListItem extends StatelessWidget {
|
||||
),
|
||||
_buildCollectTag(Theme.of(context).primaryColor)
|
||||
],
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildCollectTag(Color color) {
|
||||
|
||||
Reference in New Issue
Block a user