Skip to content

Commit

Permalink
Merge pull request #13 from gestgest/An_jinhyeok
Browse files Browse the repository at this point in the history
An jinhyeok
  • Loading branch information
gestgest authored Nov 27, 2022
2 parents c23bafd + a0ae8bd commit aac0c80
Show file tree
Hide file tree
Showing 20 changed files with 984 additions and 136 deletions.
2 changes: 0 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ if (flutterVersionName == null) {
}

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
Expand Down Expand Up @@ -70,7 +69,6 @@ flutter {
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.android.support:multidex:1.0.3'
implementation platform('com.google.firebase:firebase-bom:30.3.2')
implementation 'com.google.firebase:firebase-analytics'
Expand Down
4 changes: 2 additions & 2 deletions lib/Model/Poster.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Poster{
final String? title;
final String? uid;
final String? thumbnail;
User? user;
MyUser? user;
Poster({
this.title,
this.uid,
Expand All @@ -17,7 +17,7 @@ class Poster{
uid: json['uid'] == null ? '' : json['uid'] as String,
title: json['title'] == null ? '' : json['title'] as String,
thumbnail: json['thumbnail'] == null ? '' : json['thumbnail'] as String,
user: json['user'] == null ? null : json['user'] as User,
user: json['user'] == null ? null : json['user'] as MyUser,
);
}
Map<String, dynamic> toMap(){
Expand Down
4 changes: 2 additions & 2 deletions lib/Model/Story.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'User.dart';

class Story{
final String? image;
final User? user;
final MyUser? user;
final DateTime? time;
Story({
this.image,
Expand All @@ -14,7 +14,7 @@ class Story{
factory Story.fromJson(Map<String, dynamic> json){
return Story(
image: json['image'] == null ? '' : json['image'] as String,
user: json['user'] == null ? null : json['user'] as User,
user: json['user'] == null ? null : json['user'] as MyUser,
time: json['time'] == null ? null : json['time'] as DateTime,
);
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Model/User.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

class User{
class MyUser{
final String? name;
final String? uid;
final String? profile;
User({
MyUser({
this.name,
this.uid,
this.profile,
});

factory User.fromJson(Map<String, dynamic> json){
return User(
factory MyUser.fromJson(Map<String, dynamic> json){
return MyUser(
uid: json['uid'] == null ? '' : json['uid'] as String,
name: json['name'] == null ? '' : json['name'] as String,
profile: json['profile'] == null ? '' : json['profile'] as String,
Expand Down
4 changes: 2 additions & 2 deletions lib/Screen/DebugWidget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _DebugWidgetState extends State<DebugWidget> {
FutureBuilder(
future: userService.readUser("gest"), //Future <T>
builder: (BuildContext context,
AsyncSnapshot<User> snapshot) {
AsyncSnapshot<MyUser> snapshot) {
List<NetworkImage> list = [];
if (snapshot.connectionState == ConnectionState.done &&
snapshot.hasData) {
Expand All @@ -57,7 +57,7 @@ class _DebugWidgetState extends State<DebugWidget> {
child: Text("vv"),
onPressed: () {

userService.create( User(name : "ppap", uid: "tetet", profile: ss));
userService.create( MyUser(name : "ppap", uid: "tetet", profile: ss));
},
),
ElevatedButton(
Expand Down
2 changes: 1 addition & 1 deletion lib/Screen/HomeScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class _HomeScreenState extends State<HomeScreen> {
String name = data['user']['name'];
String profile = data['user']['profile'];
String uid = data['user']['uid'];
final user = User(name : name, profile: profile, uid: uid);
final user = MyUser(name : name, profile: profile, uid: uid);
return StoryWidget(
type: StoryType.NEW,
image: data['image'],
Expand Down
45 changes: 0 additions & 45 deletions lib/Screen/LoginScreen.dart

This file was deleted.

6 changes: 6 additions & 0 deletions lib/Screen/MyPageScreen.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_auth_platform_interface/firebase_auth_platform_interface.dart';
import 'package:flutter/material.dart';
import 'package:flutterfire_ui/auth.dart';
import 'package:provider/provider.dart';
import 'package:snsproject/Service/UserService.dart';

Expand All @@ -11,6 +14,7 @@ class MyPageScreen extends StatefulWidget {
}

class _MyPageState extends State<MyPageScreen> {

//오른쪽 위에 Appbar에 햄버거 버튼 = 블로그 메뉴 마냥 햄버거 버튼
//그 왼쪽에는 설정
//왼쪽 위 앱바에 친구 아이콘
Expand All @@ -24,6 +28,7 @@ class _MyPageState extends State<MyPageScreen> {
//왼쪽 위 앱바에 친구 아이콘
//메인은 프로필 사진[버튼 누르면 프사 변경] + 구분선 + 그냥 자기 게시물
//
//FirebaseAuth.instance.currentUser
return Container(
child : Scaffold(
appBar: AppBar(
Expand All @@ -40,6 +45,7 @@ class _MyPageState extends State<MyPageScreen> {
),
SizedBox(height:20),
Text("닉네임"),
SignOutButton(),
],
)
],
Expand Down
26 changes: 14 additions & 12 deletions lib/Screen/ProfileScreen.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:firebase_auth/firebase_auth.dart';
Expand All @@ -19,33 +20,33 @@ class _ProfileScreenState extends State<ProfileScreen> {

void update() => setState(() {});

Widget _avatar(){
Widget avatar() {
return Column(
children: [
ClipRRect(
borderRadius: BorderRadius.circular(300),
child: SizedBox(
width: 350,
height: 350,
child: thumbnailXfild!=null
child: thumbnailXfild != null
? Image.file(
File(thumbnailXfild!.path),
fit: BoxFit.cover,
File(thumbnailXfild!.path),
fit: BoxFit.cover,
)
: Image.asset('res/img/image2.jpg',
: Image.asset('res/img/image2.jpg',
fit: BoxFit.cover),
),
),
const SizedBox(height: 30),
ElevatedButton(onPressed: () async{
ElevatedButton(onPressed: () async {
thumbnailXfild = await _picker.pickImage(
source: ImageSource.gallery,imageQuality: 100);
source: ImageSource.gallery, imageQuality: 100);
update();
}, child: Text('이미지 업로드'),
}, child: Text('이미지 업로드'),
),
const SizedBox(height: 30),
ElevatedButton(onPressed: (){}, // 확인 누를 시 회원가입 입력 정보, 프로필 정보 받아가기
child: Text('확인'),
ElevatedButton(onPressed: () {}, // 확인 누를 시 회원가입 입력 정보, 프로필 정보 받아가기
child: Text('확인'),
),
],
);
Expand Down Expand Up @@ -76,10 +77,11 @@ class _ProfileScreenState extends State<ProfileScreen> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
const SizedBox(height: 30),
_avatar(),
avatar(),
],
),
),
);

}
}
}
Loading

0 comments on commit aac0c80

Please sign in to comment.