Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔀 :: (#11) madmovie 페이지 퍼블리싱 #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/components/hashtag.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ class GrapperHashtag extends StatelessWidget {
return Container(
height: 30,
alignment: Alignment.center,
padding: isSelected
? const EdgeInsets.symmetric(horizontal: 20)
: const EdgeInsets.all(0),
padding: isSelected ? const EdgeInsets.symmetric(horizontal: 20) : const EdgeInsets.all(0),
decoration: BoxDecoration(
color: isSelected ? GrapperColorRed.normal : Colors.black,
borderRadius: const BorderRadius.all(
Expand Down
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:grapper/views/recommend/recommend_page.dart';
import 'package:grapper/views/home/home_page.dart';

void main() {
runApp(const MyApp());
Expand All @@ -15,7 +15,7 @@ class MyApp extends StatelessWidget {
scaffoldBackgroundColor: Colors.black,
),
debugShowCheckedModeBanner: false,
home: const RecommendPage(),
home: const HomePage(),
);
}
}
81 changes: 81 additions & 0 deletions lib/views/home/home_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import 'package:flutter/material.dart';
import 'package:grapper/components/appbar.dart';
import 'package:grapper/components/hashtag.dart';
import 'package:grapper/utils/grapper_color.dart';
import 'package:grapper/views/recommend/recommend_page.dart';

// ignore: must_be_immutable
class HomePage extends StatefulWidget {
const HomePage({super.key});

@override
State<HomePage> createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
bool touch = true;
int hashtagIndex = 1;
final List<String> hashtags = ['핫딜', '추천', '인디게임', '매드무비'];

@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
left: false,
right: false,
bottom: false,
child: Column(
children: <Widget>[
Container(
margin: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
child: Column(
children: <Widget>[
const GrapperAppbar(
text: '테스트',
),
const SizedBox(
height: 25,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(
hashtags.length,
(index) => GestureDetector(
onTap: () {
setState(() {
hashtagIndex = index;
});
},
child: GrapperHashtag(
text: hashtags[index],
isSelected: hashtagIndex == index,
),
),
),
),
],
),
),
GestureDetector(
onTap: () => setState(() {
touch = false;
}),
child: touch
? Container(
margin: const EdgeInsets.only(top: 12),
decoration: const BoxDecoration(color: Colors.white),
height: 50,
)
: Container(
margin: const EdgeInsets.only(top: 5),
height: 14,
color: GrapperColorGrey.darkHover,
),
),
const RecommendPage(),
],
),
),
);
}
}
Loading
Loading