April 2020
Intermediate to advanced
380 pages
9h 24m
English
After successfully detecting faces and painting rectangles around them, we will now display the final image on the screen. We first build the final scaffold for our second screen. We will override the build() method inside FaceDetectionState to return the scaffold as follows:
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("Face Detection"), ), body: (image == null) ? Center(child: CircularProgressIndicator(),) : Center( child: FittedBox( child: SizedBox( width: image.width.toDouble(), height: image.width.toDouble(), child: CustomPaint(painter: FacePainter(image, faces)) ), ), ) ); }
We start by creating the appBar for the screen, providing a title,
Read now
Unlock full access