Commit 4b706323 authored by netyouli's avatar netyouli

AI聊天界面添加多选分享,删除功能

parent 5372aa13
import 'package:flutter/src/widgets/framework.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
class BottomAnimation extends GetView {
const BottomAnimation(this.child, this.isExpanded, {Key? key}):super(key:key);
final Widget child;
final bool isExpanded;
@override
Widget build(BuildContext context) {
// TODO: implement build
return AnimatedAlign(
duration: Duration(milliseconds: 300),
alignment: isExpanded ? Alignment.bottomCenter : Alignment(0, 2),
child: Container(
child: child,
),
);
}
}
import 'package:flutter/material.dart';
class MyCheckbox extends StatefulWidget {
const MyCheckbox(this.onChanged, {Key? key}): super(key: key);
final void Function(bool isChecked)? onChanged;
@override
_MyCheckboxState createState() => _MyCheckboxState(onChanged);
}
class _MyCheckboxState extends State<MyCheckbox> {
_MyCheckboxState(this.onChanged): super();
bool _isChecked = false;
final void Function(bool isChecked)? onChanged;
@override
Widget build(BuildContext context) {
return InkWell(
onTap: () {
setState(() {
_isChecked = !_isChecked;
if (onChanged != null) {
onChanged!(_isChecked);
}
});
},
child: Container(
width: 20,
height: 20,
decoration: BoxDecoration(
color: _isChecked ? Colors.green : Colors.grey[300],
border: Border.all(
color: _isChecked ? Colors.green : Colors.grey[400]!,
width: 2,
),
borderRadius: BorderRadius.circular(20),
),
child: _isChecked
? Icon(
Icons.check,
size: 16,
color: Colors.white,
)
: null,
),
);
}
}
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment