Files
tatuchat/lib/pages/chat_list/start_chat_fab.dart
Welton Moura 0037b0b9cf
Some checks failed
Main Deploy Workflow / deploy_web (push) Has been cancelled
Main Deploy Workflow / deploy_playstore_internal (push) Has been cancelled
Close stale issues and PRs / stale (push) Has been cancelled
Initial commit
2026-09-11 15:59:56 -03:00

36 lines
1.2 KiB
Dart

// SPDX-FileCopyrightText: 2019-Present Christian Kußowski
// SPDX-FileCopyrightText: 2019-Present Contributors to FluffyChat
//
// SPDX-License-Identifier: AGPL-3.0-or-later
import 'package:tatchat/config/themes.dart';
import 'package:tatchat/l10n/l10n.dart';
import 'package:go_router/go_router.dart';
import 'package:material_ui/material_ui.dart';
class StartChatFab extends StatelessWidget {
final bool extended;
const StartChatFab({this.extended = false, super.key});
@override
Widget build(BuildContext context) {
return FloatingActionButton.extended(
heroTag: 'start_chat_fab',
backgroundColor: Theme.of(context).colorScheme.primary,
foregroundColor: Theme.of(context).colorScheme.onPrimary,
onPressed: () => context.go('/rooms/newprivatechat'),
extendedIconLabelSpacing: extended ? 10 : 0,
extendedPadding: extended
? null
: const EdgeInsets.symmetric(horizontal: 16),
label: AnimatedSize(
alignment: Alignment.centerLeft,
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
child: extended ? Text(L10n.of(context).newChat) : SizedBox.shrink(),
),
icon: const Icon(Icons.edit_square),
);
}
}