Fakultas Ilmu Komputer UI

Commit 076ed44f authored by Firriyal Bin Yahya's avatar Firriyal Bin Yahya
Browse files

[CHORE] menambahkan list sekolah di page informasi sekolah

parent 1cded1bc
Pipeline #41068 failed with stages
in 7 minutes and 4 seconds
import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/page/dashboard/dashboard.dart';
import 'package:ppl_disabilitas/page/informasi/list_sekolah.dart';
//import 'package:ppl_disabilitas/page/filter & fasilitas/fasilitas.dart';
class BisaGo extends StatelessWidget {
......@@ -12,7 +12,7 @@ class BisaGo extends StatelessWidget {
fontFamily: 'Muli',
backgroundColor: Colors.white,
),
home: ListSekolah(),
home: Dashboard(),
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:ppl_disabilitas/config/styles.dart';
class ListSekolah extends StatefulWidget {
......@@ -8,7 +9,11 @@ class ListSekolah extends StatefulWidget {
/// State of Pencacrian page
class ListSekolahState extends State<ListSekolah> {
@override
List<String> nama_sekolah = ["Sekolah Cita Buana", "SLB Negeri Kota Depok"];
List<String> alamat_sekolah = ["Jl. Paso No.84, Jagakarsa, Kec. Ja...", "Regency, Peumahan Permata, Jl...."];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
......@@ -49,7 +54,8 @@ class ListSekolahState extends State<ListSekolah> {
),)
),
Container(
decoration: BoxDecoration(boxShadow: regularShadow),
margin: EdgeInsets.only(left: doubleSpace, right: doubleSpace),
decoration: BoxDecoration(),
child: FlatButton(
key: Key('FilterButton'),
color: Colors.green[700],
......@@ -65,17 +71,21 @@ class ListSekolahState extends State<ListSekolah> {
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(Icons.filter_list,
color: Colors.white, size: 20),
Text(
"Filter Informasi",
"Filter Pencarian",
style: TextStyle(fontSize: 13),
),
],
),
),
),
Container(
child: makeLokasiWidget("sekolah", nama_sekolah, alamat_sekolah),
),
],
),
);
......@@ -84,4 +94,70 @@ class ListSekolahState extends State<ListSekolah> {
InsideFilter() {
}
Widget makeLokasiWidget(String key, List<String> nama_sekolah, List<String> alamat_sekolah) {
return ListView.builder(
shrinkWrap: true,
itemCount: nama_sekolah.length,
itemBuilder: (context, index) {
return InkWell(
key: Key("$key-${nama_sekolah[index]}"),
onTap: () {
},
child: Container(
decoration: BoxDecoration(
color: Colors.transparent,
border: Border(bottom: BorderSide(color: Colors.grey[400]))),
margin: EdgeInsets.only(left: doubleSpace, right: doubleSpace),
height: 90,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
children: <Widget>[
CircleAvatar(
backgroundColor: greenPrimary,
child: Text('Test'),
),
Container(
padding: EdgeInsets.all(doubleSpace),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
nama_sekolah[index],
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w800,
color: Colors.black,
fontFamily: 'Muli',
),
),
Text(
alamat_sekolah[index],
style: TextStyle(
fontSize: 15,
color: Colors.black,
fontFamily: 'Muli',
),
),
],
),
),
],
),
Icon(
Icons.arrow_forward_ios,
color: Colors.grey[400],
size: 20,
)
],
),
),
);
});
}
}
\ No newline at end of file
......@@ -8,5 +8,6 @@ void main(){
await tester.pumpWidget(MaterialApp(home: ListSekolah()));
expect(find.byKey(textAppBar), findsOneWidget);
expect(find.text("Sekolah dengan Dukungan Disabilitas"), findsOneWidget);
});
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment