android flutter
FrameLayout/RelativeLayout ---------------------------------- Stack
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffff00">
<View
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#ff0000"
android:layout_centerInParent="true"/>
<View
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#0000ff"
android:layout_centerInParent="true"/>
<View
android:layout_width="50dp"
android:layout_height="50dp"
android:background="#000000"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="100dp"/>
</RelativeLayout>
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() {
runApp(MaterialApp(
debugShowCheckedModeBanner: false,
home: MyApp(),
));
if (Platform.isAndroid) {
SystemUiOverlayStyle systemUiOverlayStyle =
SystemUiOverlayStyle(statusBarColor: Colors.transparent);
SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
}
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: Color(0xffffff00),
child: Stack(
alignment: AlignmentDirectional.center,
children: <Widget>[
Container(
width: 100,
height: 100,
color: Color(0xffff0000),
),
Container(
width: 50,
height: 50,
color: Color(0xff0000ff),
),
Container(
width: MediaQuery.of(context).size.width,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
width: 50,
height: 50,
color: Color(0xff000000),
margin: const EdgeInsets.only(bottom: 50.0),
),
SizedBox(
height: 50.0,
)
],
),
),
],
),
);
}
}