Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change fab pencil size icon #315

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/pages/chat_list/chat_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ChatListView extends StatelessWidget {

const ChatListView({
Key? key,
required this.controller,
required this.controller,
}) : super(key: key);

@override
Expand All @@ -34,6 +34,7 @@ class ChatListView extends StatelessWidget {
helpLabel: L10n.of(context)!.newChat,
child: TwakeFloatingActionButton(
icon: Icons.mode_edit_outline_outlined,
size: 18.0,
onTap: () => VRouter.of(context).to('/newprivatechat'),
),
)
Expand Down
22 changes: 15 additions & 7 deletions lib/widgets/twake_components/twake_fab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

class TwakeFloatingActionButton extends StatelessWidget {

final Function()? onTap;

final IconData? icon;

final String? imagePath;

final double size;

const TwakeFloatingActionButton({
super.key,
this.onTap,
this.icon,
super.key,
this.onTap,
this.icon,
this.imagePath,
this.size = 24.0,
});

@override
Expand Down Expand Up @@ -44,9 +46,15 @@ class TwakeFloatingActionButton extends StatelessWidget {
onTap: onTap,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: icon != null
? Icon(icon, color: Theme.of(context).colorScheme.onPrimaryContainer,)
: imagePath != null ? SvgPicture.asset(imagePath!) : null,
child: icon != null
? Icon(
icon,
size: size,
color: Theme.of(context).colorScheme.onPrimaryContainer,
)
: imagePath != null
? SvgPicture.asset(imagePath!, width: size, height: size)
: null,
),
),
),
Expand Down
Loading