Created
December 12, 2022 13:27
-
-
Save chooyan-eng/ac95202fded2fbbcac0615a2490aeff6 to your computer and use it in GitHub Desktop.
Another Stack practice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
home: Scaffold( | |
body: Column( | |
children: [ | |
Expanded( | |
child: Container( | |
width: double.infinity, | |
color: Colors.grey[300], | |
), | |
), | |
Stack( | |
alignment: Alignment.center, | |
clipBehavior: Clip.none, | |
children: [ | |
Container( | |
height: 120, | |
width: double.infinity, | |
color: Colors.teal, | |
), | |
Positioned( | |
bottom: 0, | |
child: Column( | |
children: [ | |
Container( | |
color: Colors.white, | |
width: 100, | |
height: 50, | |
child: const Center(child: Text('出っぱるかも')), | |
), | |
Container( | |
color: Colors.white, | |
width: 280, | |
height: 100, | |
child: const Center(child: Text('土台')), | |
), | |
], | |
), | |
), | |
], | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment