Skip to content

Commit

Permalink
Merge pull request #26 from seochan99/feature/profile
Browse files Browse the repository at this point in the history
✨Feat : Study main, haeder
  • Loading branch information
bunju20 authored Feb 18, 2024
2 parents 56d86cb + c010fb6 commit 62f8bdf
Show file tree
Hide file tree
Showing 15 changed files with 587 additions and 206 deletions.
5 changes: 5 additions & 0 deletions assets/icons/back.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/icons/back_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions lib/utilities/style/color_styles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';

class ColorSystem {
static const Color main = Color(0xFF1DA1FA);
static const Color main2 = Color(0xFF1FA9DC);
static const Color sub1 = Color(0xFF5588FD);
static const Color sub2 = Color(0xFFC1D2FF);
static const Color sub3 = Color(0xFFF1F5FE);
Expand All @@ -14,6 +15,8 @@ class ColorSystem {
static const Color gray1 = Color(0xFFF5F5F9);
static const Color white = Color(0xFFFFFFFF);
static const Color green = Color(0xFF63DC68);
static const Color green2 = Color(0xFFD5E9AA);

static const Color yellow = Color(0xFFFFC100);
static const Color red = Color(0xFFFB5D5D);
static const Color background = Color(0xFFF0F4F8);
Expand Down
46 changes: 46 additions & 0 deletions lib/views/base/default_back_appbar.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import 'package:earlips/utilities/style/color_styles.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart';

class DefaultBackAppbar extends StatelessWidget {
final String title;
const DefaultBackAppbar({super.key, required this.title});

@override
Widget build(BuildContext context) {
return AppBar(
title: Text(
title,
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600),
),
centerTitle: true,
surfaceTintColor: ColorSystem.white,
backgroundColor: ColorSystem.white,
automaticallyImplyLeading: true,
leadingWidth: 90,
leading: TextButton.icon(
style: TextButton.styleFrom(
splashFactory: NoSplash.splashFactory,
foregroundColor: ColorSystem.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16.0),
),
),
icon: SvgPicture.asset("assets/icons/back.svg"),
label: const Text(
"뒤로",
style: TextStyle(
color: ColorSystem.gray5,
fontSize: 14,
fontWeight: FontWeight.w600,
height: 1.4,
),
),
onPressed: () {
Get.back();
},
),
);
}
}
8 changes: 6 additions & 2 deletions lib/views/profile/profile_account/profile_account_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:earlips/utilities/style/color_styles.dart';
import 'package:earlips/views/auth/auth_dialog.dart';
import 'package:earlips/views/base/default_back_appbar.dart';
import 'package:flutter/material.dart';

class ProfileAccountScreen extends StatelessWidget {
Expand All @@ -8,8 +9,11 @@ class ProfileAccountScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('계정 관리'),
appBar: const PreferredSize(
preferredSize: Size.fromHeight(kToolbarHeight),
child: DefaultBackAppbar(
title: "계정 관리",
),
),
body: Container(
color: ColorSystem.white,
Expand Down
2 changes: 1 addition & 1 deletion lib/views/profile/profile_header_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ProfileHeader extends StatelessWidget {
child: Container(
color: ColorSystem.background,
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 62, 20, 24),
padding: const EdgeInsets.fromLTRB(20, 48, 20, 24),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:earlips/utilities/style/color_styles.dart';
import 'package:earlips/viewModels/user/user_viewmodel.dart';
import 'package:earlips/views/base/default_back_appbar.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:easy_localization/easy_localization.dart';
Expand All @@ -17,8 +18,11 @@ class ProfileLanguageScreen extends StatelessWidget {
String learningLanguage = tr('learning_language');

return Scaffold(
appBar: AppBar(
title: Text(title),
appBar: const PreferredSize(
preferredSize: Size.fromHeight(kToolbarHeight),
child: DefaultBackAppbar(
title: "언어 설정",
),
),
body: Container(
width: double.infinity,
Expand Down
20 changes: 11 additions & 9 deletions lib/views/script/create_script_screen.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import 'package:earlips/utilities/style/color_styles.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:earlips/viewModels/script/create_script_viewmodel.dart';
import 'package:get/get.dart';

class CreateScriptPage extends StatelessWidget {
const CreateScriptPage({super.key});

@override
Widget build(BuildContext context) {
return ChangeNotifierProvider<CreateScriptViewModel>(
create: (_) => CreateScriptViewModel(),
child: Consumer<CreateScriptViewModel>(
builder: (context, model, child) => Scaffold(
appBar: AppBar(
title: Text('대본으로 학습하기'),
title: const Text('대본으로 학습하기'),
centerTitle: true,
actions: <Widget>[
TextButton(
onPressed: model.complete,
child: Text(
child: const Text(
'완료',
style: TextStyle(
color: Colors.black,
Expand All @@ -35,7 +38,7 @@ class CreateScriptPage extends StatelessWidget {
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.all(10.0),
padding: const EdgeInsets.all(10.0),
child: TextField(
controller: model.writedTextController,
expands: true,
Expand All @@ -56,9 +59,9 @@ class CreateScriptPage extends StatelessWidget {
Expanded(
flex: 1,
child: Padding(
padding: EdgeInsets.fromLTRB(25, 20, 25, 100),
padding: const EdgeInsets.fromLTRB(25, 20, 25, 100),
child: Container(
padding: EdgeInsets.all(20.0),
padding: const EdgeInsets.all(20.0),
width: Get.width * 0.8,
decoration: BoxDecoration(
color: Colors.white,
Expand All @@ -68,14 +71,14 @@ class CreateScriptPage extends StatelessWidget {
color: Colors.grey.withOpacity(0.5),
spreadRadius: 1,
blurRadius: 6,
offset: Offset(0, 3),
offset: const Offset(0, 3),
),
],
),
child: SingleChildScrollView(
child: Text(
model.voicedTextController.text,
style: TextStyle(fontSize: 16),
style: const TextStyle(fontSize: 16),
),
),
),
Expand All @@ -99,7 +102,7 @@ class CreateScriptPage extends StatelessWidget {
borderRadius: BorderRadius.circular(40),
onTap: model.toggleRecording,
child: Padding(
padding: EdgeInsets.all(20),
padding: const EdgeInsets.all(20),
child: Icon(
model.isRecording ? Icons.stop : Icons.mic,
size: 30,
Expand All @@ -117,4 +120,3 @@ class CreateScriptPage extends StatelessWidget {
);
}
}

37 changes: 20 additions & 17 deletions lib/views/study/date_study_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:earlips/viewModels/study/date_study_screen_viewmodel.dart';

class DateStudyScreen extends StatelessWidget {
final DateTime date;
DateStudyScreen({Key? key, required this.date}) : super(key: key);
const DateStudyScreen({super.key, required this.date});

@override
Widget build(BuildContext context) {
Expand All @@ -14,7 +14,12 @@ class DateStudyScreen extends StatelessWidget {

return Scaffold(
appBar: AppBar(
title: Text(DateFormat('yyyy년 MM월 dd일').format(date)), // 동적으로 날짜를 표시
title: Text(DateFormat('yyyy/MM/dd').format(date),
style: const TextStyle(
color: Colors.black,
fontSize: 18,
fontWeight: FontWeight.w500,
)), // 동적으로 날짜를 표시
centerTitle: true,
),
body: ListView.separated(
Expand All @@ -28,21 +33,22 @@ class DateStudyScreen extends StatelessWidget {
borderRadius: BorderRadius.circular(15.0),
boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 1,
color: Colors.grey.withOpacity(0.15),
spreadRadius: 0.1,
blurRadius: 10,
offset: Offset(0, 2),
offset: const Offset(0, 2),
),
],
),
child: Column(
children: [
Container(
alignment: Alignment.centerLeft,
margin: EdgeInsets.only(left: 20.0, top: 16.0),
margin: const EdgeInsets.only(left: 20.0, top: 16.0),
child: _SmallCard(name: session.type)), // 세션 유형을 표시
ListTile(
contentPadding: const EdgeInsets.only(left: 20, right: 20, bottom: 30),
contentPadding:
const EdgeInsets.only(left: 20, right: 20, bottom: 30),
title: Container(
alignment: Alignment.center,
child: Text(
Expand All @@ -53,9 +59,7 @@ class DateStudyScreen extends StatelessWidget {
),
),
),
onTap: () {
// TODO: 세부 대본 학습 페이지로 이동하도록 구현
},
onTap: () {},
),
],
),
Expand All @@ -70,27 +74,26 @@ class DateStudyScreen extends StatelessWidget {
class _SmallCard extends StatelessWidget {
final String name;

const _SmallCard({Key? key, required this.name}) : super(key: key);
const _SmallCard({super.key, required this.name});

@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.0),
color: Color(0xFF1FA9DC),
color: const Color(0xFF1FA9DC),
),
alignment: Alignment.center,
width: 50,
height: 20,
height: 24,
child: Text(
name,
style: TextStyle(
style: const TextStyle(
color: Colors.white,
fontSize: 14,
fontFamily: 'Pretendard-Bold',
fontWeight: FontWeight.bold,
fontWeight: FontWeight.w600,
),
),
);
}
}
}
Loading

0 comments on commit 62f8bdf

Please sign in to comment.