Fakultas Ilmu Komputer UI

Commit a593561c authored by Agnes Handoko's avatar Agnes Handoko
Browse files
parents 23def66f 7478da25
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/config/styles.dart';
class InformasiSekolahAppBar extends StatelessWidget implements PreferredSizeWidget {
@override
final Size preferredSize = Size.fromHeight(55);
@override
Widget build(BuildContext context) {
return AppBar(
elevation: 15,
centerTitle: true,
backgroundColor: greenPrimary,
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),
),)
],
),
);
}
}
import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/component/bisago_drawer.dart';
import 'package:ppl_disabilitas/component/informasi_sekolah_appbar.dart';
import 'package:ppl_disabilitas/config/styles.dart';
class DetailSekolah extends StatefulWidget {
final String namaSekolah;
final String alamat;
final String nomerTelpon;
final String website;
final String jumlahSiswa;
final String status;
final String jenisSekolah;
final String akreditasi;
DetailSekolah(this.namaSekolah, this.alamat, this.nomerTelpon,
this.website, this.jumlahSiswa, this.status, this.jenisSekolah, this.akreditasi);
@override
DetailSekolahState createState() => DetailSekolahState();
}
class DetailSekolahState extends State<DetailSekolah> {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: BisaGoDrawer(),
appBar: PreferredSize(
preferredSize: Size.fromHeight(55),
child: InformasiSekolahAppBar(),
),
body: ListView(
children: <Widget>[
Container(
padding: EdgeInsets.all(doubleSpace),
margin: EdgeInsets.only(
top: regularSpace, bottom: regularSpace, left: regularSpace),
child: Text(widget.namaSekolah,
style: TextStyle(
fontSize: 30,
color: Colors.black,
fontFamily: 'Muli',
fontWeight: FontWeight.w400,
)),
),
Container(
padding: EdgeInsets.all(doubleSpace),
margin:
EdgeInsets.only(bottom: regularSpace, left: regularSpace),
decoration: BoxDecoration(
border: Border.all(
width: 2, color: greenPrimary.withOpacity(0.3)),
borderRadius: regularBorderRadius,
color: Colors.white,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(
bottom: regularSpace),
child: Text(
"Alamat",
style: TextStyle(
fontSize: 25,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
),
),
Container(
margin: EdgeInsets.only(bottom: doubleSpace),
child: Text(
widget.alamat,
style: TextStyle(
fontSize: 20,
color: Colors.black,
fontFamily: 'Muli'),
),
),
Divider(
color: greenPrimary,
thickness: 1,
),
Container(
margin: EdgeInsets.only(
bottom: regularSpace, top: regularSpace),
child: Text(
"Nomor Telepon",
style: TextStyle(
fontSize: 25,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
),
),
Container(
margin: EdgeInsets.only(bottom: doubleSpace),
child: Text(
widget.nomerTelpon,
style: TextStyle(
fontSize: 20,
color: Colors.black,
fontFamily: 'Muli'),
),
),
Divider(
color: greenPrimary,
thickness: 1,
),
Container(
margin: EdgeInsets.only(
bottom: regularSpace, top: regularSpace),
child: Text(
"Website",
style: TextStyle(
fontSize: 25,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
),
),
Container(
margin: EdgeInsets.only(bottom: doubleSpace),
child: Text(
widget.website,
style: TextStyle(
fontSize: 20,
color: Colors.black,
fontFamily: 'Muli'),
),
),
Divider(
color: greenPrimary,
thickness: 1,
),
Container(
margin: EdgeInsets.only(
bottom: regularSpace, top: regularSpace),
child: Text(
"Jumlah Siswa",
style: TextStyle(
fontSize: 25,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
),
),
Container(
margin: EdgeInsets.only(bottom: doubleSpace),
child: Text(
widget.jumlahSiswa,
style: TextStyle(
fontSize: 20,
color: Colors.black,
fontFamily: 'Muli'),
),
),
Divider(
color: greenPrimary,
thickness: 1,
),
Container(
margin: EdgeInsets.only(
bottom: regularSpace, top: regularSpace),
child: Text(
"Status",
style: TextStyle(
fontSize: 25,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
),
),
Container(
margin: EdgeInsets.only(bottom: doubleSpace),
child: Text(
widget.status,
style: TextStyle(
fontSize: 20,
color: Colors.black,
fontFamily: 'Muli'),
),
),
Divider(
color: greenPrimary,
thickness: 1,
),
Container(
margin: EdgeInsets.only(
bottom: regularSpace, top: regularSpace),
child: Text(
"Jenis Sekolah",
style: TextStyle(
fontSize: 25,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
),
),
Container(
margin: EdgeInsets.only(bottom: doubleSpace),
child: Text(
widget.jenisSekolah,
style: TextStyle(
fontSize: 20,
color: Colors.black,
fontFamily: 'Muli'),
),
),
Divider(
color: greenPrimary,
thickness: 1,
),
Container(
margin: EdgeInsets.only(
bottom: regularSpace, top: regularSpace),
child: Text(
"Akreditasi",
style: TextStyle(
fontSize: 25,
color: greenPrimary,
fontFamily: 'Muli',
fontWeight: FontWeight.bold),
),
),
Container(
margin: EdgeInsets.only(bottom: smallSpace),
child: Text(
widget.akreditasi,
style: TextStyle(
fontSize: 20,
color: Colors.black,
fontFamily: 'Muli'),
),
),
],
),
)
],
)
);
}
}
\ No newline at end of file
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:ppl_disabilitas/page/informasi/detailSekolah.dart';
void main() {
Widget buildTestableWidget(Widget widget) {
// https://docs.flutter.io/flutter/widgets/MediaQuery-class.html
return MediaQuery(data: MediaQueryData(), child: MaterialApp(home: widget));
}
testWidgets('find fasilitas page', (WidgetTester tester) async {
// Provide the childWidget to the Container.
await tester.pumpWidget(buildTestableWidget(DetailSekolah(
"Sekolah Pilar Indonesia",
"Ciangsana",
"02149305494",
"www.pilarindonesia.com",
"1000",
"Swasta",
"Inklusi",
"A")));
// Search for the childWidget in the tree and verify it exists.
expect(find.byType(Scaffold), findsOneWidget);
expect(find.byType(ListView), findsOneWidget);
expect(find.byType(Container), findsNWidgets(23));
expect(find.byType(Column), findsNWidgets(1));
expect(find.byType(Text), findsNWidgets(16));
});
}
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