-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eaf55bb
commit 055fada
Showing
10 changed files
with
119 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,64 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:http/http.dart'; | ||
import 'dart:convert'; | ||
|
||
class ResultDisplay extends StatefulWidget { | ||
var response; | ||
ResultDisplay(this.response); | ||
@override | ||
_ResultDisplayState createState() => _ResultDisplayState(); | ||
_ResultDisplayState createState() => _ResultDisplayState(this.response); | ||
} | ||
|
||
class _ResultDisplayState extends State<ResultDisplay> { | ||
var response; | ||
resultDisplay(var x) { | ||
this.response = x; | ||
} | ||
_ResultDisplayState(this.response); | ||
|
||
// var notesJson = json.decode(response); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text("Best results for your search!"), | ||
), | ||
body: ListView.builder( | ||
itemBuilder: (context, index) { | ||
return Card( | ||
child: Padding( | ||
padding: const EdgeInsets.only(top: 32.0, bottom: 32.0, left: 16.0, right: 16.0), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
Text( | ||
response[index].title, | ||
style: TextStyle( | ||
fontSize: 22, | ||
fontWeight: FontWeight.bold | ||
appBar: AppBar( | ||
title: Text("responses"), | ||
), | ||
body: ListView.builder( | ||
itemBuilder: (context, index) { | ||
return Card( | ||
child: Padding( | ||
padding: const EdgeInsets.only( | ||
top: 32.0, bottom: 32.0, left: 16.0, right: 16.0), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: <Widget>[ | ||
Text( | ||
response[index]["name"].toString(), | ||
style: | ||
TextStyle(fontSize: 22, fontWeight: FontWeight.bold), | ||
), | ||
Text( | ||
"age: " + response[index]["age"].toString(), | ||
style: TextStyle(color: Colors.grey.shade600), | ||
), | ||
Text( | ||
"gender: " + response[index]["gender"].toString(), | ||
style: TextStyle(color: Colors.grey.shade600), | ||
), | ||
Text( | ||
"distance: " + | ||
response[index]["distance"].toString() + | ||
" km", | ||
style: TextStyle(color: Colors.grey.shade600), | ||
), | ||
), | ||
Text( | ||
response[index].text, | ||
style: TextStyle( | ||
color: Colors.grey.shade600 | ||
Text( | ||
"contact no. " + response[index]["contact"].toString(), | ||
style: TextStyle(color: Colors.grey.shade600), | ||
), | ||
), | ||
], | ||
], | ||
), | ||
), | ||
), | ||
); | ||
}, | ||
itemCount: response.length, | ||
) | ||
); | ||
); | ||
}, | ||
itemCount: response.length, | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.