mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-25 06:52:35 +01:00
80f6505671
- implement spaces hierarchy - create expandable navigation drawer tiles - display suggested rooms below joined rooms when in space - everything works nested - fix shared preferenced conflic with debug builds on Linux - add [`package:async`](https://pub.dev/packages/async) Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
68 lines
1.9 KiB
Dart
68 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class SearchTitle extends StatelessWidget {
|
|
final String title;
|
|
final Widget icon;
|
|
final Widget? trailing;
|
|
final void Function()? onTap;
|
|
|
|
const SearchTitle({
|
|
required this.title,
|
|
required this.icon,
|
|
this.trailing,
|
|
this.onTap,
|
|
Key? key,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) => Material(
|
|
shape: Border(
|
|
top: BorderSide(
|
|
color: Theme.of(context).dividerColor,
|
|
width: 1,
|
|
),
|
|
bottom: BorderSide(
|
|
color: Theme.of(context).dividerColor,
|
|
width: 1,
|
|
),
|
|
),
|
|
color: Theme.of(context).colorScheme.surface,
|
|
child: InkWell(
|
|
onTap: onTap,
|
|
splashColor: Theme.of(context).colorScheme.surface,
|
|
child: Align(
|
|
alignment: Alignment.centerLeft,
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: 16,
|
|
vertical: 8,
|
|
),
|
|
child: IconTheme(
|
|
data: Theme.of(context).iconTheme.copyWith(size: 16),
|
|
child: Row(
|
|
children: [
|
|
icon,
|
|
const SizedBox(width: 16),
|
|
Text(title,
|
|
textAlign: TextAlign.left,
|
|
style: TextStyle(
|
|
color: Theme.of(context).colorScheme.onSurface,
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.bold,
|
|
)),
|
|
if (trailing != null)
|
|
Expanded(
|
|
child: Align(
|
|
alignment: Alignment.centerRight,
|
|
child: trailing!,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|