Skip to content

Commit

Permalink
Merge pull request #27 from mikjk97/master
Browse files Browse the repository at this point in the history
'completed profile'
  • Loading branch information
forseaest authored May 26, 2022
2 parents 027515e + ea654d9 commit 28287e3
Showing 1 changed file with 186 additions and 25 deletions.
211 changes: 186 additions & 25 deletions lib/navigator/profile.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import 'package:capstone_2022_48/pages/HomeCalendar.dart';
import 'package:flutter/material.dart';
import 'package:capstone_2022_48/navigator/sidemenu.dart';

class Profile extends StatefulWidget {
const Profile({Key? key}) : super(key: key);

@override
State<Profile> createState() => _ProfileState();
}

class _ProfileState extends State<Profile> {
String _selectedGender = '여성';
final formKey = GlobalKey<FormState>();
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
drawer: SideMenu(),
appBar: AppBar(
leading: Builder(
Expand All @@ -25,35 +27,194 @@ class _ProfileState extends State<Profile> {
backgroundColor: Colors.white,
elevation: 0.0,
),
body: Column(
children: <Widget>[
SizedBox(height: 30.0),
Container(
width: MediaQuery.of(context).size.width * 0.9,
child: Column(
children: <Widget>[
Card(
child: ListTile(
leading: Icon(Icons.people),
title: Text('성별'),
),
body: Container(
margin: EdgeInsets.all(20.0),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.all(10),
padding: EdgeInsets.all(15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Color(0xffdddddd),
),
Card(
child: ListTile(
leading: Icon(Icons.height),
title: Text('키'),
child: Text(
'기초 대사량과 BMI 지수, 필요 섭취 칼로리량을 계산하기 위해 필요한 정보들입니다. 반드시 입력해주세요😆',
style: TextStyle(
fontFamily: 'Pretendard',
fontSize: 16,
),
),
Card(
child: ListTile(
leading: Icon(Icons.monitor_weight),
title: Text('몸무게'),
),
SizedBox(height: 20),
RichText(
text: TextSpan(
children: [
WidgetSpan(
child: Icon(Icons.people),
),
TextSpan(
text: " 성별을 선택해주세요.",
style: TextStyle(
color: Colors.black,
fontSize: 18,
fontFamily: 'Pretendard',
),
),
],
),
),
ListTile(
leading: Radio<String>(
value: '여성',
groupValue: _selectedGender,
onChanged: (value) {
setState(() {
_selectedGender = value!;
});
},
),
title: const Text(
'여성',
style: TextStyle(
fontFamily: 'Pretendard',
),
),
],
),
),
ListTile(
leading: Radio<String>(
value: '남성',
groupValue: _selectedGender,
onChanged: (value) {
setState(() {
_selectedGender = value!;
});
},
),
title: const Text(
'남성',
style: TextStyle(fontFamily: 'Pretendard'),
),
),
SizedBox(height: 20),
Form(
key: formKey,
child: Column(
children: <Widget>[
TextFormField(
style: TextStyle(
fontFamily: 'Pretendard',
),
onSaved: (value) {},
validator: (value) {
if (value != null && value.isEmpty) {
return '나이를 입력해주세요';
}
return null;
},
decoration: InputDecoration(
icon: Icon(Icons.person),
border: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(20.0)),
borderSide: BorderSide(color: Colors.grey),
),
hintText: '나이를 입력해주세요.',
labelText: '나이'),
),
SizedBox(height: 20),
TextFormField(
style: TextStyle(
fontFamily: 'Pretendard',
),
onSaved: (value) {},
validator: (value) {
if (value != null && value.isEmpty) {
return '키를 입력해주세요';
}
return null;
},
decoration: InputDecoration(
icon: Icon(Icons.height),
border: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(20.0)),
borderSide: BorderSide(color: Colors.grey),
),
hintText: '키를 입력해주세요.',
labelText: '키'),
),
SizedBox(height: 20),
TextFormField(
style: TextStyle(
fontFamily: 'Pretendard',
),
onSaved: (value) {},
validator: (value) {
if (value != null && value.isEmpty) {
return '체중을 입력해주세요';
}
return null;
},
decoration: InputDecoration(
icon: Icon(Icons.monitor_weight),
border: OutlineInputBorder(
borderRadius:
BorderRadius.all(Radius.circular(20.0)),
borderSide: BorderSide(color: Colors.grey),
),
hintText: '체중을 입력해주세요.',
labelText: '체중'),
),
Container(
padding: EdgeInsets.symmetric(vertical: 10.0),
alignment: Alignment.center,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Color.fromARGB(255, 102, 160, 207),
textStyle: TextStyle(
fontFamily: 'Pretendard',
fontSize: 15,
fontWeight: FontWeight.bold),
),
onPressed: () {
if (formKey.currentState!.validate()) {
formKey.currentState!.save();
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
width: 200,
behavior: SnackBarBehavior.floating,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(35),
),
backgroundColor:
Color.fromARGB(255, 183, 179, 179),
content: Text(
'제출 되었습니다!',
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Pretendard',
fontSize: 16,
color: Colors.white),
)),
);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => HomeCalendar()));
}
},
child: Text('제출 하기')),
),
],
),
),
],
),
],
),
),
);
}
Expand Down

0 comments on commit 28287e3

Please sign in to comment.