在Visual Studio中代码Ctrl+V
不能在编辑器上工作,
但是从命令调色板Ctrl+Shift+V
工作.
var num1 = 10.12345678
Run Code Online (Sandbox Code Playgroud)
我应该如何使用 num1 删除两个小数点后的数字而不舍入其值。
我需要输出为10.12
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
title: ' Delete digits after two decimal point ',
theme: ThemeData(primarySwatch: Colors.blue),
home: MyHome(),
));
class MyHome extends StatefulWidget {
@override
_MyHomeState createState() => _MyHomeState();
}
class _MyHomeState extends State<MyHome> {
@override
Widget build(BuildContext context) {
var num1 = 10.12345678;
print(num1); // I need output as 10.12
return Container();
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 curl -fsSL get.docker.com -o get-docker.sh 安装 docker
它返回:
curl: (23) Failed writing body (0 != 13847)
Run Code Online (Sandbox Code Playgroud) 我在运行命令npm install时创建了 nodejs 项目,但它因某些错误而失败
同一个项目正在ubuntu系统上运行,但是当我在mac系统上克隆此代码并尝试运行 npm install 时,它失败并出现一些错误
我认为 scrypt 模块有问题,但我不知道确切原因请帮助我,提前致谢
操作系统:MAC
节点:10.15
Npm:6.0
请参阅下面的错误:-
WareWolf:mynodeapp$ npm install
> scrypt@6.0.3 preinstall /node_modules/scrypt
> node node-scrypt-preinstall.js
Error: Error: Command failed: ./configure
configure: error: /node_modules/scrypt/scrypt/scrypt-1.2.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
> scrypt@6.0.3 install /node_modules/scrypt
> node-gyp rebuild
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (/usr/local/Cellar/nvm/0.34.0/versions/node/v10.15.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! …
Run Code Online (Sandbox Code Playgroud) 我使用如下所示的旋转图标,但我不知道为什么它不旋转。它就像普通图标一样工作。
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
class MyWidget extends StatelessWidget {
Widget build(BuildContext context) {
return new IconButton(
// Use the FontAwesomeIcons class for the IconData
icon: new Icon(FontAwesomeIcons.spinner),
onPressed: () { print("Pressed"); }
);
}
}
Run Code Online (Sandbox Code Playgroud) 无法访问 phpmyadmin:http://ip/phpmyadmin
它显示“出于安全原因,只能使用 localhost (127.0.0.1) 作为主机名访问此 URL。”
请建议我解决这个问题。
我正在尝试更改 的边框宽度TextFromField
,但它不起作用。
下面是我的代码。
TextFormField(
decoration: InputDecoration(
border: OutlineInputBorder(
borderSide: new BorderSide(color: Colors.white,width:2)),
fillColor: Colors.white,
labelText: 'Enter your username or email address'
),
),
Run Code Online (Sandbox Code Playgroud)
我已经使用 CircularProgressIndicator 来显示进度,我在 CircularProgressIndicator 中使用 strokeWidth 使其变薄,但现在我必须使用 LinearProgressIndicator ,正如我所看到的, LinearProgressIndicator 没有类似 strokeWidth 的东西。
我该怎么办?
new IconButton(
icon:
_isLoading
? Center(child: CircularProgressIndicator(strokeWidth: 1,),)
:
Icon(Icons.check,),
),
Run Code Online (Sandbox Code Playgroud)
现在我正在使用如下所示的 LinearProgressIndicator 但它很厚
new IconButton(
icon:
_isLoading
? Center(child: LinearProgressIndicator(),)
:
Icon(Icons.check,),
),
Run Code Online (Sandbox Code Playgroud)