Fakultas Ilmu Komputer UI
Skip to content
GitLab
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
3f4ddbbd
Commit
3f4ddbbd
authored
May 31, 2021
by
Yoga Pratama
Browse files
[CHORES] Change dropdown banner to flushbar
parent
bcb60827
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/app.dart
View file @
3f4ddbbd
import
'package:dropdown_banner/dropdown_banner.dart'
;
import
'package:flutter/material.dart'
;
import
'package:bisaGo/config/styles.dart'
;
import
'package:bisaGo/page/dashboard/dashboard.dart'
;
...
...
@@ -8,8 +7,6 @@ class BisaGo extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
final
navigatorKey
=
GlobalKey
<
NavigatorState
>();
return
MaterialApp
(
title:
'bisaGo'
,
theme:
ThemeData
(
...
...
@@ -17,10 +14,7 @@ class BisaGo extends StatelessWidget {
primaryColor:
greenPrimary
,
backgroundColor:
Colors
.
white
,
),
home:
DropdownBanner
(
navigatorKey:
navigatorKey
,
child:
Dashboard
(),
),
home:
Dashboard
(),
);
}
}
lib/page/dashboard/dashboard.dart
View file @
3f4ddbbd
...
...
@@ -12,10 +12,10 @@ import 'package:bisaGo/page/filter_fasilitas/postingan/detail_post.dart';
import
'package:bisaGo/repository/komentar_repository.dart'
;
import
'package:bisaGo/utils/custom_dashboard_location_button.dart'
;
import
'package:bisaGo/utils/location_turn_on_dialog.dart'
;
import
'package:dropdown_banner/dropdown_banner.dart'
;
import
'package:firebase_core/firebase_core.dart'
;
import
'package:firebase_dynamic_links/firebase_dynamic_links.dart'
;
import
'package:firebase_messaging/firebase_messaging.dart'
;
import
'package:flushbar/flushbar.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_dotenv/flutter_dotenv.dart'
;
import
'package:geolocator/geolocator.dart'
;
...
...
@@ -79,25 +79,26 @@ class DashboardState extends State<Dashboard> {
_lastNotification
=
now
;
final
data
=
message
.
data
;
final
String
msg
=
data
[
'message'
];
DropdownBanner
.
showBanner
(
text:
msg
,
color:
Color
(
0xFF003566
),
textStyle:
TextStyle
(
color:
Colors
.
white
,
height:
2.1
,
),
duration:
Duration
(
seconds:
8
),
tapCallback:
()
{
if
(
data
[
'type'
]
==
'fasilitas'
)
{
final
String
placeId
=
data
[
'place_id'
];
final
id
=
int
.
parse
(
data
[
'id'
]);
_navigateToDetailFasilitasPage
(
context
,
placeId
,
id
);
}
else
if
(
data
[
'type'
]
==
'kegiatan'
)
{
final
String
placeId
=
data
[
'place_id'
];
final
id
=
int
.
parse
(
data
[
'id'
]);
_navigateToDetailKegiatanPage
(
context
,
placeId
,
id
);
}
});
final
String
title
=
data
[
'title'
];
Flushbar
(
title:
title
,
message:
'"
$msg
"'
,
duration:
Duration
(
seconds:
8
),
backgroundColor:
Color
(
0xFF003566
),
onTap:
(
_
)
{
if
(
data
[
'type'
]
==
'fasilitas'
)
{
final
String
placeId
=
data
[
'place_id'
];
final
id
=
int
.
parse
(
data
[
'id'
]);
_navigateToDetailFasilitasPage
(
context
,
placeId
,
id
);
}
else
if
(
data
[
'type'
]
==
'kegiatan'
)
{
final
String
placeId
=
data
[
'place_id'
];
final
id
=
int
.
parse
(
data
[
'id'
]);
_navigateToDetailKegiatanPage
(
context
,
placeId
,
id
);
}
},
flushbarStyle:
FlushbarStyle
.
GROUNDED
,
flushbarPosition:
FlushbarPosition
.
TOP
,
)
.
show
(
context
);
});
FirebaseMessaging
.
onMessageOpenedApp
.
listen
((
message
)
{
...
...
pubspec.yaml
View file @
3f4ddbbd
...
...
@@ -57,7 +57,7 @@ dependencies:
firebase_dynamic_links
:
^0.7.0+1
firebase_messaging
:
^8.0.0-dev.15
carousel_slider
:
^3.0.0
dropdown_banne
r
:
^1.
4.0
flushba
r
:
^1.
10.4
dev_dependencies
:
flutter_test
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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