尝试为一个新的手机应用开发这个屏幕



大家好,我正在努力开发一个应用程序在扑动,但似乎无法通过第一个屏幕。有谁能帮忙吗?

Stack overflow不允许我上传图片所以现在你有一个链接

链接显示我想要实现的

这第二个链接显示了我目前拥有的…

这是我现在拥有的

我代码:

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() => runApp(const pantallaPrincipal());

class pantallaPrincipal extends StatelessWidget {
const pantallaPrincipal({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'ASA',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
),
home: const MyHomePage(title: 'Conectado'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
body: Center(
child: Container(
color: Color.fromRGBO(51, 189, 175, 100),
child: Container(
color: Color.fromRGBO(98, 138, 134, 60),
margin: new EdgeInsets.only(bottom: 100),
child: Image.asset('IMG/Group 70.png'),
)
),
)
);// This trailing comma makes auto-formatting nicer for build methods.
}
}

如果我能帮助你,我将不胜感激。

正如Guilherme Gabanelli建议的那样,试着看看行和列,也检查一下堆栈小部件是如何工作的,这可以帮助你越来越多地设计这些小部件,为你弄清楚。

您需要拉伸包装图像的容器以匹配设备的高度和宽度。这样做

return Scaffold(
body: Container(
height: double.infinity
width: double.infinity
child: Container(
color: Color.fromRGBO(51, 189, 175, 100),
child: Container(
color: Color.fromRGBO(98, 138, 134, 60),
margin: new EdgeInsets.only(bottom: 100),
child: Image.asset('IMG/Group 70.png', fit: BoxFit.cover),
)
),
)
);

这只适用于使用整个屏幕来覆盖您的图像。如果你按照别人的建议自己添加颜色和东西,你需要看看行和列的概念。

Row可以将一个widget垂直放置在另一个widget之上或之下。你可以放置任意多个带有颜色的容器或任何小部件,一个一个地放在另一个上面。

列在水平方向做同样的事情。一个部件并排放在另一个部件上。你可以像这样放置任意数量的小部件。

希望这对你有帮助:)

最新更新