小编Ουι*_*ευα的帖子

如何均匀地更改 Flutter 中滑块的轨道高度?

我的代码:

          Padding(
            padding: const EdgeInsets.symmetric(horizontal: 12),
            child: SliderTheme(
              data: SliderTheme.of(context).copyWith(
                inactiveTrackColor: Color(0xff8d8e98),
                activeTrackColor: Colors.white,
                thumbColor: Color(0xffeb1555),
                overlayColor: Color(0x29eb1555),
                thumbShape: RoundSliderThumbShape(enabledThumbRadius: 15),
                overlayShape: RoundSliderOverlayShape(overlayRadius: 30),
                trackHeight: 2,                                             
              ),
              child: Slider(
                value: 183,
                min: 10,
                max: 270,
                onChanged: (double value) {},
              ),
            ),
          ),
Run Code Online (Sandbox Code Playgroud)

我懂了:

坏的

我期待这个:

好的

我怎么才能得到它?

slider dart material-design flutter

3
推荐指数
2
解决办法
615
查看次数

何时/何地在 FastAPI 中使用正文/路径/查询/字段?

我正在关注FastAPI的教程,到目前为止,我对 FastAPI 中何时/何地使用 Body/Path/Query/Field 有疑问?因为它们似乎都以相同的方式工作,所以本教程对它们的区别使用了模糊的解释,还是我遗漏了什么?

奖金问题*真的有用吗?我在教程的示例代码中设置/省略了它,但我没有看到区别。

validation metadata fastapi

3
推荐指数
1
解决办法
1496
查看次数

函数的返回值可以用 Postgraphile 的特定名称命名吗?

我在 PostgreSQL 中有这个函数:

CREATE FUNCTION it_exists(
  email text,
  name text
) RETURNS boolean AS $$
DECLARE
  _eva1 boolean;
  _eva2 boolean;
BEGIN
  _eva1 := EXISTS(SELECT * FROM tableA AS A WHERE A.email = $1::citext);
  _eva2 := EXISTS(SELECT * FROM tableB AS A WHERE A.name::citext = $2::citext);
  RETURN _eva1 OR _eva2;
END;
$$ LANGUAGE plpgsql STRICT SECURITY DEFINER;
Run Code Online (Sandbox Code Playgroud)

它被翻译成 Postgraphile 是这样的:

mutation MyMutation($email: String!, $name: String!) {
  itExists(
    input: { email: $email, name: $name }
  ) {
    boolean
  }
}
Run Code Online (Sandbox Code Playgroud)

我想将“布尔”名称更改为“结果”之类的名称,有什么建议吗?考虑我有许多具有不同返回值的函数。

postgresql postgraphile

2
推荐指数
1
解决办法
292
查看次数

将 Python 更新到 3.6 后,Virtualenvwrapper 未初始化

我的操作系统 (Arch Linux) 最近将 Python 从 3.5.2 更新到 3.6.0,现在运行任何终端时我都会收到以下消息:

/usr/bin/python: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module named 'virtualenvwrapper')
virtualenvwrapper.sh: There was a problem running the initialization hooks. 

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.
Run Code Online (Sandbox Code Playgroud)

此外我得到这些输出

$ whereis python
python: /usr/bin/python3.6 /usr/bin/python3.6m /usr/bin/python3.6-config /usr/bin/python3.6m-config /usr/bin/python2.7-config /usr/bin/python /usr/bin/python2.7 /usr/lib/python3.6 /usr/lib/python3.5 /usr/lib/python2.7 /usr/include/python3.6m /usr/include/python2.7 /usr/share/man/man1/python.1.gz

$ which python
/usr/bin/python

$ python --version
Python 3.6.0 …
Run Code Online (Sandbox Code Playgroud)

virtualenv archlinux virtualenvwrapper python-3.x

1
推荐指数
1
解决办法
1156
查看次数

Flutter 中通过键从 Map 获取值

我有以下地图

{
"Afghanistan": "A004",
"Albanien": "A008",
"Algerien": "A012",
"Amerikanisch-Samoa": "A016",
"Amerikanische Jungferninseln": "A850",
"Andorra": "A020" }
Run Code Online (Sandbox Code Playgroud)

我正在映射它

  final landcodes =
      Map<String, String>.fromIterables(countryList, codeList);
Run Code Online (Sandbox Code Playgroud)

我现在尝试通过使用以下代码提供一个键来提取一个值:

 var value = landcodes.values.firstWhere((element) => landcodes[element] 
     == 'Andorra');
Run Code Online (Sandbox Code Playgroud)

但每次我收到以下错误响应:

Unhandled Exception: Unhandled error Bad state: No element occurred in Instance of 'AdressAenderungBloc'.
#0      Iterable.firstWhere (dart:core/iterable.dart:516:5)
Run Code Online (Sandbox Code Playgroud)

dart flutter

0
推荐指数
1
解决办法
1万
查看次数