更新登录对接
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ClickableContainer extends StatelessWidget {
|
||||
final Color backgroundColor; // 容器背景色
|
||||
final Color highlightColor; // 点击时背景色
|
||||
final EdgeInsetsGeometry padding; // 内部间距
|
||||
final VoidCallback onTap; // 点击回调
|
||||
final Widget child; // 子组件
|
||||
final double borderRadius; // 容器圆角(可选,默认为0)
|
||||
final Color backgroundColor;
|
||||
final Color highlightColor;
|
||||
final EdgeInsetsGeometry padding;
|
||||
final VoidCallback onTap;
|
||||
final Widget child;
|
||||
final double borderRadius;
|
||||
|
||||
const ClickableContainer({
|
||||
Key? key,
|
||||
@@ -15,13 +15,13 @@ class ClickableContainer extends StatelessWidget {
|
||||
required this.padding,
|
||||
required this.onTap,
|
||||
required this.child,
|
||||
this.borderRadius = 0, // 默认无圆角
|
||||
this.borderRadius = 0,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
return Theme(
|
||||
data: Theme.of(context).copyWith(splashFactory: InkRipple.splashFactory),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Ink(
|
||||
@@ -32,10 +32,10 @@ class ClickableContainer extends StatelessWidget {
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
onTap: onTap,
|
||||
splashColor: highlightColor.withOpacity(0.3), // 点击时的波纹效果
|
||||
splashColor: highlightColor.withOpacity(0.2),
|
||||
child: Padding(
|
||||
padding: padding,
|
||||
child: child, // 内容自适应
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user