Using basic widgets
We will start by revising some basics, which will involve creating sections of our home page. To begin, open the chapter2_start/lib/widgets/featured_section.dart
file and start updating the code as the following.
First, we will create a stateless widget:
import 'package:flutter/material.dart'; class FeaturedSection extends StatelessWidget { const FeaturedSection({ Key? key }) : super(key: key); @override Widget build(BuildContext context) { return Container(); } }
Here, we are creating a stateless widget that just displays a blank container. Our featured section will have an image, a title, a description, and a button. We want to display the image on the left and content on the right, or vice versa. Let’s add our image and content. Update the body of the build
method, as follows:
return Container( child: Row( children: [ ...