HseyinAkkaya Demin aynı işi yapmasını istediğim başka bir kod yazmıştım. Orda da yukarıdaki kodda da aynı hatayı aldım. Yukarıdaki kodun son hali ve aldığım hata,
import ‘package:flutter/cupertino.dart’;
import ‘package:flutter/material.dart’;
void main() {
runApp(
MaterialApp(
home: HomePage(),
),
);
}
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
TextEditingController textcontroller =TextEditingController();
List<String>str=<String>[];
@override
void dispose() {
textcontroller.clear();
super.dispose();
}
addvalue() {
setState(() {
str.add(textcontroller.text);
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(“sdsdfds”),
centerTitle: true,
backgroundColor: Colors.grey[700],
),
body: Container(
padding: EdgeInsets.all(20.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
child: TextField(
controller: textcontroller,
decoration: InputDecoration(
hintText: “Input value”,
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20.0),
),
),
),
),
Container(
margin: EdgeInsets.all(10.0),
child: RaisedButton(
color: Colors.lightBlueAccent,
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(20.0),
side: BorderSide(color: Colors.black),
),
child: Container(
padding: EdgeInsets.all(8.0),
child: Text(
“Add Value”,
style: TextStyle(
fontSize: 30.0,
fontWeight: FontWeight.bold,
),
),
),
onPressed: () {
str.add(textcontroller.text);
textcontroller.clear();
setState(() { });
},
),
),
ListView.builder(
itemCount:str.length,
itemBuilder: (context,item){
return Text(
“${str}”//veya str[item] ikisi de aynı hatayı veriyor.
);
},
),
],
),
),
);
}
}
____________________________________Aldığım Hata
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
Vertical viewport was given unbounded height.
The relevant error-causing widget was:
ListView file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:80:22
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderViewport#aeabf NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
ListView file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:80:22
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderViewport#aeabf NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
ListView file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:80:22
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderIgnorePointer#15e01 relayoutBoundary=up11 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
ListView file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:80:22
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderSemanticsAnnotations#ff335 relayoutBoundary=up10 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
ListView file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:80:22
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderPointerListener#be5ce relayoutBoundary=up9 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
ListView file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:80:22
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderSemanticsGestureHandler#c7878 relayoutBoundary=up8 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
ListView file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:80:22
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderPointerListener#43771 relayoutBoundary=up7 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
ListView file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:80:22
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: _RenderScrollSemantics#ed173 relayoutBoundary=up6 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
ListView file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:80:22
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderRepaintBoundary#f174c relayoutBoundary=up5 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
ListView file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:80:22
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderCustomPaint#45897 relayoutBoundary=up4 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
ListView file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:80:22
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderRepaintBoundary#4dd0a relayoutBoundary=up3 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
Column file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:41:16
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderFlex#59b93 relayoutBoundary=up2 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
Container file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:39:13
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
RenderBox was not laid out: RenderPadding#6c1a6 relayoutBoundary=up1 NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
‘package:flutter/src/rendering/box.dart’:
Failed assertion: line 1785 pos 12: ‘hasSize’
The relevant error-causing widget was:
Scaffold file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:33:12
════════════════════════════════════════════════════════════════════════════════════════════════════
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
Null check operator used on a null value
The relevant error-causing widget was:
Column file:///C:/Users/hsyna/AndroidStudioProjects/textfield_display_inputvalue/lib/main.dart:41:16
════════════════════════════════════════════════════════════════════════════════════════════════════
Yardımcı olabilirsen iyi olur valla. Bunu anlarsam bu sefer map te arama yapmayı deniycem.