Привет, я пытаюсь сделать что-то вроде этого.Все черные шары - изображения в формате png.![enter image description here](https://i.stack.imgur.com/8yPJj.png)
До сих пор я пробовал это,
final bolabola = ListView(
shrinkWrap: true,
//scrollDirection: Axis.horizontal,
children: <Widget>[
Container(
width: 20.0,
child: Image(
image: AssetImage("assets/scoreballs/n1.png",),
height: 25.0,
width: 25.0,
),
),
Container(
width: 20.0,
child: Image(
image: AssetImage("assets/scoreballs/n1.png",),
height: 25.0,
width: 25.0,
),
)
],
);
scrollDirection не работало, потому что я использую другое представление списка для отображения всех своих компонентов на странице.Как мне это исправить?
Редактировать: мой полный код ниже
import 'package:flutter/material.dart';
class Live extends StatefulWidget{
State<StatefulWidget> createState(){
return LiveState();
}
}
class LiveState extends State<Live> {
@override
Widget build(BuildContext context) {
//Live button
final livestatus = Chip(
backgroundColor: Colors.red,
label: Text("LIVE",style: TextStyle(fontSize: 9.0, fontWeight: FontWeight.bold, color: Colors.white), textAlign: TextAlign.center),
);
//Status bar
final status = Text("Richmond College won the toss and elected to bat first", style: TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold), textAlign: TextAlign.center);
//School Crest
final crest = Image(
image: AssetImage("assets/crest.png"),
height: 79.0,
width: 64.0,
);
final score = Text("182/4", style: TextStyle(fontSize: 73.0, color: Colors.blueAccent, fontWeight: FontWeight.bold), textAlign: TextAlign.center,);
final overs = Text("23.5 Overs", style:TextStyle(fontSize: 30.0, color: Colors.grey, fontWeight: FontWeight.bold),textAlign: TextAlign.center, );
final scorecard = Text("Scorecard", style:TextStyle(fontSize: 10.0, color: Colors.black, fontWeight: FontWeight.bold),textAlign: TextAlign.center, );
final bolabola = ListView(
shrinkWrap: true,
//scrollDirection: Axis.horizontal,
children: <Widget>[
Container(
width: 20.0,
child: Image(
image: AssetImage("assets/scoreballs/n1.png",),
height: 25.0,
width: 25.0,
),
),
Container(
width: 20.0,
child: Image(
image: AssetImage("assets/scoreballs/n1.png",),
height: 25.0,
width: 25.0,
),
)
],
);
/*
final scoreballs = Image(
image: AssetImage("assets/scoreballs/n1.png",),
height: 25.0,
width: 25.0,
);
*/
return Scaffold(
backgroundColor: Colors.white,
body: Center(
child: ListView(
shrinkWrap: true,
children: <Widget>[
livestatus,
SizedBox(height: 0.0),
status,
SizedBox(height: 10.0),
crest,
SizedBox(height: 5.0),
score,
overs,
scorecard,
bolabola,
],
)
),
);
}
}