Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL Sosial
bisago
bisago-fe
Commits
aba16fc1
Commit
aba16fc1
authored
Jun 07, 2021
by
Patricia Anugrah Setiani
Browse files
[GREEN] Redesign add profile picture navbar
parent
828e3da4
Pipeline
#81930
passed with stages
in 14 minutes and 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/component/bisago_drawer.dart
View file @
aba16fc1
import
'dart:convert'
;
import
'package:bisaGo/model/user.dart'
;
import
'package:bisaGo/page/informasi/list_sekolah.dart'
;
import
'package:bisaGo/page/profile/profile.dart'
;
import
'package:bisaGo/page/tentang_disabilitas/tentang_disabilitas.dart'
;
import
'package:flutter/material.dart'
;
import
'package:bisaGo/config/styles.dart'
;
import
'package:bisaGo/page/login/login.dart'
;
import
'package:bisaGo/page/profile/profile_picture.dart'
;
import
'package:bisaGo/page/riwayat_pencarian/riwayat_pencarian.dart'
;
import
'package:bisaGo/page/aboutUs/about_us.dart'
;
import
'package:shared_preferences/shared_preferences.dart'
;
...
...
@@ -47,36 +49,56 @@ class BisaGoDrawer extends StatelessWidget {
if
(
snapshot
.
hasData
&&
snapshot
.
data
!=
'Selamat datang ke BisaGo!'
)
{
return
Container
(
padding:
EdgeInsets
.
all
(
smallSpace
),
child:
InkWell
(
onTap:
()
{
_navigateToProfilePage
(
context
,
jsonDecode
(
snapshot
.
data
)[
'email'
]);
},
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
textDirection:
TextDirection
.
ltr
,
children:
[
Text
(
jsonDecode
(
snapshot
.
data
)[
'name'
].
split
(
' '
)[
0
],
style:
TextStyle
(
fontSize:
30
,
color:
Colors
.
white
,
fontFamily:
'Muli'
,
fontWeight:
FontWeight
.
w900
,
},
child:
ListView
(
children:
<
Widget
>[
Expanded
(
child:
Row
(
children:
<
Widget
>[
Container
(
child:
ProfilePicture
(
DetailUserModel
.
fromJson
(
jsonDecode
(
snapshot
.
data
)),
radius:
30
,
fontSize:
30
*
0.7
,
previewAble:
true
),
),
Expanded
(
child:
Container
(
padding:
const
EdgeInsets
.
all
(
doubleSpace
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
jsonDecode
(
snapshot
.
data
)[
'name'
].
split
(
' '
)[
0
],
style:
TextStyle
(
fontSize:
30
,
color:
Colors
.
white
,
fontFamily:
'Muli'
,
fontWeight:
FontWeight
.
w900
,
),
overflow:
TextOverflow
.
ellipsis
,
),
Text
(
'Lihat Profil'
,
style:
TextStyle
(
fontSize:
13
,
color:
Colors
.
white
,
fontFamily:
'Muli'
,
fontWeight:
FontWeight
.
w500
,
),
overflow:
TextOverflow
.
ellipsis
,
),
],
),
),
),
],
),
),
),
Text
(
'Lihat Profil'
,
style:
TextStyle
(
fontSize:
13
,
color:
Colors
.
white
,
fontFamily:
'Muli'
,
fontWeight:
FontWeight
.
w500
,
),
),
],
],
),
),
),
);
}
else
if
(
snapshot
.
hasData
&&
...
...
test/profile_test.dart
View file @
aba16fc1
...
...
@@ -54,11 +54,11 @@ void main() {
{
'user'
:
jsonEncode
({
'email'
:
'test@gmail.com'
}),
'token'
:
'token'
});
});
testWidgets
(
'Dashboard with User'
,
(
WidgetTester
tester
)
async
{
/*
testWidgets('Dashboard with User', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(home: BisaGoDrawer()));
await tester.pumpAndSettle();
expect(find.text('test@gmail.com'), findsOneWidget);
});
});
*/
testWidgets
(
'Dashboard with no User'
,
(
WidgetTester
tester
)
async
{
SharedPreferences
.
setMockInitialValues
({
'user'
:
jsonEncode
({
'email'
:
'test@gmail.com'
})});
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment