Skip to content

Commit

Permalink
feat: add KpostalView #16
Browse files Browse the repository at this point in the history
  • Loading branch information
okodeee committed Dec 2, 2023
1 parent 4ee518d commit 7ebbed5
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 15 deletions.
61 changes: 50 additions & 11 deletions lib/view/writing_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import 'dart:io';

import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'package:intl/intl.dart';
import 'package:kpostal/kpostal.dart';

class WritingView extends StatefulWidget {
const WritingView({super.key});
Expand Down Expand Up @@ -30,6 +32,13 @@ class _WritingViewState extends State<WritingView> {
}
}

String postCode = '';
String address = '';
String latitude = '';
String longitude = '';
String kakaoLatitude = '';
String kakaoLongitude = '';


@override
Widget build(BuildContext context) {
Expand All @@ -47,7 +56,6 @@ class _WritingViewState extends State<WritingView> {
onPressed: () {},
icon: Icon(Icons.arrow_back_ios_rounded, color: Colors.black)),
),
resizeToAvoidBottomInset : false,
body: GestureDetector(
onTap: (){
FocusScope.of(context).unfocus();
Expand Down Expand Up @@ -79,7 +87,8 @@ class _WritingViewState extends State<WritingView> {
});
},
child: Text(
'selectedDate',
selectedDate == null ? '' :
DateFormat('yyyy-MM-dd').format(selectedDate!),
textAlign: TextAlign.start,
style: TextStyle(
color: Colors.black87,
Expand All @@ -101,14 +110,44 @@ class _WritingViewState extends State<WritingView> {
style: TextStyle(fontSize: 17.0, fontWeight: FontWeight.w700),
),
SizedBox(height: 10.0),
TextField(
decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(20, 20, 20, 20),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none,
Container(
width: double.infinity,
child: ElevatedButton(
onPressed: () async {
await Navigator.push(context, MaterialPageRoute(
builder: (_) => KpostalView(
callback: (Kpostal result) {
print(result.sigungu);
setState(() {
this.postCode = result.postCode;
this.address = result.address;
this.latitude = result.latitude.toString();
this.longitude = result.longitude.toString();
this.kakaoLatitude = result.kakaoLatitude.toString();
this.kakaoLongitude =
result.kakaoLongitude.toString();
});
},
),
filled: true)),
));
},
child: Text(
this.address,
textAlign: TextAlign.start,
style: TextStyle(
color: Colors.black87,
),
),
style: ElevatedButton.styleFrom(
primary: Color(0xFFF5F5F5),
elevation: 0.0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
padding: EdgeInsets.fromLTRB(20, 20, 20, 20),
),
),
),
SizedBox(height: 30.0),
Text(
'오늘의 일기',
Expand All @@ -120,14 +159,14 @@ class _WritingViewState extends State<WritingView> {
keyboardType: TextInputType.text,
cursorColor: Colors.black87,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 80),
contentPadding: EdgeInsets.all(20.0),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide.none,
),
filled: true),
),
SizedBox(height: 20.0,),
SizedBox(height: 40.0,),
ElevatedButton(
onPressed: () {},
child: Text(
Expand Down
144 changes: 140 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ packages:
dependency: transitive
description:
name: cross_file
sha256: "445db18de832dba8d851e287aff8ccf169bed30d2e94243cb54c7d2f1ed2142c"
sha256: "2f9d2cbccb76127ba28528cb3ae2c2326a122446a83de5a056aaa3880d3882c5"
url: "https://pub.dev"
source: hosted
version: "0.3.3+6"
version: "0.3.3+7"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -113,6 +113,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.1"
ffi:
dependency: transitive
description:
name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
file:
dependency: transitive
description:
Expand Down Expand Up @@ -166,6 +174,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_inappwebview:
dependency: transitive
description:
name: flutter_inappwebview
sha256: d198297060d116b94048301ee6749cd2e7d03c1f2689783f52d210a6b7aba350
url: "https://pub.dev"
source: hosted
version: "5.8.0"
flutter_lints:
dependency: "direct dev"
description:
Expand All @@ -192,6 +208,38 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
geocoding:
dependency: transitive
description:
name: geocoding
sha256: e1dc0ac56666d9ed1d5a9ae5543ce9eb5986db6209cc7600103487d09192059c
url: "https://pub.dev"
source: hosted
version: "2.1.1"
geocoding_android:
dependency: transitive
description:
name: geocoding_android
sha256: "609db1d71bc364dd9d0616f72a41c01e0c74f3a3807efb85e0d5a67e57baf50f"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
geocoding_ios:
dependency: transitive
description:
name: geocoding_ios
sha256: "8f79e380abb640ef4d88baee8bb65390058c802601158d0813dc990b36b189d2"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
geocoding_platform_interface:
dependency: transitive
description:
name: geocoding_platform_interface
sha256: "8848605d307d844d89937cdb4b8ad7dfa880552078f310fa24d8a460f6dddab4"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
get:
dependency: "direct main"
description:
Expand Down Expand Up @@ -360,6 +408,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.2"
kpostal:
dependency: "direct main"
description:
name: kpostal
sha256: "5036bc08669c367357a56ea1f8888fc264fd99872ac005c4b9a7a4acd5fb07b9"
url: "https://pub.dev"
source: hosted
version: "0.5.1"
lints:
dependency: transitive
description:
Expand Down Expand Up @@ -400,6 +456,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.4"
native_exif:
dependency: "direct main"
description:
name: native_exif
sha256: d8209d5884aaafd48b0194fbfd7c8a5a68cea374413ae08393e679130e9755be
url: "https://pub.dev"
source: hosted
version: "0.4.1"
package_config:
dependency: transitive
description:
Expand All @@ -416,6 +480,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.8.3"
path_provider:
dependency: "direct main"
description:
name: path_provider
sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa
url: "https://pub.dev"
source: hosted
version: "2.1.1"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72
url: "https://pub.dev"
source: hosted
version: "2.2.1"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d"
url: "https://pub.dev"
source: hosted
version: "2.3.1"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
url: "https://pub.dev"
source: hosted
version: "2.2.1"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
percent_indicator:
dependency: "direct main"
description:
Expand All @@ -432,14 +544,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "11.0.1"
platform:
dependency: transitive
description:
name: platform
sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59"
url: "https://pub.dev"
source: hosted
version: "3.1.3"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d
sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8
url: "https://pub.dev"
source: hosted
version: "2.1.6"
version: "2.1.7"
pub_semver:
dependency: transitive
description:
Expand Down Expand Up @@ -589,6 +709,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.9.5"
win32:
dependency: transitive
description:
name: win32
sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574
url: "https://pub.dev"
source: hosted
version: "5.1.1"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2"
url: "https://pub.dev"
source: hosted
version: "1.0.3"
yaml:
dependency: transitive
description:
Expand Down
3 changes: 3 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ dependencies:
get: ^4.6.6
percent_indicator: ^4.2.3
google_sign_in: ^6.1.6
kpostal: ^0.5.1
path_provider: ^2.1.1
native_exif: ^0.4.1

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 7ebbed5

Please sign in to comment.