我的代码:
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)
我懂了:
我期待这个:
我怎么才能得到它?
我在 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)
我想将“布尔”名称更改为“结果”之类的名称,有什么建议吗?考虑我有许多具有不同返回值的函数。
我的操作系统 (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) 我有以下地图
{
"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 ×2
flutter ×2
archlinux ×1
fastapi ×1
metadata ×1
postgraphile ×1
postgresql ×1
python-3.x ×1
slider ×1
validation ×1
virtualenv ×1