我正在尝试在 flutter 中创建一个屏幕,该屏幕有 3 行堆叠在一起,但我不断收到语法错误。我在正文、Rows 等中尝试了多个容器并不断收到语法错误,我尝试做的事情是不可能的吗?我认为 Rows 是可堆叠的,或者至少是一个主体中的容器。
这是代码:
import 'package:flutter/material.dart';
class Index extends StatelessWidget {
@override
Widget build(BuildContext context) {
// TODO: implement build
return new Scaffold(
appBar: new AppBar(
backgroundColor: const Color(0xFF0099a9),
),
body: Row(
//ROW 1
children: [
Container(
color: Colors.orange,
margin: EdgeInsets.all(25.0),
child: FlutterLogo(
size: 60.0,
),
),
Container(
color: Colors.blue,
margin: EdgeInsets.all(25.0),
child: FlutterLogo(
size: 60.0,
),
),
Container(
color: Colors.purple,
margin: EdgeInsets.all(25.0),
child: FlutterLogo(
size: 60.0,
),
),
],
),
Row(
//ROW 2
children: …Run Code Online (Sandbox Code Playgroud) 我正在尝试制作一个可选择的列表视图。
我选择了RadioListTile,但它不需要与Radios,我会很高兴ListTile点击项目时a 的背景颜色变化。所以在我当前的代码中,我有RadioListTiles,但它没有检查水龙头,我认为它可以检查多个,因为它在一个ListView.builder,但我不知道,因为我是新手,它是不工作。
这是代码:
ListView.builder(
scrollDirection: Axis.vertical,
itemCount: items.length,
itemBuilder: (context, index) {
return RadioListTile<LoadList>(
selected: isSelected,
groupValue: radiolist,
value: items[index],
onChanged: (LoadList value) {
radiolist.GetHours(value.hours);
print("CurrentSelected $index");
setState(() {
isSelected = true;
});
},
title: new Text(index),
);
},
),
Run Code Online (Sandbox Code Playgroud)