diff --git a/lib/src/features/general/presentation/general_section.dart b/lib/src/features/general/presentation/general_section.dart index 3feec42..911f59c 100644 --- a/lib/src/features/general/presentation/general_section.dart +++ b/lib/src/features/general/presentation/general_section.dart @@ -7,16 +7,11 @@ import 'package:portfolio/src/features/general/presentation/widgets/end_drawer.d import 'package:portfolio/src/features/general/presentation/widgets/safe_area.dart'; import 'package:portfolio/src/common/widgets/responsive.dart'; -class GeneralSection extends ConsumerStatefulWidget { +class GeneralSection extends ConsumerWidget { const GeneralSection({super.key}); @override - ConsumerState createState() => _MainSectionState(); -} - -class _MainSectionState extends ConsumerState { - @override - Widget build(BuildContext context) { + Widget build(BuildContext context, WidgetRef ref) { return Scaffold( backgroundColor: Theme.of(context).colorScheme.secondary, endDrawer: const MySafeArea( diff --git a/lib/src/features/general/presentation/general_section_tablet.dart b/lib/src/features/general/presentation/general_section_tablet.dart index 7a3e1d2..a8b58f8 100644 --- a/lib/src/features/general/presentation/general_section_tablet.dart +++ b/lib/src/features/general/presentation/general_section_tablet.dart @@ -12,16 +12,11 @@ import 'package:portfolio/src/features/general/provider/scroll_controller.dart'; import 'package:portfolio/src/features/general/provider/section_key_provider.dart'; import 'package:portfolio/src/common/widgets/responsive.dart'; -class GeneralTablet extends ConsumerStatefulWidget { +class GeneralTablet extends ConsumerWidget { const GeneralTablet({super.key}); @override - ConsumerState createState() => _MainTabletState(); -} - -class _MainTabletState extends ConsumerState { - @override - Widget build(BuildContext context) { + Widget build(BuildContext context, WidgetRef ref) { final scrollController = ref.watch(scrollControllerProvider); return Column( @@ -37,7 +32,7 @@ class _MainTabletState extends ConsumerState { SliverList.list( children: [ Padding( - padding: _buildResponsivePadding(), + padding: _buildResponsivePadding(context: context), child: Align( alignment: Alignment.topLeft, child: AnimatedFadeSlide( @@ -86,7 +81,7 @@ class _MainTabletState extends ConsumerState { ); } - EdgeInsetsGeometry _buildResponsivePadding() { + EdgeInsetsGeometry _buildResponsivePadding({required BuildContext context}) { if (Responsive.isTablet(context)) { return const EdgeInsets.fromLTRB(48, 60, 48, 88); } else if (Responsive.isMobile(context)) {