@@ -71,11 +71,7 @@ class _FrontpageState extends State<Frontpage> {
7171 duration: Duration (milliseconds: 400 ),
7272 curve: Curves .easeInOut,
7373 );
74- }
75-
76- Future <void > _onDestinationSelected (BuildContext context, int index) async {
77- await scrollTo (sectionKeys[index]);
78- selectedDestinationIndex.value = index;
74+ selectedDestinationIndex.value = sectionKeys.indexOf (key);
7975 }
8076
8177 @override
@@ -107,11 +103,17 @@ class _FrontpageState extends State<Frontpage> {
107103 },
108104 ),
109105 ),
110- AboutMeSection (key: aboutMeSectionKey),
106+ Container (
107+ color: Theme .of (context).colorScheme.surfaceContainer,
108+ child: AboutMeSection (key: aboutMeSectionKey),
109+ ),
111110 DesignPrinciplesSection (),
112111 TimelineSection (key: timelineSectionKey),
113112 ProjectsSection (key: projectsSectionKey),
114- ContactSection (key: contactSectionKey),
113+ Container (
114+ color: Theme .of (context).colorScheme.surfaceContainer,
115+ child: ContactSection (key: contactSectionKey),
116+ ),
115117 ],
116118 ),
117119 ),
@@ -185,10 +187,7 @@ class _FrontpageState extends State<Frontpage> {
185187
186188 return TextButton .icon (
187189 onPressed: () {
188- _onDestinationSelected (
189- context,
190- Frontpage .destinations.indexOf (destination),
191- );
190+ scrollTo (sectionKeys[Frontpage .destinations.indexOf (destination)]);
192191 },
193192 style: TextButton .styleFrom (
194193 padding: padding,
@@ -209,8 +208,8 @@ class _FrontpageState extends State<Frontpage> {
209208 builder: (context, selectedIndex, child) {
210209 return NavigationDrawer (
211210 selectedIndex: selectedDestinationIndex.value,
212- onDestinationSelected: (value ) {
213- _onDestinationSelected (context, value );
211+ onDestinationSelected: (index ) {
212+ scrollTo (sectionKeys[index] );
214213 scaffoldKey.currentState? .closeDrawer ();
215214 },
216215 children: [
0 commit comments