You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
meshcore-client/lib/widgets/app_bar_title.dart

36 lines
973 B

import 'package:flutter/material.dart';
/// The two-line app-bar title: the title in the app bar's own style, and a
/// subtitle under it. Every screen with a subtitle uses this, so the sizes
/// cannot drift apart again. (#1275)
class AppBarTitle extends StatelessWidget {
final String title;
final String? subtitle;
static const subtitleStyle = TextStyle(
fontSize: 14,
fontWeight: FontWeight.normal,
);
const AppBarTitle(this.title, {super.key, this.subtitle});
@override
Widget build(BuildContext context) {
final sub = subtitle;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(title, maxLines: 1, overflow: TextOverflow.ellipsis),
if (sub != null && sub.isNotEmpty)
Text(
sub,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: subtitleStyle,
),
],
);
}
}

Powered by TurnKey Linux.