gpt4 book ai didi

android - 如何使用 flutter 建立此屏幕的白色区域?

转载 作者:行者123 更新时间:2023-12-03 04:39:57 25 4
gpt4 key购买 nike

我是Flutter框架的新手,我想创建以下 Activity ,我知道如何创建 Activity 永久区域,但是我不知道该屏幕的白色部分,该屏幕中使用的小部件是什么,请指导我我可以使用Flutter创建此部分吗?
enter image description here
这是我的代码

    import 'package:flutter/material.dart';

import 'bottomnavigationbar.dart';

class Contact extends StatefulWidget {
@override
_ContactState createState() => _ContactState();
}

class _ContactState extends State<Contact> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Contact"),
),

body: Container(

padding: EdgeInsets.all(1),
color: Colors.black,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.width/1.6,
// constraints: BoxConstraints.expand(),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("images/contactpage.png"),
fit: BoxFit.cover),
),
),
Padding(
padding: EdgeInsets.all(8),
),
Text(
"Contact Info",
style: TextStyle(
color: Colors.red,
fontSize: 20,
fontWeight: FontWeight.w400,
),
),
Padding(
padding: EdgeInsets.all(8),
),
Divider(
color: Colors.white,
indent: 40,
endIndent: 40,
),
],
),
),
bottomNavigationBar: BottomNavigation(),
);
}
}

最佳答案

试试这个例子

import 'package:flutter/material.dart';

class UsingAlertDialog extends StatefulWidget{
@override
UsingAlertDialogState createState()=> new UsingAlertDialogState();
}

class UsingAlertDialogState extends State<UsingAlertDialog>{
AlertDialog dialog = new AlertDialog(
content: new Text(
"I'm a AlertDialog",
style: new TextStyle(fontSize: 30.0),
),
);
@override
Widget build(BuildContext context){
return Scaffold(
appBar: new AppBar(
title: new Text("Using Alert Dialog"),
),
body: new Container(
child: new Center(
child: new RaisedButton(
child: new Text("Touch Me"),
onPressed: (){
showDialog(
context: context,
builder: (BuildContext context)=>dialog
);
},
),
),
),
);
}
}
=========更新========
模型组件可以是自定义对话框
SimpleDialog
关于电话,您可以使用此套餐
url_launche

关于android - 如何使用 flutter 建立此屏幕的白色区域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63424400/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com