Skip to content

Commit

Permalink
feat[#46] : 전체 flow 정리, 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
chanhk-im committed Jan 28, 2023
1 parent df5bf07 commit ac14bca
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 39 deletions.
5 changes: 5 additions & 0 deletions lib/init/controller/onboarding_controller.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'package:get/get.dart';

class OnboardingController extends GetxController {

}
18 changes: 13 additions & 5 deletions lib/init/view/onboarding_view.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_norithon_team0/init/view/onboarding_view2.dart';
import 'package:flutter_norithon_team0/init/controller/onboarding_controller.dart';
import 'package:get/get.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';

import 'package:flutter_norithon_team0/post/view/add_post_view.dart';
import 'package:flutter_norithon_team0/post/view/home_view.dart';

class OnboardingView extends StatefulWidget {
const OnboardingView({super.key});
Expand All @@ -10,6 +15,9 @@ class OnboardingView extends StatefulWidget {
}

class _OnboardingViewState extends State<OnboardingView> {
OnboardingController _onboardingController = Get.put(OnboardingController());
static final storage = FlutterSecureStorage();

@override
Widget build(BuildContext context) {
// final controller = Get.put(OnboardingController());
Expand All @@ -36,7 +44,6 @@ class _OnboardingViewState extends State<OnboardingView> {
),
InkWell(
onTap: () {
Navigator.pop(context);
},
child: // ),
Image.asset(
Expand All @@ -46,7 +53,6 @@ class _OnboardingViewState extends State<OnboardingView> {
),
InkWell(
onTap: () {
Navigator.pop(context);
print("hi");
},
child: // ),
Expand All @@ -65,8 +71,10 @@ class _OnboardingViewState extends State<OnboardingView> {
width: 20,
),
InkWell(
onTap: () {
Navigator.pop(context);
onTap: () async {
await storage.write(
key: "user", value: DateTime.now().toString());
Get.offAll(() => AddPostView());
},
child: // ),
Image.asset(
Expand All @@ -79,7 +87,7 @@ class _OnboardingViewState extends State<OnboardingView> {
),
InkWell(
onTap: () {
Get.to(OnboardingView2());
Get.to(() => OnboardingView2());
},
child: // ),
Image.asset(
Expand Down
15 changes: 11 additions & 4 deletions lib/init/view/onboarding_view2.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import 'package:flutter/material.dart';
import 'package:flutter_norithon_team0/init/view/onboarding_view3.dart';
import 'package:flutter_norithon_team0/init/controller/onboarding_controller.dart';
import 'package:get/get.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';

import 'package:flutter_norithon_team0/post/view/add_post_view.dart';
import 'package:flutter_norithon_team0/post/view/home_view.dart';

class OnboardingView2 extends StatefulWidget {
const OnboardingView2({super.key});
Expand All @@ -10,6 +15,8 @@ class OnboardingView2 extends StatefulWidget {
}

class _OnboardingView2State extends State<OnboardingView2> {
static final storage = FlutterSecureStorage();

@override
Widget build(BuildContext context) {
// final controller = Get.put(OnboardingController());
Expand All @@ -36,7 +43,6 @@ class _OnboardingView2State extends State<OnboardingView2> {
),
InkWell(
onTap: () {
Navigator.pop(context);
},
child: // ),
Image.asset(
Expand All @@ -46,7 +52,6 @@ class _OnboardingView2State extends State<OnboardingView2> {
),
InkWell(
onTap: () {
Navigator.pop(context);
print("hi");
},
child: // ),
Expand All @@ -65,8 +70,10 @@ class _OnboardingView2State extends State<OnboardingView2> {
width: 20,
),
InkWell(
onTap: () {
Navigator.pop(context);
onTap: () async {
await storage.write(
key: "user", value: DateTime.now().toString());
Get.offAll(() => AddPostView());
},
child: // ),
Image.asset(
Expand Down
20 changes: 14 additions & 6 deletions lib/init/view/onboarding_view3.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_norithon_team0/init/controller/onboarding_controller.dart';
import 'package:get/get.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';

import 'package:flutter_norithon_team0/post/view/add_post_view.dart';
import 'package:flutter_norithon_team0/post/view/home_view.dart';

class OnboardingView3 extends StatefulWidget {
const OnboardingView3({super.key});
Expand All @@ -9,6 +14,8 @@ class OnboardingView3 extends StatefulWidget {
}

class _OnboardingView3State extends State<OnboardingView3> {
static final storage = FlutterSecureStorage();

@override
Widget build(BuildContext context) {
// final controller = Get.put(OnboardingController());
Expand All @@ -35,7 +42,6 @@ class _OnboardingView3State extends State<OnboardingView3> {
),
InkWell(
onTap: () {
Navigator.pop(context);
},
child: // ),
Image.asset(
Expand All @@ -45,7 +51,6 @@ class _OnboardingView3State extends State<OnboardingView3> {
),
InkWell(
onTap: () {
Navigator.pop(context);
print("hi");
},
child: // ),
Expand All @@ -64,8 +69,9 @@ class _OnboardingView3State extends State<OnboardingView3> {
width: 20,
),
InkWell(
onTap: () {
Navigator.pop(context);
onTap: () async {
await storage.write(key: "user", value: DateTime.now().toString());
Get.to(() => AddPostView());
},
child: // ),
Image.asset(
Expand All @@ -77,8 +83,10 @@ class _OnboardingView3State extends State<OnboardingView3> {
width: 310,
),
InkWell(
onTap: () {
//home으로 감
onTap: () async {
await storage.write(
key: "user", value: DateTime.now().toString());
Get.offAll(() => HomeView());
},
child: // ),
Image.asset(
Expand Down
68 changes: 44 additions & 24 deletions lib/post/view/detail_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class _DetailViewState extends State<DetailView> {
void initState() {
detailPost = _postController.selectedPost!;
super.initState();

}

@override
Expand Down Expand Up @@ -134,31 +133,52 @@ class _DetailViewState extends State<DetailView> {
SizedBox(
width: 20,
),
if (!_postController.isNori)
SizedBox(
height: 59,
width: 272,
child: ElevatedButton(
child: const Text(
'오늘의 노리 추가하기 ',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold),
),
onPressed: () async {
await _postController
.addNoriPost(detailPost);
Get.back();
},
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(16.0),
_postController.isNori
? SizedBox(
height: 59,
width: 272,
child: ElevatedButton(
child: const Text(
'오늘의 노리 추가됨',
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontWeight: FontWeight.bold),
),
onPressed: () {},
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(16.0),
),
primary: Color(0xFFEEEEEE),
),
),
)
: SizedBox(
height: 59,
width: 272,
child: ElevatedButton(
child: const Text(
'오늘의 노리 추가하기 ',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold),
),
onPressed: () async {
await _postController
.addNoriPost(detailPost);
Get.back();
},
style: ElevatedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(16.0),
),
primary: Color(0xFFFFBA35),
),
),
primary: Color(0xFFFFBA35),
),
),
),
],
)
],
Expand Down

0 comments on commit ac14bca

Please sign in to comment.