如何让代码在继续之前等待功能完成?

时间:2020-04-20 22:08:44

标签: flutter dart dart-async

我还是不熟悉,并且正在开发一个要求用户必须具有帐户才能使用的应用程序。我的意图是每个帐户只能在一个设备上使用,但是我很难实现这一点。我需要代码等待'checkDeviceID()'函数完成后再继续操作,因为稍后需要此函数返回的值。这是我到目前为止的内容:

"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject"
<template>
<div class="container">
    <div class="item" style="height:250px;">1</div>
    <div class="item" style="height:275px;">2</div>
    <div class="item" style="height:300px;">3</div>

    <div class="item" style="height:225px;">4</div>
    <div class="item" style="height:275px;">5</div>
    <div class="item" style="height:200px;">6</div>

    <div class="item" style="height:250px;">7</div>
    <div class="item" style="height:300px ;">8</div>
    <div class="item" style="height:325px;">9</div>
</div>
</template>
<!--SCRIPTS-->
<script>
export default {
name: 'LAYOUTcard19',


};
</script>
<!--STYLES-->
<style scoped>
.container{width:100%; height:auto; display:flex; flex-wrap:wrap;}
.item{width:30%; background-color:red; margin:10px;}
</style>




我认为可能有一种更有效的方法来进行此过程,任何反馈都将受到赞赏。

0 个答案:

没有答案