🚧 remove new keyword to get inline with dart 2 code standard.

This commit is contained in:
Nishant Srivastava
2019-07-23 03:42:56 +02:00
parent e8b433c00d
commit 6d56bfc5d4
45 changed files with 438 additions and 438 deletions

View File

@ -4,15 +4,15 @@ import 'package:http/http.dart' as http;
import 'dart:convert';
void main() {
runApp(new MaterialApp(
home: new MyGetHttpData(),
runApp(MaterialApp(
home: MyGetHttpData(),
));
}
// Create a stateful widget
class MyGetHttpData extends StatefulWidget {
@override
MyGetHttpDataState createState() => new MyGetHttpDataState();
MyGetHttpDataState createState() => MyGetHttpDataState();
}
// Create the state for our stateful widget
@ -44,27 +44,27 @@ class MyGetHttpDataState extends State<MyGetHttpData> {
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Retrieve JSON Data via HTTP GET"),
return Scaffold(
appBar: AppBar(
title: Text("Retrieve JSON Data via HTTP GET"),
),
// Create a Listview and load the data when available
body: new ListView.builder(
body: ListView.builder(
itemCount: data == null ? 0 : data.length,
itemBuilder: (BuildContext context, int index) {
return new Container(
child: new Center(
child: new Column(
return Container(
child: Center(
child: Column(
// Stretch the cards in horizontal axis
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
new Card(
child: new Container(
child: new Text(
Card(
child: Container(
child: Text(
// Read the name field value and set it in the Text widget
data[index]['name'],
// set some style to text
style: new TextStyle(
style: TextStyle(
fontSize: 20.0, color: Colors.lightBlueAccent),
),
// added padding