自习室优化ok
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// 举手按钮
|
||||
class HandRaiseButton extends StatelessWidget {
|
||||
final void Function() onTap;
|
||||
|
||||
const HandRaiseButton({super.key, required this.onTap});
|
||||
|
||||
@override
|
||||
@@ -24,3 +26,41 @@ class HandRaiseButton extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
///topBar的操作按钮
|
||||
class ActionButton extends StatelessWidget {
|
||||
final IconData icon;
|
||||
final String text;
|
||||
final Color? color;
|
||||
final void Function()? onTap;
|
||||
|
||||
const ActionButton({
|
||||
super.key,
|
||||
required this.icon,
|
||||
required this.text,
|
||||
this.color,
|
||||
this.onTap,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
margin: EdgeInsets.only(right: 15),
|
||||
decoration: BoxDecoration(
|
||||
color: color ?? Color(0xff4a4f4f),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, size: 16),
|
||||
SizedBox(width: 8),
|
||||
Text(text, style: TextStyle(fontSize: 14)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user