我在屏幕底部的一行中有两个按钮。我想将第一个按钮保留在中间,第二个按钮保留在末尾。我怎样才能做到这一点?
这是我的代码
new Container
(
child:Row(
children:<Widget>[
new RaisedButton(
color: Colors.red,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10)),
onPressed: takescrshot,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Next',
style:
TextStyle(fontSize: 23, color: Colors.white),
),
),
),
new FloatingActionButton.extended(
onPressed: () {
// Add your onPressed code here!
},
label: Text('options'),
icon: Icon(Icons.menu),
backgroundColor: Colors.pink,
),
])
)
Run Code Online (Sandbox Code Playgroud)
有人可以指导我吗?
我有一个Unit8List列表,它存储多个图像的数据。我想与其他活动共享该列表,以便其他活动可以使用该列表来显示图像。那么我如何使用SharedPreferences进行共享?或者有什么方法可以用来传递具有 Unit8List 对象的列表?
我想从图像中提取主色,以便我可以将其应用为混合到其他图像。我怎样才能做到这一点?
在我当前的代码中,我手动给出了颜色,但我希望它由应用程序生成。
class MyApp extends StatelessWidget {
Color face = new HexColor("a8a8a8");
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text("Image from assets"),
),
body: Column (
mainAxisAlignment: MainAxisAlignment.center,
children:<Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.start,
children:<Widget>[
new Image.asset('assets/images/6.jpg',
color: face, colorBlendMode:BlendMode.modulate ,
fit:BoxFit.cover,
height: 50,
width: 50,
),
new Image.asset('assets/images/1.jpg',
color: face, colorBlendMode: BlendMode.modulate,
fit:BoxFit.cover,
height: 200,
width: 200,
),
]),
])),
);
}
}
Run Code Online (Sandbox Code Playgroud) 我想在按下后退按钮时将我当前的 flutter 页面重定向到主页。当我按下后退按钮时,主页/活动应该开始。我在主页和当前页面中有多个选择,如果用户不想选择他们可以按回进入主页,我会显示眼睛。
这是我当前页面/活动的代码
import '../DataFetching/face_part.dart';
import 'package:flutter/material.dart';
class EyesFetch extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then …Run Code Online (Sandbox Code Playgroud)