Fakultas Ilmu Komputer UI

Commit 3aeeb442 authored by Agnes Handoko's avatar Agnes Handoko
Browse files

Merge branch 'dev-agnes' into 'PBI-7-informasi_layanan_khusus_disabilitas'

Menyelesaikan PBI 7 (Informasi sekolah dengan dukungan disabilitas)

See merge request !44
parents e5892cd8 f958216d
Pipeline #41185 passed with stages
in 8 minutes and 24 seconds
......@@ -10,6 +10,10 @@ class InformasiSekolahAppBar extends StatelessWidget implements PreferredSizeWid
elevation: 15,
centerTitle: true,
backgroundColor: greenPrimary,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, size: 20),
key: Key('Back Icon Key'),
onPressed: () => Navigator.pop(context, 'Take me back')),
title: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
......
import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/app.dart';
//import 'package:ppl_disabilitas/page/informasi/layananDisabilitas.dart';
import 'flavor/flavor.dart';
void main() {
......
......@@ -33,24 +33,23 @@ class DetailSekolahState extends State<DetailSekolah> {
body: ListView(
children: <Widget>[
Container(
padding: EdgeInsets.all(doubleSpace),
margin: EdgeInsets.only(
top: regularSpace, bottom: regularSpace, left: regularSpace),
padding: EdgeInsets.only(top: tripleSpace, bottom: tripleSpace,right: doubleSpace, left: doubleSpace),
child: Text(widget.namaSekolah,
style: TextStyle(
fontSize: 30,
fontSize: 25,
fontWeight: FontWeight.w800,
color: Colors.black,
fontFamily: 'Muli',
fontWeight: FontWeight.w400,
)),
),
Container(
padding: EdgeInsets.all(doubleSpace),
margin:
EdgeInsets.only(bottom: regularSpace, left: regularSpace),
EdgeInsets.only(bottom: doubleSpace, left: doubleSpace, right: doubleSpace),
decoration: BoxDecoration(
border: Border.all(
width: 2, color: greenPrimary.withOpacity(0.3)),
width: 2, color: greenPrimary.withOpacity(0.4)),
borderRadius: regularBorderRadius,
color: Colors.white,
),
......@@ -63,10 +62,10 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
"Alamat",
style: TextStyle(
fontSize: 25,
fontSize: 22,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
fontWeight: FontWeight.w800),
),
),
Container(
......@@ -74,14 +73,14 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
widget.alamat,
style: TextStyle(
fontSize: 20,
fontSize: 18,
color: Colors.black,
fontFamily: 'Muli'),
),
),
Divider(
color: greenPrimary,
thickness: 1,
color: greenPrimary.withOpacity(0.4),
thickness: 2,
),
Container(
margin: EdgeInsets.only(
......@@ -89,10 +88,10 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
"Nomor Telepon",
style: TextStyle(
fontSize: 25,
fontSize: 22,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
fontWeight: FontWeight.w800),
),
),
Container(
......@@ -100,14 +99,14 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
widget.nomerTelpon,
style: TextStyle(
fontSize: 20,
fontSize: 18,
color: Colors.black,
fontFamily: 'Muli'),
),
),
Divider(
color: greenPrimary,
thickness: 1,
color: greenPrimary.withOpacity(0.4),
thickness: 2,
),
Container(
margin: EdgeInsets.only(
......@@ -115,10 +114,10 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
"Website",
style: TextStyle(
fontSize: 25,
fontSize: 22,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
fontWeight: FontWeight.w800),
),
),
Container(
......@@ -126,14 +125,14 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
widget.website,
style: TextStyle(
fontSize: 20,
fontSize: 18,
color: Colors.black,
fontFamily: 'Muli'),
),
),
Divider(
color: greenPrimary,
thickness: 1,
color: greenPrimary.withOpacity(0.4),
thickness: 2,
),
Container(
margin: EdgeInsets.only(
......@@ -141,10 +140,10 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
"Jumlah Siswa",
style: TextStyle(
fontSize: 25,
fontSize: 22,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
fontWeight: FontWeight.w800),
),
),
Container(
......@@ -152,14 +151,14 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
widget.jumlahSiswa,
style: TextStyle(
fontSize: 20,
fontSize: 18,
color: Colors.black,
fontFamily: 'Muli'),
),
),
Divider(
color: greenPrimary,
thickness: 1,
color: greenPrimary.withOpacity(0.4),
thickness: 2,
),
Container(
margin: EdgeInsets.only(
......@@ -167,10 +166,10 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
"Status",
style: TextStyle(
fontSize: 25,
fontSize: 22,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
fontWeight: FontWeight.w800),
),
),
Container(
......@@ -178,14 +177,14 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
widget.status,
style: TextStyle(
fontSize: 20,
fontSize: 18,
color: Colors.black,
fontFamily: 'Muli'),
),
),
Divider(
color: greenPrimary,
thickness: 1,
color: greenPrimary.withOpacity(0.4),
thickness: 2,
),
Container(
......@@ -194,10 +193,10 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
"Jenis Sekolah",
style: TextStyle(
fontSize: 25,
fontSize: 22,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
fontWeight: FontWeight.w800),
),
),
Container(
......@@ -205,14 +204,14 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
widget.jenisSekolah,
style: TextStyle(
fontSize: 20,
fontSize: 18,
color: Colors.black,
fontFamily: 'Muli'),
),
),
Divider(
color: greenPrimary,
thickness: 1,
color: greenPrimary.withOpacity(0.4),
thickness: 2,
),
Container(
margin: EdgeInsets.only(
......@@ -220,10 +219,10 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
"Akreditasi",
style: TextStyle(
fontSize: 25,
fontSize: 22,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
fontWeight: FontWeight.w800),
),
),
Container(
......@@ -231,7 +230,7 @@ class DetailSekolahState extends State<DetailSekolah> {
child: Text(
widget.akreditasi,
style: TextStyle(
fontSize: 20,
fontSize: 18,
color: Colors.black,
fontFamily: 'Muli'),
),
......
......@@ -3,6 +3,7 @@ import 'package:ppl_disabilitas/component/bisago_appbar.dart';
import 'package:ppl_disabilitas/component/bisago_drawer.dart';
import 'package:ppl_disabilitas/config/styles.dart';
import 'package:ppl_disabilitas/page/informasi/list_sekolah.dart';
import 'package:ppl_disabilitas/page/informasi/detailSekolah.dart';
class LayananDisabilitas extends StatefulWidget {
@override
......@@ -54,7 +55,7 @@ class _LayananDisabilitasState extends State<LayananDisabilitas> {
width: 2, color: greenPrimary.withOpacity(0.4))),
//splashColor: Colors.lightGreen,
onPressed: () {
/*...*/
_navigateToDetailSekolahPage(context);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
......@@ -121,4 +122,17 @@ class _LayananDisabilitasState extends State<LayananDisabilitas> {
final route = MaterialPageRoute(builder: (_) => ListSekolah());
Navigator.of(context).push(route);
}
void _navigateToDetailSekolahPage(BuildContext context) {
final route = MaterialPageRoute(builder: (_) => DetailSekolah(
"Sekolah Pilar Indonesia",
"Jl. Paso No.84, Jagakarsa, Kec. Jagakarsa, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12620",
"02149305494",
"www.pilarindonesia.com",
"1000",
"Swasta",
"Inklusi",
"A"));
Navigator.of(context).push(route);
}
}
import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/component/bisago_appbar.dart';
import 'package:ppl_disabilitas/component/bisago_drawer.dart';
import 'package:flutter/widgets.dart';
import 'package:ppl_disabilitas/config/styles.dart';
import 'package:ppl_disabilitas/page/informasi/detailSekolah.dart';
class ListSekolah extends StatefulWidget {
@override
......@@ -18,57 +19,180 @@ class _ListSekolahState extends State<ListSekolah> {
var showKategoriSekolah = false;
var showTingkatSekolah = false;
List<String> nama_sekolah = ["Sekolah Cita Buana", "SLB Negeri Kota Depok"];
List<String> alamat_sekolah = [
"Jl. Paso No.84, Jagakarsa",
"Regency, Perumahan Permata"
];
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
drawer: BisaGoDrawer(),
body: SingleChildScrollView(
child: Column(children: <Widget>[
Container(
child: Row(
children: <Widget>[
Container(
decoration: BoxDecoration(boxShadow: regularShadow),
child: FlatButton(
key: Key('FilterButton'),
color: Colors.green[700],
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors.black,
padding: EdgeInsets.all(8),
shape: RoundedRectangleBorder(
borderRadius: regularBorderRadius,
side: BorderSide(color: Colors.transparent)),
splashColor: Colors.lightGreen,
onPressed: () => showModalBottomSheet(
context: context,
builder: (context) => InsideFilter(),
backgroundColor: Colors.transparent,
isScrollControlled: true),
child: Row(
children: <Widget>[
Icon(Icons.filter_list, color: Colors.white, size: 20),
Text(
"Filter Informasi",
style: TextStyle(fontSize: 13),
),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: Padding(
padding: EdgeInsets.only(top: tripleSpace, left: doubleSpace, right: doubleSpace),
child: Text(
"Sekolah dengan Dukungan Disabilitas",
style: TextStyle(
fontSize: 25,
fontFamily: 'Muli',
fontWeight: FontWeight.w800),
),
),
],
),
),
Container(
padding: EdgeInsets.only(bottom: smallSpace),
margin: EdgeInsets.only(left: doubleSpace, right: doubleSpace),
decoration: BoxDecoration(boxShadow: regularShadow),
child: FlatButton(
key: Key('FilterButton'),
color: Colors.green[700],
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors.black,
padding: EdgeInsets.all(8),
shape: RoundedRectangleBorder(
borderRadius: regularBorderRadius,
side: BorderSide(color: Colors.transparent)),
splashColor: Colors.lightGreen,
onPressed: () => {showModalBottomSheet(
context: context,
builder: (context) => InsideFilter(),
backgroundColor: Colors.transparent,
isScrollControlled: true),
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Icon(Icons.filter_list, color: Colors.white, size: 20),
Text(
"Filter Pencarian",
style: TextStyle(fontSize: 13),
),
],
),
),
),
Container(
child: makeLokasiWidget("sekolah", nama_sekolah, alamat_sekolah),
),
],
),
),
appBar: AppBar(
elevation: 15,
key: Key("appbar-text-informasi-sekolah"),
backgroundColor: greenPrimary,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, size: 20),
key: Key('Back Icon Key'),
onPressed: () => Navigator.pop(context, 'Take me back')),
centerTitle: true,
title: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: EdgeInsets.all(doubleSpace),
child: Text(
"Informasi Sekolah",
style: TextStyle(
fontSize: 25,
fontFamily: 'Comfortaa',
fontWeight: FontWeight.w800),
),
)
],
),
])),
appBar: PreferredSize(
preferredSize: Size.fromHeight(55),
child: BisaGoAppBar(),
key: Key('Scaffold Text Field'),
),
);
}
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>[
FlatButton(
onPressed: () {
_navigateToDetailSekolahPage(context);
},
child: Row(
children: <Widget>[
CircleAvatar(
backgroundColor: greenPrimary,
child: Text('Test'),
),
Container(
padding: EdgeInsets.all(doubleSpace),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Flexible(
child: Text(
nama_sekolah[index],
softWrap: true,
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w800,
color: Colors.black,
fontFamily: 'Muli',
),
),
),
Flexible(
child: Text(
alamat_sekolah[index],
softWrap: true,
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 15,
color: Colors.black,
fontFamily: 'Muli',
),
),
),
],
),
),
],
),
),
Icon(
Icons.arrow_forward_ios,
color: Colors.grey[400],
size: 20,
)
],
),
),
);
});
}
InsideFilter() {
return StatefulBuilder(
builder: (context, setStateModal) => Container(
......@@ -719,4 +843,17 @@ class _ListSekolahState extends State<ListSekolah> {
),
);
}
void _navigateToDetailSekolahPage(BuildContext context) {
final route = MaterialPageRoute(builder: (_) => DetailSekolah(
"Sekolah Pilar Indonesia",
"Jl. Paso No.84, Jagakarsa, Kec. Jagakarsa, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12620",
"02149305494",
"www.pilarindonesia.com",
"1000",
"Swasta",
"Inklusi",
"A"));
Navigator.of(context).push(route);
}
}
......@@ -21,7 +21,7 @@ void main() {
// Provide the childWidget to the Container.
await tester.pumpWidget(buildTestableWidget(DetailSekolah(
"Sekolah Pilar Indonesia",
"Ciangsana",
"Jl. Paso No.84, Jagakarsa, Kec. Jagakarsa, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12620",
"02149305494",
"www.pilarindonesia.com",
"1000",
......
......@@ -15,22 +15,30 @@ void main() {
return MediaQuery(data: MediaQueryData(), child: MaterialApp(home: widget));
}
testWidgets("find a title app bar", (WidgetTester tester) async {
final textAppBar = Key("appbar-text-informasi-sekolah");
await tester.pumpWidget(MaterialApp(home: ListSekolah()));
expect(find.byKey(textAppBar), findsOneWidget);
expect(find.text("Sekolah dengan Dukungan Disabilitas"), findsOneWidget);
});
testWidgets('find inside filter page', (WidgetTester tester) async {
// Provide the childWidget to the Container.
await tester.pumpWidget(buildTestableWidget(ListSekolah()));
await tester.tap(find.byKey(Key('FilterButton')));
await tester.pump(Duration(seconds: 1));
expect(find.byType(Container), findsNWidgets(25));
expect(find.byType(Row), findsNWidgets(18));
expect(find.byType(Column), findsNWidgets(3));
expect(find.byType(Text), findsNWidgets(20));
expect(find.byType(Container), findsNWidgets(34));
expect(find.byType(Row), findsNWidgets(21));
expect(find.byType(Column), findsNWidgets(5));
expect(find.byType(Text), findsNWidgets(27));
expect(find.byType(Flex), findsNothing);
expect(find.text('jns fasilitas'), findsNothing);
expect(find.text('urutn'), findsNothing);
expect(find.text('hps smw'), findsNothing);
expect(find.byType(Scaffold), findsOneWidget);
expect(find.byType(Icon), findsNWidgets(3));
await tester.tap(find.byKey(Key('Scaffold Text Field')));
expect(find.byType(Icon), findsNWidgets(5));
await tester.tap(find.byKey(Key('FilterButton')));
await tester.pump();
});
}
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