From 0d1146cc1ea35800bbd620ffa7260ed371bbdec3 Mon Sep 17 00:00:00 2001 From: guyluz Date: Sat, 29 Jul 2023 16:44:01 +0300 Subject: [PATCH] Fixed several warnings --- lib/my_singleton.dart | 1 + .../about_page_content_desktop.dart | 2 +- .../widgets/easy_to_set_up_benefit_block.dart | 12 ++++---- .../widgets/easy_to_use_benefit_block.dart | 8 ++--- ...privacy_and_open_source_benefit_block.dart | 8 ++--- .../widgets/home_page_first_part.dart | 4 +-- .../widgets/home_page_second_part.dart | 10 +++---- .../widgets/home_page_thired_part.dart | 30 +++++++++---------- .../widgets/new_home_page_widget.dart | 2 -- .../widgets/youtube_video_player.dart | 2 +- .../drawer_item_on_click_start_function.dart | 2 +- 11 files changed, 38 insertions(+), 43 deletions(-) diff --git a/lib/my_singleton.dart b/lib/my_singleton.dart index d08c7f7..3e16229 100644 --- a/lib/my_singleton.dart +++ b/lib/my_singleton.dart @@ -20,5 +20,6 @@ class MySingleton { /// Set the current page name static Set? setCurrentPageName(String currentPageName) { _currentPageName = currentPageName; + return null; } } diff --git a/lib/presentation/about_page/about_page_content_desktop.dart b/lib/presentation/about_page/about_page_content_desktop.dart index ba707d5..053e795 100644 --- a/lib/presentation/about_page/about_page_content_desktop.dart +++ b/lib/presentation/about_page/about_page_content_desktop.dart @@ -30,7 +30,7 @@ class AboutPageContentDesktop extends StatelessWidget { child: Scaffold( drawer: sizingInformation.deviceScreenType == DeviceScreenType.mobile - ? NavigationDrawer( + ? const NavigationDrawer( children: [], ) : null, diff --git a/lib/presentation/home_page/widgets/easy_to_set_up_benefit_block.dart b/lib/presentation/home_page/widgets/easy_to_set_up_benefit_block.dart index 50131a4..e574876 100644 --- a/lib/presentation/home_page/widgets/easy_to_set_up_benefit_block.dart +++ b/lib/presentation/home_page/widgets/easy_to_set_up_benefit_block.dart @@ -55,9 +55,9 @@ class EasyToSetUpBenefitBlock extends StatelessWidget { const SizedBox( height: 30, ), - Row( + const Row( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ FaIcon( FontAwesomeIcons.check, color: Colors.green, @@ -81,9 +81,9 @@ class EasyToSetUpBenefitBlock extends StatelessWidget { const SizedBox( height: 10, ), - Row( + const Row( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ FaIcon( FontAwesomeIcons.check, color: Colors.green, @@ -107,9 +107,9 @@ class EasyToSetUpBenefitBlock extends StatelessWidget { const SizedBox( height: 10, ), - Row( + const Row( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ FaIcon( FontAwesomeIcons.check, color: Colors.green, diff --git a/lib/presentation/home_page/widgets/easy_to_use_benefit_block.dart b/lib/presentation/home_page/widgets/easy_to_use_benefit_block.dart index eb735cc..9e8caf2 100644 --- a/lib/presentation/home_page/widgets/easy_to_use_benefit_block.dart +++ b/lib/presentation/home_page/widgets/easy_to_use_benefit_block.dart @@ -55,9 +55,9 @@ class EasyToUseBenefitBlock extends StatelessWidget { const SizedBox( height: 30, ), - Row( + const Row( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ FaIcon( FontAwesomeIcons.check, color: Colors.green, @@ -83,9 +83,9 @@ class EasyToUseBenefitBlock extends StatelessWidget { const SizedBox( height: 10, ), - Row( + const Row( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ FaIcon( FontAwesomeIcons.check, color: Colors.green, diff --git a/lib/presentation/home_page/widgets/privacy_and_open_source_benefit_block.dart b/lib/presentation/home_page/widgets/privacy_and_open_source_benefit_block.dart index 4eb50b0..3192b4b 100644 --- a/lib/presentation/home_page/widgets/privacy_and_open_source_benefit_block.dart +++ b/lib/presentation/home_page/widgets/privacy_and_open_source_benefit_block.dart @@ -60,9 +60,9 @@ class PrivacyAndOpenSourceBenefitBlock extends StatelessWidget { const SizedBox( height: 30, ), - Row( + const Row( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ FaIcon( FontAwesomeIcons.check, color: Colors.green, @@ -88,9 +88,9 @@ class PrivacyAndOpenSourceBenefitBlock extends StatelessWidget { const SizedBox( height: 10, ), - Row( + const Row( crossAxisAlignment: CrossAxisAlignment.start, - children: const [ + children: [ FaIcon( FontAwesomeIcons.check, color: Colors.green, diff --git a/lib/presentation/new_home_page/widgets/home_page_first_part.dart b/lib/presentation/new_home_page/widgets/home_page_first_part.dart index b29e218..c5420fc 100644 --- a/lib/presentation/new_home_page/widgets/home_page_first_part.dart +++ b/lib/presentation/new_home_page/widgets/home_page_first_part.dart @@ -114,8 +114,8 @@ class HomePageFirstPart extends StatelessWidget { child: SizedBox( width: screenSize.width / 2, height: screenSize.height / 2.3, - child: - YoutubeVideoPlayer(youtubeVideoId: 'o5owbiQahnY'), + child: const YoutubeVideoPlayer( + youtubeVideoId: 'o5owbiQahnY'), ), ), ), diff --git a/lib/presentation/new_home_page/widgets/home_page_second_part.dart b/lib/presentation/new_home_page/widgets/home_page_second_part.dart index 3364818..5317030 100644 --- a/lib/presentation/new_home_page/widgets/home_page_second_part.dart +++ b/lib/presentation/new_home_page/widgets/home_page_second_part.dart @@ -8,8 +8,6 @@ import 'package:flutter/material.dart'; class HomePageSecondPart extends StatelessWidget { @override Widget build(BuildContext context) { - final Size screenSize = MediaQuery.of(context).size; - return Stack( children: [ SizedBox.expand( @@ -34,20 +32,20 @@ class HomePageSecondPart extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - Flexible( + const Flexible( flex: 2, child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ - const BorderTextWithShadow( + BorderTextWithShadow( 'About us', fontSize: 35, fontWeight: FontWeight.bold, ), - const SizedBox(height: 70), + SizedBox(height: 70), Row( mainAxisAlignment: MainAxisAlignment.center, - children: const [ + children: [ BorderTextWithShadow( 'CyBear Jinni ', fontSize: 25, diff --git a/lib/presentation/new_home_page/widgets/home_page_thired_part.dart b/lib/presentation/new_home_page/widgets/home_page_thired_part.dart index a082598..456685e 100644 --- a/lib/presentation/new_home_page/widgets/home_page_thired_part.dart +++ b/lib/presentation/new_home_page/widgets/home_page_thired_part.dart @@ -6,8 +6,6 @@ import 'package:flutter/material.dart'; class HomePageThiredPart extends StatelessWidget { @override Widget build(BuildContext context) { - final Size screenSize = MediaQuery.of(context).size; - return Stack( children: [ SizedBox.expand( @@ -22,11 +20,11 @@ class HomePageThiredPart extends StatelessWidget { Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Flexible( + const Flexible( flex: 3, child: Column( mainAxisAlignment: MainAxisAlignment.center, - children: const [ + children: [ BorderTextWithShadow( 'How to Setup', fontSize: 35, @@ -65,9 +63,9 @@ class HomePageThiredPart extends StatelessWidget { const Icon(Icons.error), ), const SizedBox(height: 32), - Row( + const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: const [ + children: [ BorderTextWithShadow( 'i. ', fontSize: 20, @@ -84,9 +82,9 @@ class HomePageThiredPart extends StatelessWidget { ], ), const SizedBox(height: 10), - Row( + const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: const [ + children: [ BorderTextWithShadow( 'ii. ', fontSize: 20, @@ -103,9 +101,9 @@ class HomePageThiredPart extends StatelessWidget { ], ), const SizedBox(height: 10), - Row( + const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: const [ + children: [ BorderTextWithShadow( 'iii. ', fontSize: 20, @@ -143,9 +141,9 @@ class HomePageThiredPart extends StatelessWidget { const Icon(Icons.error), ), const SizedBox(height: 32), - Row( + const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: const [ + children: [ BorderTextWithShadow( 'i. ', fontSize: 20, @@ -162,9 +160,9 @@ class HomePageThiredPart extends StatelessWidget { ], ), const SizedBox(height: 10), - Row( + const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: const [ + children: [ BorderTextWithShadow( 'ii. ', fontSize: 20, @@ -181,9 +179,9 @@ class HomePageThiredPart extends StatelessWidget { ], ), const SizedBox(height: 10), - Row( + const Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: const [ + children: [ BorderTextWithShadow( 'iii. ', fontSize: 20, diff --git a/lib/presentation/new_home_page/widgets/new_home_page_widget.dart b/lib/presentation/new_home_page/widgets/new_home_page_widget.dart index 066762d..0f218f1 100644 --- a/lib/presentation/new_home_page/widgets/new_home_page_widget.dart +++ b/lib/presentation/new_home_page/widgets/new_home_page_widget.dart @@ -10,8 +10,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; class NewHomePageWidget extends StatelessWidget { @override Widget build(BuildContext context) { - final Size screenSize = MediaQuery.of(context).size; - return BlocBuilder( builder: (context, state) { return state.map( diff --git a/lib/presentation/new_home_page/widgets/youtube_video_player.dart b/lib/presentation/new_home_page/widgets/youtube_video_player.dart index 0799f86..7804b3e 100644 --- a/lib/presentation/new_home_page/widgets/youtube_video_player.dart +++ b/lib/presentation/new_home_page/widgets/youtube_video_player.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:youtube_player_iframe/youtube_player_iframe.dart'; class YoutubeVideoPlayer extends StatefulWidget { - YoutubeVideoPlayer({ + const YoutubeVideoPlayer({ required this.youtubeVideoId, }); diff --git a/lib/presentation/shared_widgets/navigation_drawer/drawer_item_on_click_start_function.dart b/lib/presentation/shared_widgets/navigation_drawer/drawer_item_on_click_start_function.dart index 99869d8..31f8786 100644 --- a/lib/presentation/shared_widgets/navigation_drawer/drawer_item_on_click_start_function.dart +++ b/lib/presentation/shared_widgets/navigation_drawer/drawer_item_on_click_start_function.dart @@ -17,7 +17,7 @@ class DrawerItemOnClickStartFunction extends StatelessWidget { final IconData icon; /// What function to run if clicked - final Function onClickFunction; + final Function(BuildContext context) onClickFunction; @override Widget build(BuildContext context) {