Skip to content

Instantly share code, notes, and snippets.

@chooyan-eng
Created December 12, 2022 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chooyan-eng/ac95202fded2fbbcac0615a2490aeff6 to your computer and use it in GitHub Desktop.
Save chooyan-eng/ac95202fded2fbbcac0615a2490aeff6 to your computer and use it in GitHub Desktop.
Another Stack practice
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