mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
40 lines
982 B
Dart
40 lines
982 B
Dart
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),
|
|
],
|
|
));
|
|
}
|
|
}
|