import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'my_carrot_header.dart'; class MyCarrotScreen extends StatelessWidget { const MyCarrotScreen({Key? key}); @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.grey[100], appBar: AppBar( title: const Text("나의 당근"), actions: [ IconButton(onPressed: () {}, icon: const Icon(Icons.settings)), ], bottom: const PreferredSize( preferredSize: Size.fromHeight(0.5), child: Divider(thickness: 0.5, endIndent: 16, color: Colors.grey), ), ), body: ListView( children: [ MyCarrotHeader(), const SizedBox(height: 8.0), ], ), ); } }
import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class MyCarrotHeader extends StatelessWidget { const MyCarrotHeader({Key? key}); @override Widget build(BuildContext context) { return Card( elevation: 0.5, margin: EdgeInsets.zero, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0.0)), child: Padding( padding: EdgeInsets.symmetric(vertical: 20, horizontal: 16), child: Column( children: [ _buildProfileRow(), const SizedBox(height: 30), _buildProfileButton(), const SizedBox(height: 30), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ _buildRoundTextButton("판매내역", FontAwesomeIcons.receipt), _buildRoundTextButton("구매내역", FontAwesomeIcons.shoppingBag), _buildRoundTextButton("관심목록", FontAwesomeIcons.heart), ], ), ], ), ), ); } Widget _buildProfileRow() { return Container(color: Colors.redAccent[100], height: 60); } Widget _buildProfileButton() { return Container(color: Colors.blue[100], height: 45); } Widget _buildRoundTextButton(String title, IconData iconData) { return Container(color: Colors.orange[100], height: 60, width: 60); } }
import 'package:carrot_market_ui/theme.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class MyCarrotHeader extends StatelessWidget { const MyCarrotHeader({Key? key}); @override Widget build(BuildContext context) { return Card( elevation: 0.5, margin: EdgeInsets.zero, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0.0)), child: Padding( padding: EdgeInsets.symmetric(vertical: 20, horizontal: 16), child: Column( children: [ _buildProfileRow(), const SizedBox(height: 30), _buildProfileButton(), const SizedBox(height: 30), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ _buildRoundTextButton("판매내역", FontAwesomeIcons.receipt), _buildRoundTextButton("구매내역", FontAwesomeIcons.shoppingBag), _buildRoundTextButton("관심목록", FontAwesomeIcons.heart), ], ), ], ), ), ); } Widget _buildProfileRow() { return Row( children: [ Stack( children: [ SizedBox( width: 65, height: 65, child: ClipRRect( borderRadius: BorderRadius.circular(32.5), child: Image.network( "http://picsum.photos/200/100", fit: BoxFit.cover, ), ), ), Positioned( bottom: 0, right: 0, child: Container( width: 20, height: 20, decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), color: Colors.grey[100], ), child: Icon( Icons.camera_alt_outlined, size: 15, ), ), ), ], ), SizedBox(width: 16), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text("developer", style: textTheme().displayMedium), SizedBox(height: 10), Text("좌동 #00912"), ], ) ], ); } Widget _buildProfileButton() { return Container(color: Colors.blue[100], height: 45); } Widget _buildRoundTextButton(String title, IconData iconData) { return Container(color: Colors.orange[100], height: 60, width: 60); } }
import 'package:carrot_market_ui/theme.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class MyCarrotHeader extends StatelessWidget { const MyCarrotHeader({Key? key}); @override Widget build(BuildContext context) { return Card( elevation: 0.5, margin: EdgeInsets.zero, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0.0)), child: Padding( padding: EdgeInsets.symmetric(vertical: 20, horizontal: 16), child: Column( children: [ _buildProfileRow(), const SizedBox(height: 30), _buildProfileButton(), const SizedBox(height: 30), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ _buildRoundTextButton("판매내역", FontAwesomeIcons.receipt), _buildRoundTextButton("구매내역", FontAwesomeIcons.shoppingBag), _buildRoundTextButton("관심목록", FontAwesomeIcons.heart), ], ), ], ), ), ); } Widget _buildProfileRow() { return Row( children: [ Stack( children: [ SizedBox( width: 65, height: 65, child: ClipRRect( borderRadius: BorderRadius.circular(32.5), child: Image.network( "http://picsum.photos/200/100", fit: BoxFit.cover, ), ), ), Positioned( bottom: 0, right: 0, child: Container( width: 20, height: 20, decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), color: Colors.grey[100], ), child: Icon( Icons.camera_alt_outlined, size: 15, ), ), ), ], ), SizedBox(width: 16), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text("developer", style: textTheme().displayMedium), SizedBox(height: 10), Text("좌동 #00912"), ], ) ], ); } Widget _buildProfileButton() { return InkWell( onTap: () {}, child: Container( decoration: BoxDecoration( border: Border.all(color: Color(0xFFD4D5DD), width: 1.0), borderRadius: BorderRadius.circular(6.0), ), height: 45, child: Center( child: Center( child: Text( "프로필 보기", style: textTheme().titleMedium, ), ), ), ), ); } Widget _buildRoundTextButton(String title, IconData iconData) { return Container(color: Colors.orange[100], height: 60, width: 60); } }
import 'package:carrot_market_ui/theme.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class MyCarrotHeader extends StatelessWidget { const MyCarrotHeader({Key? key}); @override Widget build(BuildContext context) { return Card( elevation: 0.5, margin: EdgeInsets.zero, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0.0)), child: Padding( padding: EdgeInsets.symmetric(vertical: 20, horizontal: 16), child: Column( children: [ _buildProfileRow(), const SizedBox(height: 30), _buildProfileButton(), const SizedBox(height: 30), Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ _buildRoundTextButton("판매내역", FontAwesomeIcons.receipt), _buildRoundTextButton("구매내역", FontAwesomeIcons.shoppingBag), _buildRoundTextButton("관심목록", FontAwesomeIcons.heart), ], ), ], ), ), ); } Widget _buildProfileRow() { return Row( children: [ Stack( children: [ SizedBox( width: 65, height: 65, child: ClipRRect( borderRadius: BorderRadius.circular(32.5), child: Image.network( "http://picsum.photos/200/100", fit: BoxFit.cover, ), ), ), Positioned( bottom: 0, right: 0, child: Container( width: 20, height: 20, decoration: BoxDecoration( borderRadius: BorderRadius.circular(15), color: Colors.grey[100], ), child: Icon( Icons.camera_alt_outlined, size: 15, ), ), ), ], ), SizedBox(width: 16), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text("developer", style: textTheme().displayMedium), SizedBox(height: 10), Text("좌동 #00912"), ], ) ], ); } Widget _buildProfileButton() { return InkWell( onTap: () {}, child: Container( decoration: BoxDecoration( border: Border.all(color: Color(0xFFD4D5DD), width: 1.0), borderRadius: BorderRadius.circular(6.0), ), height: 45, child: Center( child: Center( child: Text( "프로필 보기", style: textTheme().titleMedium, ), ), ), ), ); } Widget _buildRoundTextButton(String title, IconData iconData) { return Column( children: [ Container( width: 60, height: 60, decoration: BoxDecoration( borderRadius: BorderRadius.circular(30.0), color: Color.fromRGBO(225, 226, 208, 1), border: Border.all(color: Color(0xFFD4D5DD), width: 0.5)), child: Icon(iconData, color: Colors.orange), ), SizedBox(height: 10), Text(title, style: textTheme().titleMedium), ], ); } }
import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class IconMenu { final String title; final IconData iconData; IconMenu({required this.title, required this.iconData}); } final List<IconMenu> iconMenu1 = [ IconMenu(title: '내 동네 설정', iconData: FontAwesomeIcons.mapMarkerAlt), IconMenu(title: '동네 인증하기', iconData: FontAwesomeIcons.compressArrowsAlt), IconMenu(title: '키워드 알림', iconData: FontAwesomeIcons.tag), IconMenu(title: '모아보기', iconData: FontAwesomeIcons.borderAll) ]; final List<IconMenu> iconMenu2 = [ IconMenu(title: '동네생활 글', iconData: FontAwesomeIcons.edit), IconMenu(title: '동네생활 댓글', iconData: FontAwesomeIcons.commentDots), IconMenu(title: '동네생활 주제 목록', iconData: FontAwesomeIcons.star) ]; final List<IconMenu> iconMenu3 = [ IconMenu(title: '비즈프로필 관리', iconData: FontAwesomeIcons.store), IconMenu(title: '지역광고', iconData: FontAwesomeIcons.bullhorn) ];
import 'package:carrot_market_ui/theme.dart'; import 'package:flutter/material.dart'; import '../../models/icon_menu.dart'; class CardIconMenu extends StatelessWidget { final List<IconMenu> iconMenuList; CardIconMenu({required this.iconMenuList}); @override Widget build(BuildContext context) { return Card( elevation: 0.5, margin: EdgeInsets.zero, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(0.0)), child: Padding( padding: EdgeInsets.all(16.0), child: Column( children: List.generate( iconMenuList.length, (index) => _buildRowIconItem( iconMenuList[index].title, iconMenuList[index].iconData), ), ), ), ); } Widget _buildRowIconItem(String title, IconData iconData){ return Container( height: 50, child: Row( children: [ Icon(iconData, size: 17), const SizedBox(width: 20), Text(title, style: textTheme().titleMedium) ], ), ); } }
import 'package:carrot_market_ui/models/icon_menu.dart'; import 'package:carrot_market_ui/screens/components/card_icon_menu.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'my_carrot_header.dart'; class MyCarrotScreen extends StatelessWidget { const MyCarrotScreen({Key? key}); @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.grey[100], appBar: AppBar( title: const Text("나의 당근"), actions: [ IconButton(onPressed: () {}, icon: const Icon(Icons.settings)), ], bottom: const PreferredSize( preferredSize: Size.fromHeight(0.5), child: Divider(thickness: 0.5, endIndent: 16, color: Colors.grey), ), ), body: ListView( children: [ MyCarrotHeader(), const SizedBox(height: 8.0), CardIconMenu(iconMenuList: iconMenu1), const SizedBox(height: 8.0), CardIconMenu(iconMenuList: iconMenu2), const SizedBox(height: 8.0), CardIconMenu(iconMenuList: iconMenu3), ], ), ); } }
Share article