小编use*_*015的帖子

Flutter安装Gradle问题

我正在尝试使用flutter运行一个基本的hello world项目。这些是我在运行Window 10 Pro的Windows机器上安装Flutter所采取的步骤。

1)下载flutter_windows_v0.9.4-beta.zip并解压缩到c:\ src \

2)在环境设置中添加位置... C:\ src \ flutter

3)下载并安装Android Studio,并使用ADV Manager设置模拟器。

4)下载并安装Visual Studio Code

5)添加了Dart 2.19.0扩展

6)添加Flutter 2.19.0扩展

7)运行Flutter医生

[flutter] flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel beta, v0.9.4, on Microsoft Windows [Version 10.0.15063], locale en-GB)
[?] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[?] Android Studio (version 3.2)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not …
Run Code Online (Sandbox Code Playgroud)

install gradle flutter

8
推荐指数
2
解决办法
9668
查看次数

编码大型嵌套功能块时的经验法则

我已经在c#编写了一段时间,并且通常对编码标准的经验法则有很好的了解.我最近鼓励我的大学采用基于结果的方法来编写功能块,而不是嵌套逻辑块,并且正在寻求你的建议.下面是我正在谈论的一个例子,其中一种情况的结果用于确定代码路径而不是嵌套.有人建议这种方法更容易阅读,特别是如果结果需要多层嵌套,但我更喜欢使用Curly定律和重构方法和函数,其中嵌套变深.

private void MethodOne()
    {

        bool CarryOn = false;

        // first layer
        if (ValidationRuleOne() == true)
        {
            CarryOn = true;

        } else {

            CarryOn = false;
        }

        // second layer
        if (CarryOn) 
        {
            CarryOn = ValidationRuleTwo();

        } else {

            CarryOn = false;
        }

        // third layer
        if (CarryOn)
        {
            CarryOn = ValidationRuleThree();

        } else
        {

            CarryOn = false;
        }

    }
Run Code Online (Sandbox Code Playgroud)

这种方法对我来说似乎不对,因为我建议将该方法重写为..

        private void MethodOne()
    {



        // first layer
        if (ValidationRuleOne() == true)
        {

            // second layer
            if (ValidationRuleTwo() …
Run Code Online (Sandbox Code Playgroud)

c# refactoring

4
推荐指数
3
解决办法
327
查看次数

标签 统计

c# ×1

flutter ×1

gradle ×1

install ×1

refactoring ×1