Skip to content

Commit

Permalink
More warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfteam committed Nov 6, 2022
1 parent 588542c commit e41611c
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion lib/presentation/charts/widgets/chart_legend.dart
Expand Up @@ -23,7 +23,7 @@ class ChartLegendIndicator extends StatelessWidget {
final Color color;
final String text;
final double size;
final Function? tap;
final VoidCallback? tap;
final bool expandText;
final bool selected;
final double? width;
Expand Down
6 changes: 1 addition & 5 deletions lib/presentation/custom_build/widgets/character_section.dart
Expand Up @@ -47,11 +47,7 @@ class CharacterSection extends StatelessWidget {
return BlocBuilder<CustomBuildBloc, CustomBuildState>(
builder: (context, state) => state.maybeMap(
loaded: (state) => Container(
color: theme.brightness == Brightness.dark
? state.character.elementType.getElementColorFromContext(
context,
)
: theme.colorScheme.secondary,
color: theme.brightness == Brightness.dark ? state.character.elementType.getElementColorFromContext(context) : theme.colorScheme.secondary,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand Down
5 changes: 3 additions & 2 deletions lib/presentation/game_codes/game_codes_page.dart
Expand Up @@ -72,8 +72,9 @@ class _GameCodesPageState extends State<GameCodesPage> with SingleTickerProvider
}

Future<void> _launchUrl(String url) async {
if (await canLaunch(url)) {
await launch(url);
final uri = Uri.parse(url);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/home/home_page.dart
Expand Up @@ -149,7 +149,7 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin<
}
}

Widget _buildClickableTitle(String title, String? buttonText, BuildContext context, {Function? onClick}) {
Widget _buildClickableTitle(String title, String? buttonText, BuildContext context, {VoidCallback? onClick}) {
final theme = Theme.of(context);
final row = buttonText != null
? Row(
Expand Down
Expand Up @@ -8,8 +8,8 @@ class CommonBottomSheet extends StatelessWidget {
final String title;
final IconData titleIcon;
final Widget child;
final Function? onOk;
final Function? onCancel;
final VoidCallback? onOk;
final VoidCallback? onCancel;
final double iconSize;
final bool showOkButton;
final bool showCancelButton;
Expand Down
Expand Up @@ -5,8 +5,8 @@ import 'package:shiori/presentation/shared/bottom_sheets/common_button_bar.dart'
class CommonButtonSheetButtons extends StatelessWidget {
final bool showCancelButton;
final bool showOkButton;
final Function? onOk;
final Function? onCancel;
final VoidCallback? onOk;
final VoidCallback? onCancel;

final String? cancelText;
final String? okText;
Expand Down
2 changes: 1 addition & 1 deletion lib/presentation/shared/character_stack_image.dart
Expand Up @@ -10,7 +10,7 @@ class CharacterStackImage extends StatelessWidget {
final String image;
final int rarity;
final double height;
final Function? onTap;
final VoidCallback? onTap;
final BoxFit fit;

const CharacterStackImage({
Expand Down
Expand Up @@ -317,8 +317,8 @@ class _TwoColumnEnumSelectorDialogState<TEnum> extends State<TwoColumnEnumSelect

class _Buttons<TEnum> extends StatelessWidget {
final bool useRow;
final Function? onLeftTap;
final Function? onRightTap;
final VoidCallback? onLeftTap;
final VoidCallback? onRightTap;

const _Buttons({
super.key,
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/shared/hawk_fab_menu.dart
Expand Up @@ -168,7 +168,7 @@ class _MenuItemWidget extends StatelessWidget {
final HawkFabMenuItem item;

/// A callback that toggles the menu
final Function toggleMenu;
final VoidCallback toggleMenu;

const _MenuItemWidget({
required this.item,
Expand Down Expand Up @@ -225,7 +225,7 @@ class HawkFabMenuItem {
Icon icon;

/// Action that is to be performed on tapping the menu item
Function ontap;
VoidCallback ontap;

/// Background color for icon
Color? color;
Expand Down
7 changes: 4 additions & 3 deletions lib/presentation/shared/text_link.dart
Expand Up @@ -5,7 +5,7 @@ import 'package:url_launcher/url_launcher.dart';
class TextLink extends StatelessWidget {
final String text;
final String url;
final Function? onTap;
final VoidCallback? onTap;

const TextLink({
super.key,
Expand Down Expand Up @@ -46,8 +46,9 @@ class TextLink extends StatelessWidget {
}

Future<void> _launchUrl(String url) async {
if (await canLaunch(url)) {
await launch(url);
final uri = Uri.parse(url);
if (await canLaunchUrl(uri)) {
await launchUrl(uri);
}
}
}

0 comments on commit e41611c

Please sign in to comment.