Skip to content

Commit

Permalink
Merge pull request #8 from bagussubagja/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
bagussubagja authored Dec 21, 2022
2 parents a9ddb2b + f5b230d commit 270d0e7
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 116 deletions.
6 changes: 1 addition & 5 deletions lib/screens/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ class _HomePageState extends State<HomePage> {
actions: <Widget>[
TextButton(
onPressed: () => SystemNavigator.pop(),
child: const Text('Ya'),
),
TextButton(
onPressed: () => Navigator.of(context).pop(true),
child: const Text('Tidak'),
child: const Text('Keluar dari Aplikasi'),
),
],
),
Expand Down
4 changes: 1 addition & 3 deletions lib/screens/home/settings/setting_screen.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import 'package:flutter/material.dart';
import 'package:healthy_buddy_mobile_app/routes/routes.dart';
import 'package:healthy_buddy_mobile_app/screens/widgets/margin_height.dart';
Expand All @@ -14,7 +13,6 @@ class SettingScreen extends StatefulWidget {
}

class _SettingScreenState extends State<SettingScreen> {

final List<IconData> _iconSettingMenu = [
Icons.person_outline_outlined,
Icons.supervised_user_circle_outlined,
Expand Down Expand Up @@ -71,7 +69,7 @@ class _SettingScreenState extends State<SettingScreen> {
primary: false,
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
return GestureDetector(
return InkWell(
onTap: () {
if (index == 0) {
Navigator.pushNamed(context, AppRoutes.accountSettingScreen);
Expand Down
24 changes: 17 additions & 7 deletions lib/screens/home/top_article/toparticle_result.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,23 @@ class SearchTopArticleResult extends SearchDelegate {
List<Widget>? buildActions(BuildContext context) {
return [
IconButton(
onPressed: () {
query = "";
},
icon: Icon(
Icons.close,
color: blackColor,
))
onPressed: () {
query = "";
},
icon: Icon(
Icons.close,
color: blackColor,
),
),
IconButton(
onPressed: () {
showResults(context);
},
icon: Icon(
Icons.search,
color: blackColor,
),
),
];
}

Expand Down
188 changes: 100 additions & 88 deletions lib/screens/main_features_screens/foodies/foodies_main_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,75 +127,85 @@ class _FoodiesScreenState extends State<FoodiesScreen> {
return CarouselSlider.builder(
itemCount: 3,
itemBuilder: (context, index, realIndex) {
return ClipRRect(
return InkWell(
borderRadius: BorderRadius.circular(12),
child: Container(
color: greyColor,
child: Stack(
fit: StackFit.expand,
children: [
ClipRRect(
child: CachedNetworkImage(
imageUrl: item?.thumbnail[index] ?? _placeHolder,
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
onTap: () async {
final url =
Uri.parse(itemCarousel.carousel![0].link[index].toString());
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
},
child: ClipRRect(
borderRadius: BorderRadius.circular(12),
child: Container(
color: greyColor,
child: Stack(
fit: StackFit.expand,
children: [
ClipRRect(
child: CachedNetworkImage(
imageUrl: item?.thumbnail[index] ?? _placeHolder,
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
),
),
),
),
placeholder: (context, url) => const Center(
child: CircularProgressIndicator(),
),
errorWidget: (context, url, error) => const Center(
child: Icon(Icons.error),
placeholder: (context, url) => const Center(
child: CircularProgressIndicator(),
),
errorWidget: (context, url, error) => const Center(
child: Icon(Icons.error),
),
),
),
),
Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Colors.black,
greyColor.withOpacity(0.1),
],
)),
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${item?.title[index].substring(0, 45)}..",
style: regularStyle.copyWith(color: whiteColor),
),
GestureDetector(
onTap: () async {
final url = Uri.parse(itemCarousel
.carousel![0].link[index]
.toString());
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
},
child: Text(
"Baca Selengkapnya",
style: regularStyle.copyWith(
color: greyTextColor, fontSize: 13),
),
),
Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
Colors.black,
greyColor.withOpacity(0.1),
],
)),
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${item?.title[index].substring(0, 45)}..",
style: regularStyle.copyWith(color: whiteColor),
),
InkWell(
onTap: () async {
final url = Uri.parse(itemCarousel
.carousel![0].link[index]
.toString());
if (await canLaunchUrl(url)) {
await launchUrl(url);
}
},
child: Text(
"Baca Selengkapnya",
style: regularStyle.copyWith(
color: greyTextColor, fontSize: 13),
),
),
],
),
),
),
),
],
],
),
),
),
);
Expand All @@ -222,26 +232,28 @@ class _FoodiesScreenState extends State<FoodiesScreen> {
shrinkWrap: true,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
GestureDetector(
onTap: () async {
if (index == 0) {
Navigator.pushNamed(context, AppRoutes.foodArticleMenu);
} else if (index == 1) {
Navigator.pushNamed(
context, AppRoutes.foodCalculatorScreen);
} else if (index == 2) {
Navigator.pushNamed(context, AppRoutes.foodReceiptMenu);
} else if (index == 3) {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return const FoodStoreMainScreen();
},));
}
},
child: Container(
return InkWell(
borderRadius: BorderRadius.circular(12),
onTap: () {
if (index == 0) {
Navigator.pushNamed(context, AppRoutes.foodArticleMenu);
} else if (index == 1) {
Navigator.pushNamed(context, AppRoutes.foodCalculatorScreen);
} else if (index == 2) {
Navigator.pushNamed(context, AppRoutes.foodReceiptMenu);
} else if (index == 3) {
Navigator.push(context, MaterialPageRoute(
builder: (context) {
return const FoodStoreMainScreen();
},
));
}
},
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 7.h,
decoration: BoxDecoration(
color: greenColor.withOpacity(0.5),
Expand All @@ -252,13 +264,13 @@ class _FoodiesScreenState extends State<FoodiesScreen> {
scale: 1.5.h,
),
),
),
Text(
_iconLabel[index].replaceAll(" ", "\n"),
style: regularStyle,
textAlign: TextAlign.center,
),
],
Text(
_iconLabel[index].replaceAll(" ", "\n"),
style: regularStyle,
textAlign: TextAlign.center,
),
],
),
);
},
),
Expand Down
16 changes: 12 additions & 4 deletions lib/screens/main_features_screens/mydoc/mydoc_main_screen.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:healthy_buddy_mobile_app/core/mydoc/mydoc_notifier.dart';
import 'package:healthy_buddy_mobile_app/screens/main_features_screens/mydoc/category_screen/mydoc_category_screen.dart';
import 'package:healthy_buddy_mobile_app/screens/main_features_screens/mydoc/mydoc_search_result_screen.dart';
import 'package:healthy_buddy_mobile_app/screens/widgets/custom_textfield.dart';
import 'package:healthy_buddy_mobile_app/screens/widgets/margin_height.dart';
Expand Down Expand Up @@ -58,7 +59,7 @@ class _MyDocMainScreenState extends State<MyDocMainScreen> {
@override
Widget build(BuildContext context) {
final topDoctor = Provider.of<MyDocByExperienceClass>(context);

return GestureDetector(
onTap: () {
FocusScopeNode currentFocus = FocusScope.of(context);
Expand Down Expand Up @@ -187,10 +188,17 @@ class _MyDocMainScreenState extends State<MyDocMainScreen> {
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
GestureDetector(
InkWell(
onTap: () {
Navigator.pushNamed(context, AppRoutes.myDocCategoryScreen,
arguments: index);
// Navigator.pushNamed(context, AppRoutes.myDocCategoryScreen,
// arguments: index);
Navigator.push(context, MaterialPageRoute(
builder: (context) {
return MyDocCategoryScreen(
index: index,
);
},
));
},
child: Container(
height: 7.h,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,23 @@ class MyDocSearchResultScreen extends SearchDelegate {
List<Widget>? buildActions(BuildContext context) {
return [
IconButton(
onPressed: () {
query = "";
},
icon: Icon(
Icons.close,
color: blackColor,
))
onPressed: () {
query = "";
},
icon: Icon(
Icons.close,
color: blackColor,
),
),
IconButton(
onPressed: () {
showResults(context);
},
icon: Icon(
Icons.search,
color: blackColor,
),
),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,13 @@ class _SportScreenState extends State<SportScreen> {
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
GestureDetector(
InkWell(
onTap: () {
if (index == 0) {
Navigator.pushNamed(context, AppRoutes.sportArticle);
} else if (index == 1) {
Navigator.pushNamed(context, AppRoutes.sportWebsite);
} else if (index == 2) {
// Navigator.pushNamed(context, AppRoutes.sportStore);
Navigator.push(context, MaterialPageRoute(
builder: (context) {
return SportStoreMainScreen();
Expand Down

0 comments on commit 270d0e7

Please sign in to comment.