Fakultas Ilmu Komputer UI

Commit 468cc35b authored by Fakhira Devina's avatar Fakhira Devina
Browse files

Merge branch 'PBI-2-pencarian_lokasi' of...

Merge branch 'PBI-2-pencarian_lokasi' of https://gitlab.cs.ui.ac.id/ppl-fasilkom-ui/2020/ppl-c/dtb-beasiswa-miskin-dan-disabilitas/pplapangan-tembak-dtb-layanan-siswa-disabilitas into staging
parents b6a27c08 574b9ae8
Pipeline #33394 failed with stages
in 3 minutes and 47 seconds
import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/page/dashboard/dashboard.dart';
class BisaGo extends StatelessWidget {
@override
Widget build(BuildContext context) {
......@@ -12,4 +13,4 @@ class BisaGo extends StatelessWidget {
home: Dashboard(),
);
}
}
\ No newline at end of file
}
......@@ -14,13 +14,15 @@ class BisaGoAppBar extends StatelessWidget implements PreferredSizeWidget {
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
Padding(padding: EdgeInsets.all(doubleSpace),
child: Text(
"bisaGo",
style: TextStyle(
fontSize: 25,
fontFamily: 'Comfortaa',
fontWeight: FontWeight.w800),
),
),)
],
),
);
......
......@@ -110,12 +110,16 @@ class DashboardState extends State<Dashboard> {
size: 25,
),
onPressed: () {})),
onTap: () => _navigateToPencarianPage(context),
),
),
),
]),
appBar: BisaGoAppBar(),
key: Key("Scaffold Text Field"),
appBar: PreferredSize(
preferredSize: Size.fromHeight(55),
child: BisaGoAppBar(),
key: Key("Scaffold Text Field"),
),
);
}
......
......@@ -14,24 +14,156 @@ class PencarianState extends State<Pencarian> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.green,
leading: IconButton(icon: Icon(Icons.arrow_left), onPressed: () {}),
title: TextFormField(
backgroundColor: greenPrimary,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, size: 25),
key: Key("Back Icon Key"),
onPressed: () => Navigator.pop(context, 'Take me back')),
title: Container(
margin: EdgeInsets.only(top: doubleSpace, bottom: doubleSpace),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: doubleBorderRadius,
boxShadow: regularShadow),
child: TextFormField(
key: Key("Text Field Mau Kemana"),
decoration: InputDecoration(
prefixIcon: Icon(Icons.search),
border: OutlineInputBorder(
borderRadius: regularBorderRadius,
borderSide:
BorderSide(color: Colors.transparent, width: 0)),
contentPadding: EdgeInsets.all(0),
isDense: false,
prefixIcon: Icon(
Icons.search,
color: greenPrimary,
size: 25,
),
border: InputBorder.none,
fillColor: Colors.white,
labelText: 'Kamu mau kemana?',
labelStyle: TextStyle(
color: greenPrimary,
fontSize: 18,
fontFamily: 'Muli',
fontWeight: FontWeight.w700),
suffixIcon: IconButton(
icon: Icon(Icons.mic),
onPressed: () {}
)),
icon: Icon(
Icons.mic,
color: greenPrimary,
size: 25,
),
onPressed: () {})),
),
),
),
body: ListView(
padding: const EdgeInsets.all(8),
children: <Widget>[
Padding(
padding: EdgeInsets.only(left: doubleSpace, top: 10),
child: Text(
'Hasil Pencarian',
style: TextStyle(
fontSize: 15,
color: Colors.black,
fontFamily: 'Muli',
),
),
),
Container(
height: 90,
color: Colors.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CircleAvatar(
backgroundColor: greenPrimary,
child: Text('Test'),
),
Padding(
padding: EdgeInsets.all(doubleSpace),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Margo City',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w800,
color: Colors.black,
fontFamily: 'Muli',
),
),
Text(
'Jl. Margonda Raya No.358, Kemir...',
style: TextStyle(
fontSize: 15,
color: Colors.black,
fontFamily: 'Muli',
),
),
],
),
),
Icon(
Icons.arrow_forward_ios,
color: Colors.grey[400],
size: 20,
)
],
),
),
Container(
decoration: BoxDecoration(
border: Border(top: BorderSide(color: Colors.grey[400]))),
),
Container(
height: 90,
color: Colors.transparent,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CircleAvatar(
backgroundColor: greenPrimary,
child: Text('Test'),
),
Padding(
padding: EdgeInsets.all(doubleSpace),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Margo City',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w800,
color: Colors.black,
fontFamily: 'Muli',
),
),
Text(
'Jl. Margonda Raya No.358, Kemir...',
style: TextStyle(
fontSize: 15,
color: Colors.black,
fontFamily: 'Muli',
),
),
],
),
),
Icon(
Icons.arrow_forward_ios,
color: Colors.grey[400],
size: 20,
)
],
),
),
Container(
decoration: BoxDecoration(
border: Border(top: BorderSide(color: Colors.grey[400]))),
),
],
),
);
}
......
......@@ -8,12 +8,18 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:ppl_disabilitas/page/dashboard/dashboard.dart';
import 'package:ppl_disabilitas/page/pencarian/pencarian.dart';
void main() {
testWidgets('display list view in pencarian', (WidgetTester tester) async {
// Provide the childWidget to the Container.
await tester.pumpWidget(MaterialApp(home: Pencarian()));
// Search for the childWidget in the tree and verify it exists.
expect(find.byType(ListView), findsOneWidget);
expect(find.byType(Container), findsNWidgets(7));
expect(find.byType(Icon), findsNWidgets(5));
});
testWidgets('finds a text field in pencarian', (WidgetTester tester) async {
final textFieldKey = Key("Text Field Mau Kemana");
......@@ -21,14 +27,4 @@ void main() {
expect(find.byKey(textFieldKey), findsOneWidget);
});
testWidgets('display list view in textfield', (WidgetTester tester) async {
// Provide the childWidget to the Container.
await tester.pumpWidget(MaterialApp(home: Dashboard()));
// Search for the childWidget in the tree and verify it exists.
expect(find.byType(Stack), findsNWidgets(3));
expect(find.byType(TextFormField), findsOneWidget);
expect(find.byType(Icon), findsNWidgets(3));
});
}
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