Mobile. Share Screen. Unify usage of card.title, avoid title overflow

This commit is contained in:
grummbeer 2023-03-07 11:45:20 +01:00
parent 1227d66871
commit 45d19a62f9

View File

@ -171,34 +171,22 @@ class ServiceNotRunningNotification extends StatelessWidget {
final serverModel = Provider.of<ServerModel>(context); final serverModel = Provider.of<ServerModel>(context);
return PaddingCard( return PaddingCard(
title: translate("Service is not running"),
titleIcon:
const Icon(Icons.warning_amber_sharp, color: Colors.redAccent),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [ children: [
const Icon(Icons.warning_amber_sharp, Text(translate("android_start_service_tip"),
color: Colors.redAccent, size: 24), style:
const SizedBox(width: 10), const TextStyle(fontSize: 12, color: MyTheme.darkGray))
Expanded( .marginOnly(bottom: 8),
child: Text( ElevatedButton.icon(
translate("Service is not running"), icon: const Icon(Icons.play_arrow),
style: const TextStyle( onPressed: serverModel.toggleService,
fontFamily: 'WorkSans', label: Text(translate("Start Service")))
fontWeight: FontWeight.bold,
fontSize: 18,
),
))
], ],
).marginOnly(bottom: 8), ));
Text(translate("android_start_service_tip"),
style: const TextStyle(fontSize: 12, color: MyTheme.darkGray))
.marginOnly(bottom: 8),
ElevatedButton.icon(
icon: const Icon(Icons.play_arrow),
onPressed: serverModel.toggleService,
label: Text(translate("Start Service")))
],
));
} }
} }
@ -358,8 +346,8 @@ class ConnectionManager extends StatelessWidget {
? "File Connection" ? "File Connection"
: "Screen Connection"), : "Screen Connection"),
titleIcon: client.isFileTransfer titleIcon: client.isFileTransfer
? Icons.folder_outlined ? Icon(Icons.folder_outlined)
: Icons.mobile_screen_share, : Icon(Icons.mobile_screen_share),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -431,7 +419,7 @@ class PaddingCard extends StatelessWidget {
: super(key: key); : super(key: key);
final String? title; final String? title;
final IconData? titleIcon; final Icon? titleIcon;
final Widget child; final Widget child;
@override @override
@ -447,16 +435,17 @@ class PaddingCard extends StatelessWidget {
titleIcon != null titleIcon != null
? Padding( ? Padding(
padding: const EdgeInsets.only(right: 10), padding: const EdgeInsets.only(right: 10),
child: child: titleIcon)
Icon(titleIcon, color: MyTheme.accent, size: 30))
: const SizedBox.shrink(), : const SizedBox.shrink(),
Text( Expanded(
title!, child: Text(
style: const TextStyle( title!,
fontFamily: 'WorkSans', style: const TextStyle(
fontWeight: FontWeight.bold, fontFamily: 'WorkSans',
fontSize: 20, fontWeight: FontWeight.bold,
color: MyTheme.accent, fontSize: 20,
color: MyTheme.accent,
),
), ),
) )
], ],