我想在Flutter应用中添加一个“使用Google登录”按钮。此按钮应符合Google 的条款。
我的问题是,我创建的按钮看起来真的很糟糕。
我使用了Google在其网站上提供的图像,但不知道我是否正确地使用了按钮的代码。
Widget _createLoginButtonGoogle() {
return new Expanded(
child: new Container(
margin: EdgeInsets.fromLTRB(30.0, 5.0, 30.0, 5.0),
child: new RaisedButton(
color: const Color(0xFF4285F4),
shape: _createButtonBorder(),
onPressed: () {},
child: new Row(
children: <Widget>[
new Image.asset(
'res/images/icons/google/btn_google_dark_normal_mdpi.9.png',
height: 48.0,
),
new Expanded(
child: _createButtonText('Sign in with Google', Colors.white),
),
],
),
),
),
);
}
Run Code Online (Sandbox Code Playgroud)
我想要的是我的按钮看起来像原始的Google按钮
而且不喜欢我的版本
谁能告诉我如何创建原始的Google按钮?有没有比创建一个更好的方法RaisedButton?
我如何在 Flutter 中创建具有多选功能的 gridview 布局,例如 android 照片应用程序?我正在寻找现有的小部件,但找不到。
我现在拥有的是:一个 n 行 2 列的 gridview 布局。这些单元格包含一个带有一些信息和标题文本的 GridTile 小部件。现在我想要一个类似于 android 照片应用程序的功能,在这些图块上长按后,所有项目的左上角都会出现一个复选圆圈。
我是否必须自己构建它,还是有一个我目前没有找到的现有 Flutter 小部件?