Stack Position widgets on a Stack

This lesson is available for PRO members or as a single course purchase. Sign-in and choose a plan below.

Example Code

file_type_dartlang main.dart
class MyApp extends StatelessWidget {
 @override
 Widget build(BuildContext context) {
   return MaterialApp(
     home: Scaffold(
       body: SizedBox.expand(
         child: Stack(
           children: <Widget>[
             Icon(
               Icons.camera,
               size: 100,
               color: Colors.red,
             ),
             Align(
                 alignment: Alignment.center,
                 child: Icon(
                   Icons.camera,
                   size: 100,
                   color: Colors.blue,
                 )),
             Positioned(
                 bottom: 20,
                 left: 100,
                 child: Icon(
                   Icons.camera,
                   size: 100,
                   color: Colors.green,
                 ))
           ],
         ),
       ),
     ),
   );
 }
}

Questions?

Ask questions via GitHub below OR chat on Slack #questions