mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
feat: manually close conn
This commit is contained in:
38
lib/view/widget/icon_text_btn.dart
Normal file
38
lib/view/widget/icon_text_btn.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:toolbox/data/res/ui.dart';
|
||||
|
||||
final class IconTextBtn extends StatelessWidget {
|
||||
final String text;
|
||||
final IconData icon;
|
||||
final VoidCallback? onPressed;
|
||||
final Orientation orientation;
|
||||
|
||||
const IconTextBtn({
|
||||
super.key,
|
||||
required this.text,
|
||||
required this.icon,
|
||||
this.onPressed,
|
||||
this.orientation = Orientation.portrait,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return IconButton(
|
||||
onPressed: onPressed,
|
||||
tooltip: text,
|
||||
icon: orientation == Orientation.landscape ? Row(
|
||||
children: [
|
||||
Icon(icon),
|
||||
UIs.width7,
|
||||
Text(text, style: UIs.text13Grey),
|
||||
],
|
||||
) : Column(
|
||||
children: [
|
||||
Icon(icon),
|
||||
UIs.height7,
|
||||
Text(text, style: UIs.text13Grey),
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user