Skip to content

Commit 2893cd2

Browse files
committed
Change error in navigation bar of AIfeed
1 parent a70c37a commit 2893cd2

4 files changed

Lines changed: 19 additions & 30 deletions

File tree

myapp/lib/content/AIfeed.dart

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class _BookRecommendationContentState extends State<BookRecommendationContent>
4242
void initState() {
4343
super.initState();
4444

45-
// 검색창 입력이 바뀔 때마다 setState() 호출해서 버튼 상태 업데이트
4645
_searchController.addListener(() {
4746
setState(() {});
4847
});
@@ -81,21 +80,6 @@ class _BookRecommendationContentState extends State<BookRecommendationContent>
8180
buildBookSearchTab(),
8281
],
8382
),
84-
bottomNavigationBar: BottomAppBar(
85-
color: const Color(0xFFFDFCE5),
86-
child: Padding(
87-
padding: const EdgeInsets.symmetric(horizontal: 32.0, vertical: 10),
88-
child: Row(
89-
mainAxisAlignment: MainAxisAlignment.spaceAround,
90-
children: const [
91-
Icon(Icons.home, size: 28),
92-
Icon(Icons.search, size: 28),
93-
Icon(Icons.bookmark, size: 28),
94-
Icon(Icons.settings, size: 28),
95-
],
96-
),
97-
),
98-
),
9983
),
10084
);
10185
}
@@ -147,6 +131,7 @@ class _BookRecommendationContentState extends State<BookRecommendationContent>
147131
style: TextStyle(fontSize: 18, color: Colors.white)),
148132
),
149133
),
134+
const SizedBox(height: 80),
150135
],
151136
),
152137
);
@@ -188,6 +173,7 @@ class _BookRecommendationContentState extends State<BookRecommendationContent>
188173
style: TextStyle(fontSize: 18, color: Colors.white)),
189174
),
190175
),
176+
const SizedBox(height: 80),
191177
],
192178
),
193179
);

myapp/lib/content/bookmark.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ class _BookmarkContentState extends State<BookmarkContent> {
154154
child: coverUrl != null
155155
? Image.network(
156156
coverUrl,
157-
width: 100,
158-
height: 150,
157+
width: 200,
158+
height: 280,
159159
fit: BoxFit.contain,
160160
errorBuilder: (context, error, stackTrace) {
161161
return const Icon(Icons.book, size: 100);

myapp/lib/content/home.dart

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import '../component/feedview.dart';
44
import 'AIfeed.dart';
55

66
class HomeContent extends StatelessWidget {
7-
HomeContent({super.key});
7+
final VoidCallback onNavigateToRecommendation;
8+
9+
HomeContent({super.key, required this.onNavigateToRecommendation});
810

911
final PageController pageController = PageController(initialPage: 0);
1012

@@ -102,15 +104,7 @@ class HomeContent extends StatelessWidget {
102104
final screenWidth = MediaQuery.of(context).size.width;
103105

104106
return GestureDetector(
105-
onTap: () {
106-
Navigator.push(
107-
context,
108-
MaterialPageRoute(
109-
builder: (context) =>
110-
const BookRecommendationContent(), // from aifeed.dart
111-
),
112-
);
113-
},
107+
onTap: onNavigateToRecommendation,
114108
child: Container(
115109
width: screenWidth * 0.85, // 화면 너비의 80%
116110
decoration: BoxDecoration(

myapp/lib/main.dart

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'content/home.dart';
66
import 'content/booksearch.dart';
77
import 'content/bookmark.dart';
88
import 'content/login.dart';
9+
import 'content/AIfeed.dart';
910

1011
void main() => runApp(MultiProvider(
1112
providers: [
@@ -50,7 +51,11 @@ class _MainApp extends State<MainApp> {
5051
@override
5152
void initState() {
5253
super.initState();
53-
_child = HomeContent();
54+
_child = HomeContent(onNavigateToRecommendation: () {
55+
setState(() {
56+
_child = BookRecommendationContent(); // replaces only the body
57+
});
58+
});
5459
}
5560

5661
@override
@@ -97,7 +102,11 @@ class _MainApp extends State<MainApp> {
97102
setState(() {
98103
switch (index) {
99104
case 0:
100-
_child = HomeContent();
105+
_child = HomeContent(onNavigateToRecommendation: () {
106+
setState(() {
107+
_child = BookRecommendationContent(); // replaces only the body
108+
});
109+
});
101110
break;
102111
case 1:
103112
_child = SearchContent();

0 commit comments

Comments
 (0)