Skip to content

Commit ba47934

Browse files
committed
feat: create ui for survey detail (#27)
1 parent 6a34228 commit ba47934

10 files changed

+138
-9
lines changed

assets/l10n/app_en.arb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
"forgotPasswordScreenResetSuccessfullyNotificationTitle": "Check your email.",
1313
"forgotPasswordScreenResetSuccessfullyNotificationMessage": "We’ve email you instructions to reset \u2028your password.",
1414
"homeScreenTodayText": "Today",
15-
"sideMenuLogoutButtonTitle": "Logout"
15+
"sideMenuLogoutButtonTitle": "Logout",
16+
"surveyDetailScreenStartSurveyButtonTitle": "Start Survey"
1617
}

assets/l10n/app_vi.arb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"forgotPasswordScreenResetSuccessfullyNotificationTitle": "Kiểm tra hộp thư email của bạn.",
1414
"forgotPasswordScreenResetSuccessfullyNotificationMessage": "Chúng tôi vừa gửi email huớng dẫn khôi phục mật khẩu về email của bạn.",
1515
"homeScreenTodayText": "Hôm nay",
16-
"sideMenuLogoutButtonTitle": "Đăng xuất"
16+
"sideMenuLogoutButtonTitle": "Đăng xuất",
17+
"surveyDetailScreenStartSurveyButtonTitle": "Bắt đầu khảm sát"
1718
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
part of '../survey_detail_module.dart';
2+
3+
class Content extends StatelessWidget {
4+
const Content({Key? key}) : super(key: key);
5+
6+
@override
7+
Widget build(BuildContext context) {
8+
return Screen(
9+
body: Stack(
10+
fit: StackFit.expand,
11+
children: [
12+
Image(
13+
image: Assets.images.mainBackgroundDimmed,
14+
fit: BoxFit.fill,
15+
),
16+
SafeArea(
17+
child: Column(
18+
children: [
19+
NavigationBar(),
20+
Expanded(
21+
child: Container(
22+
margin: const EdgeInsets.fromLTRB(20, 0, 20, 0),
23+
child: Column(
24+
children: [
25+
const Text(
26+
"Working from home Check-In",
27+
style: TextStyle(
28+
color: Colors.white,
29+
fontSize: 34,
30+
),
31+
),
32+
const SizedBox(
33+
height: 17,
34+
),
35+
Text(
36+
"We would like to know how you feel about our work from home (WFH) experience.",
37+
style: TextStyle(
38+
color: Colors.white.withOpacity(0.7),
39+
fontSize: 17,
40+
),
41+
),
42+
Expanded(child: Container()),
43+
Row(
44+
mainAxisAlignment: MainAxisAlignment.end,
45+
children: [
46+
ConstrainedBox(
47+
constraints: const BoxConstraints(
48+
minWidth: 140,
49+
),
50+
child: Button(
51+
title: AppLocalizations.of(context)!
52+
.surveyDetailScreenStartSurveyButtonTitle,
53+
),
54+
),
55+
]),
56+
],
57+
),
58+
),
59+
),
60+
],
61+
),
62+
),
63+
],
64+
),
65+
);
66+
}
67+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
part of 'survey_detail_module.dart';
2+
3+
abstract class SurveyDetailInteractorDelegate {}
4+
5+
abstract class SurveyDetailInteractor
6+
extends Interactor<SurveyDetailInteractorDelegate> {}
7+
8+
class SurveyDetailInteractorImpl extends SurveyDetailInteractor {}
Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
import 'package:flutter/widgets.dart';
1+
import 'package:flutter/material.dart' hide Router;
2+
import 'package:flutter/widgets.dart' hide Router;
3+
import 'package:survey/components/button/button.dart';
4+
import 'package:survey/components/navigation_bar/navigation_bar.dart';
25
import 'package:survey/core/viper/module.dart';
6+
import 'package:survey/gen/assets.gen.dart';
7+
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
38
import 'package:survey/modules/screen.dart';
49

5-
class SurveyDetailModule extends Module {
10+
part 'survey_detail_view.dart';
11+
12+
part 'survey_detail_interactor.dart';
13+
14+
part 'survey_detail_presenter.dart';
15+
16+
part 'survey_detail_router.dart';
17+
18+
part 'components/content.dart';
19+
20+
class SurveyDetailModule extends Module<SurveyDetailView,
21+
SurveyDetailInteractor, SurveyDetailPresenter, SurveyDetailRouter> {
622
static const routePath = "/survey/detail";
723

824
@override
925
Widget build(BuildContext context) {
10-
return const Screen(
11-
body: Center(
12-
child: Text("Survey Detail"),
13-
),
14-
);
26+
return const SurveyDetailViewImpl();
1527
}
1628
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
part of 'survey_detail_module.dart';
2+
3+
abstract class SurveyDetailPresenter extends Presenter<SurveyDetailView,
4+
SurveyDetailInteractor, SurveyDetailRouter> {}
5+
6+
class SurveyDetailPresenterImpl extends SurveyDetailPresenter
7+
implements SurveyDetailViewDelegate, SurveyDetailInteractorDelegate {}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
part of 'survey_detail_module.dart';
2+
3+
abstract class SurveyDetailRouter extends Router {}
4+
5+
class SurveyDetailRouterImpl extends SurveyDetailRouter {}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
part of 'survey_detail_module.dart';
2+
3+
abstract class SurveyDetailViewDelegate {}
4+
5+
abstract class SurveyDetailView extends View<SurveyDetailViewDelegate> {}
6+
7+
class SurveyDetailViewImpl extends StatefulWidget {
8+
const SurveyDetailViewImpl({Key? key}) : super(key: key);
9+
10+
@override
11+
_SurveyDetailViewImplState createState() => _SurveyDetailViewImplState();
12+
}
13+
14+
class _SurveyDetailViewImplState extends ViewState<SurveyDetailViewImpl,
15+
SurveyDetailModule, SurveyDetailViewDelegate> implements SurveyDetailView {
16+
@override
17+
Widget build(BuildContext context) {
18+
return const Content();
19+
}
20+
}

lib/services/locator/locator_service.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'package:survey/modules/home/home_module.dart';
55
import 'package:survey/modules/landing/landing_module.dart';
66
import 'package:survey/modules/login/login_module.dart';
77
import 'package:survey/modules/side_menu/side_menu_module.dart';
8+
import 'package:survey/modules/survey_detail/survey_detail_module.dart';
89
import 'package:survey/repositories/survey_repository.dart';
910
import 'package:survey/services/api/api_service.dart';
1011
import 'package:survey/services/api/auth/auth_api_service.dart';

lib/services/locator/locator_service_register.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,12 @@ class LocatorServiceRegister {
4646
locator.registerFactory<SideMenuInteractor>(() => SideMenuInteractorImpl());
4747
locator.registerFactory<SideMenuRouter>(() => SideMenuRouterImpl());
4848
locator.registerFactory<SideMenuPresenter>(() => SideMenuPresenterImpl());
49+
50+
// Survey Detail
51+
locator.registerFactory<SurveyDetailInteractor>(
52+
() => SurveyDetailInteractorImpl());
53+
locator.registerFactory<SurveyDetailRouter>(() => SurveyDetailRouterImpl());
54+
locator.registerFactory<SurveyDetailPresenter>(
55+
() => SurveyDetailPresenterImpl());
4956
}
5057
}

0 commit comments

Comments
 (0)