박유빈

add README

Showing 109 changed files with 3439 additions and 0 deletions
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
# Web related
lib/generated_plugin_registrant.dart
# Symbolication related
app.*.symbols
# Obfuscation related
app.*.map.json
# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
version:
revision: 18116933e77adc82f80866c928266a5b4f1ed645
channel: stable
project_type: app
<!-- ABOUT THE PROJECT -->
## About The Project
이 프로젝트는 누군가의 창작물을 언어장벽 없이 감상하고 공유하고자 하는 웹서비스 입니다.
우리는 도구로 언어를 사용하고 있습니다. 때로는 그것이 다른 사람과 달라 정보, 마음 등이 전달되지 않을 때가 많습니다.
세계 장벽이 허물어지고 인터넷으로 소통이 가능한 사람들이 가끔은 다른 언어 때문에 다양한 생각과 정보를 얻기 어렵습니다.
이 프로젝트는 이 어려움을 깨고자 시작했습니다.
누군가의 글을 보고 영감을 얻어 여러 언어로 바꿔나가고 공유하며 다양한 시각을 가질 수 있습니다.
<p align="right">(<a href="#top">back to top</a>)</p>
## Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
### Built With
server use Node.js, Koa.js and frotend use flutter(Dart)
* [Node.js](https://nodejs.org/)
* [Koa.js](https://koajs.com/)
* [flutter](https://flutter.dev/)
<p align="right">(<a href="#top">back to top</a>)</p>
<!-- GETTING STARTED -->
## Getting Started
Go to the Server [Project folder](http://khuhub.khu.ac.kr/2018102946/likeBack), and git clone.
And go the Frontend [Project folder](http://khuhub.khu.ac.kr/2018102946/likefront)and git clone.
### Installation
(flutter web) [https://docs.flutter.dev/get-started/web]
Requirements
To create a Flutter app with web support, you need the following software:
Flutter SDK. See the [Flutter SDK](https://docs.flutter.dev/get-started/install) installation instructions.
[Chrome](https://www.google.com/chrome/); debugging a web app requires the Chrome browser.
Optional: An IDE that supports Flutter. You can install [Android Studio](https://developer.android.com/studio), IntelliJ IDEA, or Visual Studio Code and [install the Flutter and Dart plugins](https://docs.flutter.dev/get-started/editor) to enable language support and tools for refactoring, running, debugging, and reloading your web app within an editor. See setting up an editor for more details.
For more information, see the web FAQ.
1. Clone the repo
```sh
git clone http://khuhub.khu.ac.kr/2018102946/likefront.git
```
2. Install NPM packages
```sh
cd like
```
3. Run with chorme
```sh
flutter run -d chrome
```
*Build web
```sh
flutter build web
```
<p align="right">(<a href="#top">back to top</a>)</p>
\ No newline at end of file
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.
# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml
linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 30
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.like"
minSdkVersion 16
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.like">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.like">
<application
android:label="like"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
package com.example.like
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.like">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
include ':app'
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
No preview for this file type
No preview for this file type
**/dgph
*.mode1v3
*.mode2v3
*.moved-aside
*.pbxuser
*.perspectivev3
**/*sync/
.sconsign.dblite
.tags*
**/.vagrant/
**/DerivedData/
Icon?
**/Pods/
**/.symlinks/
profile
xcuserdata
**/.generated/
Flutter/App.framework
Flutter/Flutter.framework
Flutter/Flutter.podspec
Flutter/Generated.xcconfig
Flutter/ephemeral/
Flutter/app.flx
Flutter/app.zip
Flutter/flutter_assets/
Flutter/flutter_export_environment.sh
ServiceDefinitions.json
Runner/GeneratedPluginRegistrant.*
# Exceptions to above rules.
!default.mode1v3
!default.mode2v3
!default.pbxuser
!default.perspectivev3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
</dict>
</plist>
#include "Generated.xcconfig"
#include "Generated.xcconfig"
This diff is collapsed. Click to expand it.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
{
"images" : [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
# Launch Screen Assets
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
</resources>
</document>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>like</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
</dict>
</plist>
#import "GeneratedPluginRegistrant.h"
import 'package:dio/dio.dart';
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
import 'package:cookie_jar/cookie_jar.dart';
//network
var cookieJar = CookieJar();
var dio = Dio()
..options.baseUrl = "http://172.18.5.174:3000/"
..interceptors.add(CookieManager(cookieJar))
..options.receiveTimeout = 15000
..options.connectTimeout = 15000;
var strapiAddress = "http://172.18.5.174:3000/";
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:like/screens/home_page.dart';
import 'package:like/screens/login/login.dart';
import 'package:like/screens/login/signup.dart';
import 'package:like/env.dart';
void main() {
runApp(TC());
}
/*
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
*/
class TC extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'like Project',
initialRoute: '/login',
debugShowCheckedModeBanner: false,
routes: {
'/': (context) => HomePage(),
'/login': (context) => LoginPage(),
'/signup' :(context) => SignupPage(),
},
);
}
}
/*
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key? key, required this.title}) : super(key: key);
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
*/
\ No newline at end of file
File mode changed
File mode changed
import 'dart:core';
import 'package:flutter/material.dart';
import 'dart:convert';
User userFromJson(String str) => User.fromJson(json.decode(str));
String userToJson(User data) => json.encode(data.toJson());
class User {
String email;
String password;
String phone;
String token;
String username;
List<String> books;
List<String> favorite;
User(
this.email,
this.password,
this.phone,
this.token,
this.username,
this.books,
this.favorite
);
User.fromJson(Map<String, dynamic> json)
:
token = json["token"],
email=json["email"],
password= json["password"],
phone=json["phone"],
username= json["username"],
books=List<String>.from(json["books"].map((x) => x)),
favorite= List<String>.from(json["favorite"].map((x) => x));
Map<String, dynamic> toJson() => {
"email": email,
"password": password,
"phone": phone,
"username": username,
"books": List<dynamic>.from(books.map((x) => x)),
"favorite": List<dynamic>.from(favorite.map((x) => x))
};
void update(var user) {
// String username, List<String> address, String phone,
// List<String> pets, List<String> favorites
this.email = user["email"] ?? this.email;
this.username = user["nickname"] ?? this.username;
//수정필요
this.phone = user["phone"] ?? this.phone;
// this._pets =
// user["pets"] == null ? this._pets : List<String>.from(user["pets"]);
this.books = (user["books"] == null)
? this.books
: List<String>.from(user["books"]);
this.favorite = (user["favorite"] == null)
? this.favorite
: List<String>.from(user["favorite"]);
print("user update");
//notifyListeners();
}
}
//user provider
//pets provider
/*
class User with ChangeNotifier {
String _email;
String get email => _email;
set email(String email) => _email = email;
String _username;
String get username => _username;
set username(String username) => _username = username;
String _phone;
String get phone => _phone;
set phone(String phone) => _phone = phone;
List<String> _books = List<String>(5);
List<String> get _books => _pets;
List<String> _favorite = List<String>();
List<String> get favorite => _favorites;
void updatefavorite(String contentsID){
this._favorite.add(contentsID);
}
void deletefavorite(String contentsID){
this._favorite.remove(contentsID);
}
void update(var user) {
// String username, List<String> address, String phone,
// List<String> pets, List<String> favorites
this._email = user["email"] ?? this._email;
this._username = user["nickname"] ?? this._username;
//수정필요
this._phone = user["phone"] ?? this._phone;
// this._pets =
// user["pets"] == null ? this._pets : List<String>.from(user["pets"]);
this._books = (user["books"] == null)
? this._books
: List<String>.from(user["books"]);
this._favorite = (user["favorite"] == null)
? this._favorite
: List<String>.from(user["favorite"]);
print("user update");
//notifyListeners();
}
}*/
\ No newline at end of file
import 'package:like/widgets/bottom_bar.dart';
import 'package:like/widgets/carousel.dart';
import 'package:like/widgets/destination_heading.dart';
import 'package:like/widgets/explore_drawer.dart';
import 'package:like/widgets/featured_heading.dart';
import 'package:like/widgets/featured_tiles.dart';
import 'package:like/widgets/floating_quick_access_bar.dart';
import 'package:like/widgets/responsive.dart';
import 'package:like/widgets/top_bar_contents.dart';
import 'package:flutter/material.dart';
class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
final ScrollController _scrollController = ScrollController();
double _scrollPosition = 0;
double _opacity = 0;
_scrollListener() {
setState(() {
_scrollPosition = _scrollController.position.pixels;
});
}
@override
void initState() {
_scrollController.addListener(_scrollListener);
super.initState();
}
@override
Widget build(BuildContext context) {
var screenSize = MediaQuery.of(context).size;
_opacity = _scrollPosition < screenSize.height * 0.40
? _scrollPosition / (screenSize.height * 0.40)
: 1;
return Scaffold(
extendBodyBehindAppBar: true,
appBar: ResponsiveWidget.isSmallScreen(context)
? AppBar(
backgroundColor: Colors.blueGrey.shade900.withOpacity(_opacity),
elevation: 0,
title: Text(
'EXPLORE',
style: TextStyle(
color: Colors.blueGrey.shade100,
fontSize: 20,
fontFamily: 'Montserrat',
fontWeight: FontWeight.w400,
letterSpacing: 3,
),
),
)
: PreferredSize(
preferredSize: Size(screenSize.width, 1000),
child: TopBarContents(_opacity),
),
drawer: ExploreDrawer(),
body: SingleChildScrollView(
controller: _scrollController,
physics: ClampingScrollPhysics(),
child: Column(
children: [
Stack(
children: [
Container(
child: SizedBox(
height: screenSize.height * 0.45,
width: screenSize.width,
child: Image.asset(
'assets/images/cover.jpg',
fit: BoxFit.cover,
),
),
),
Column(
children: [
FloatingQuickAccessBar(screenSize: screenSize),
Container(
child: Column(
children: [
FeaturedHeading(
screenSize: screenSize,
),
FeaturedTiles(screenSize: screenSize)
],
),
),
],
)
],
),
DestinationHeading(screenSize: screenSize),
DestinationCarousel(),
SizedBox(height: screenSize.height / 10),
BottomBar(),
],
),
),
);
}
}
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class LoginPage extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _LoginPageState();
}
}
class _LoginPageState extends State<LoginPage> {
@override
void initState() {
SystemChrome.setEnabledSystemUIOverlays([]);
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: ListView(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height/3.5,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xff6bceff),
Color(0xff6bceff)
],
),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(90)
)
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Spacer(),
Align(
alignment: Alignment.center,
child: Icon(Icons.person,
size: 90,
color: Colors.white,
),
),
Spacer(),
Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: const EdgeInsets.only(
bottom: 32,
right: 32
),
child: Text('Login',
style: TextStyle(
color: Colors.white,
fontSize: 18
),
),
),
),
],
),
),
Container(
height: MediaQuery.of(context).size.height/2,
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.only(top: 62),
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width/1.2,
height: 45,
padding: EdgeInsets.only(
top: 4,left: 16, right: 16, bottom: 4
),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(50)
),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black12,
blurRadius: 5
)
]
),
child: TextField(
decoration: InputDecoration(
border: InputBorder.none,
icon: Icon(Icons.person,
color: Color(0xff6bceff),
),
hintText: 'Username',
),
),
),
Container(
width: MediaQuery.of(context).size.width/1.2,
height: 45,
margin: EdgeInsets.only(top: 32),
padding: EdgeInsets.only(
top: 4,left: 16, right: 16, bottom: 4
),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(50)
),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black12,
blurRadius: 5
)
]
),
child: TextField(
obscureText: true,
decoration: InputDecoration(
border: InputBorder.none,
icon: Icon(Icons.vpn_key,
color: Color(0xff6bceff),
),
hintText: 'Password',
),
),
),
Align(
alignment: Alignment.centerRight,
child: Padding(
padding: const EdgeInsets.only(
top: 16, right: 32
),
child: Text('Forgot Password ?',
style: TextStyle(
color: Colors.grey
),
),
),
),
Spacer(),
InkWell(
onTap: (){
Navigator.pushNamed(context, '/');
},
child: Container(
height: 45,
width: MediaQuery.of(context).size.width/1.2,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Color(0xff6bceff),
Color(0xFF00abff),
],
),
borderRadius: BorderRadius.all(
Radius.circular(50)
)
),
child: Center(
child: Text('Login'.toUpperCase(),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold
),
),
),
),
),
],
),
),
SizedBox(
height: 50,
),
InkWell(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("Dnon't have an account ?"),
Text("Sign Up",style: TextStyle(color: Color(0xff6bceff)),),
],
),
onTap: (){
Navigator.pushNamed(context, '/signup');
},
),
],
),
),
);
}
}
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class SignupPage extends StatefulWidget {
@override
_SignupPageState createState() => _SignupPageState();
}
class _SignupPageState extends State<SignupPage> {
@override
void initState() {
SystemChrome.setEnabledSystemUIOverlays([]);
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: ListView(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height/3.5,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xff6bceff),
Color(0xff6bceff)
],
),
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(90)
)
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Spacer(),
Align(
alignment: Alignment.center,
child: Icon(Icons.person,
size: 90,
color: Colors.white,
),
),
Spacer(),
Align(
alignment: Alignment.bottomRight,
child: Padding(
padding: const EdgeInsets.only(
bottom: 32,
right: 32
),
child: Text('Sign Up',
style: TextStyle(
color: Colors.white,
fontSize: 18
),
),
),
),
],
),
),
Container(
height: MediaQuery.of(context).size.height/2,
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.only(top: 62),
child: Column(
children: <Widget>[
Container(
width: MediaQuery.of(context).size.width/1.2,
height: 45,
padding: EdgeInsets.only(
top: 4,left: 16, right: 16, bottom: 4
),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(50)
),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black12,
blurRadius: 5
)
]
),
child: TextField(
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Full Name',
),
),
),
SizedBox(
height: 5,
),
Container(
width: MediaQuery.of(context).size.width/1.2,
height: 45,
padding: EdgeInsets.only(
top: 4,left: 16, right: 16, bottom: 4
),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(50)
),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black12,
blurRadius: 5
)
]
),
child: TextField(
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Username',
),
),
),
SizedBox(
height: 5,
),
Container(
width: MediaQuery.of(context).size.width/1.2,
height: 45,
padding: EdgeInsets.only(
top: 4,left: 16, right: 16, bottom: 4
),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(50)
),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black12,
blurRadius: 5
)
]
),
child: TextField(
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Email',
),
),
),
SizedBox(
height: 5,
),
Container(
width: MediaQuery.of(context).size.width/1.2,
height: 45,
padding: EdgeInsets.only(
top: 4,left: 16, right: 16, bottom: 4
),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(50)
),
color: Colors.white,
boxShadow: [
BoxShadow(
color: Colors.black12,
blurRadius: 5
)
]
),
child: TextField(
obscureText: true,
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Password',
),
),
),
SizedBox(
height: 15,
),
InkWell(
onTap: (){
Navigator.pushNamed(context, '/');
},
child: Container(
height: 45,
width: MediaQuery.of(context).size.width/1.2,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Color(0xff6bceff),
Color(0xFF00abff),
],
),
borderRadius: BorderRadius.all(
Radius.circular(50)
)
),
child: Center(
child: Text('Sign Up'.toUpperCase(),
style: TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold
),
),
),
),
),
],
),
),
InkWell(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("Have an account ?"),
Text("Login",style: TextStyle(color: Color(0xff6bceff)),),
],
),
onTap: (){
Navigator.pop(context);
},
),
],
),
),
);
}
}
\ No newline at end of file
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
final FirebaseAuth _auth = FirebaseAuth.instance;
final GoogleSignIn googleSignIn = GoogleSignIn();
String? uid;
String? name;
String? userEmail;
String? imageUrl;
/// For checking if the user is already signed into the
/// app using Google Sign In
Future getUser() async {
await Firebase.initializeApp();
SharedPreferences prefs = await SharedPreferences.getInstance();
bool authSignedIn = prefs.getBool('auth') ?? false;
final User? user = _auth.currentUser;
if (authSignedIn == true) {
if (user != null) {
uid = user.uid;
name = user.displayName;
userEmail = user.email;
imageUrl = user.photoURL;
}
}
}
/// For authenticating user using Google Sign In
/// with Firebase Authentication API.
///
/// Retrieves some general user related information
/// from their Google account for ease of the login process
Future<User?> signInWithGoogle() async {
await Firebase.initializeApp();
User? user;
if (kIsWeb) {
GoogleAuthProvider authProvider = GoogleAuthProvider();
try {
final UserCredential userCredential =
await _auth.signInWithPopup(authProvider);
user = userCredential.user;
} catch (e) {
print(e);
}
} else {
final GoogleSignIn googleSignIn = GoogleSignIn();
final GoogleSignInAccount? googleSignInAccount =
await googleSignIn.signIn();
if (googleSignInAccount != null) {
final GoogleSignInAuthentication googleSignInAuthentication =
await googleSignInAccount.authentication;
final AuthCredential credential = GoogleAuthProvider.credential(
accessToken: googleSignInAuthentication.accessToken,
idToken: googleSignInAuthentication.idToken,
);
try {
final UserCredential userCredential =
await _auth.signInWithCredential(credential);
user = userCredential.user;
} on FirebaseAuthException catch (e) {
if (e.code == 'account-exists-with-different-credential') {
print('The account already exists with a different credential.');
} else if (e.code == 'invalid-credential') {
print('Error occurred while accessing credentials. Try again.');
}
} catch (e) {
print(e);
}
}
}
if (user != null) {
uid = user.uid;
name = user.displayName;
userEmail = user.email;
imageUrl = user.photoURL;
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setBool('auth', true);
}
return user;
}
Future<User?> registerWithEmailPassword(String email, String password) async {
await Firebase.initializeApp();
User? user;
try {
UserCredential userCredential = await _auth.createUserWithEmailAndPassword(
email: email,
password: password,
);
user = userCredential.user;
if (user != null) {
uid = user.uid;
userEmail = user.email;
}
} on FirebaseAuthException catch (e) {
if (e.code == 'weak-password') {
print('The password provided is too weak.');
} else if (e.code == 'email-already-in-use') {
print('The account already exists for that email.');
}
} catch (e) {
print(e);
}
return user;
}
Future<User?> signInWithEmailPassword(String email, String password) async {
await Firebase.initializeApp();
User? user;
try {
UserCredential userCredential = await _auth.signInWithEmailAndPassword(
email: email,
password: password,
);
user = userCredential.user;
if (user != null) {
uid = user.uid;
userEmail = user.email;
SharedPreferences prefs = await SharedPreferences.getInstance();
await prefs.setBool('auth', true);
}
} on FirebaseAuthException catch (e) {
if (e.code == 'user-not-found') {
print('No user found for that email.');
} else if (e.code == 'wrong-password') {
print('Wrong password provided.');
}
}
return user;
}
Future<String> signOut() async {
await _auth.signOut();
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setBool('auth', false);
uid = null;
userEmail = null;
return 'User signed out';
}
/// For signing out of their Google account
void signOutGoogle() async {
await googleSignIn.signOut();
await _auth.signOut();
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setBool('auth', false);
uid = null;
name = null;
userEmail = null;
imageUrl = null;
print("User signed out of Google account");
}
import 'package:flutter/material.dart';
var lightThemeData = ThemeData(
primarySwatch: Colors.blueGrey,
backgroundColor: Colors.white,
cardColor: Colors.blueGrey[50],
primaryTextTheme: TextTheme(
button: TextStyle(
color: Colors.blueGrey,
decorationColor: Colors.blueGrey[300],
),
subtitle2: TextStyle(
color: Colors.blueGrey[900],
),
subtitle1: TextStyle(
color: Colors.black,
),
headline1: TextStyle(color: Colors.blueGrey[800]),
),
bottomAppBarColor: Colors.blueGrey[900],
iconTheme: IconThemeData(color: Colors.blueGrey),
brightness: Brightness.light,
);
var darkThemeData = ThemeData(
primarySwatch: Colors.blueGrey,
backgroundColor: Colors.blueGrey[900],
cardColor: Colors.black,
primaryTextTheme: TextTheme(
button: TextStyle(
color: Colors.blueGrey[200],
decorationColor: Colors.blueGrey[50],
),
subtitle2: TextStyle(
color: Colors.white,
),
subtitle1: TextStyle(
color: Colors.blueGrey[300],
),
headline1: TextStyle(
color: Colors.white70,
),
),
bottomAppBarColor: Colors.black,
iconTheme: IconThemeData(color: Colors.blueGrey[200]),
brightness: Brightness.dark,
);
This diff is collapsed. Click to expand it.
import 'package:like/widgets/bottom_bar_column.dart';
import 'package:like/widgets/info_text.dart';
import 'package:like/widgets/responsive.dart';
import 'package:flutter/material.dart';
class BottomBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(30),
color: Theme.of(context).bottomAppBarColor,
child: ResponsiveWidget.isSmallScreen(context)
? Column(
children: [
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
BottomBarColumn(
heading: 'ABOUT',
s1: 'Contact Us',
s2: 'About Us',
s3: 'Careers',
),
BottomBarColumn(
heading: 'HELP',
s1: 'Payment',
s2: 'Cancellation',
s3: 'FAQ',
),
BottomBarColumn(
heading: 'SOCIAL',
s1: 'Twitter',
s2: 'Facebook',
s3: 'YouTube',
),
],
),
Container(
color: Colors.blueGrey,
width: double.maxFinite,
height: 1,
),
SizedBox(height: 20),
InfoText(
type: 'Email',
text: 'explore@gmail.com',
),
SizedBox(height: 5),
InfoText(
type: 'Address',
text: '128, Trymore Road, Delft, MN - 56124',
),
SizedBox(height: 20),
Container(
color: Colors.blueGrey,
width: double.maxFinite,
height: 1,
),
SizedBox(height: 20),
Text(
'Copyright © 2020 | EXPLORE',
style: TextStyle(
color: Colors.blueGrey[300],
fontSize: 14,
),
),
],
)
: Column(
children: [
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
BottomBarColumn(
heading: 'ABOUT',
s1: 'Contact Us',
s2: 'About Us',
s3: 'Careers',
),
BottomBarColumn(
heading: 'HELP',
s1: 'Payment',
s2: 'Cancellation',
s3: 'FAQ',
),
BottomBarColumn(
heading: 'SOCIAL',
s1: 'Twitter',
s2: 'Facebook',
s3: 'YouTube',
),
Container(
color: Colors.blueGrey,
width: 2,
height: 150,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InfoText(
type: 'Email',
text: 'explore@gmail.com',
),
SizedBox(height: 5),
InfoText(
type: 'Address',
text: '128, Trymore Road, Delft, MN - 56124',
)
],
),
],
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
color: Colors.blueGrey,
width: double.maxFinite,
height: 1,
),
),
],
),
);
}
}
import 'package:flutter/material.dart';
class BottomBarColumn extends StatelessWidget {
final String heading;
final String s1;
final String s2;
final String s3;
BottomBarColumn({
required this.heading,
required this.s1,
required this.s2,
required this.s3,
});
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.only(bottom: 20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
heading,
style: TextStyle(
color: Colors.blueGrey[300],
fontSize: 18,
fontWeight: FontWeight.w500,
),
),
SizedBox(
height: 10,
),
Text(
s1,
style: TextStyle(
color: Colors.blueGrey[100],
fontSize: 14,
),
),
SizedBox(height: 5),
Text(
s2,
style: TextStyle(
color: Colors.blueGrey[100],
fontSize: 14,
),
),
SizedBox(height: 5),
Text(
s3,
style: TextStyle(
color: Colors.blueGrey[100],
fontSize: 14,
),
),
],
),
);
}
}
import 'package:carousel_slider/carousel_slider.dart';
import 'package:like/widgets/responsive.dart';
import 'package:flutter/material.dart';
class DestinationCarousel extends StatefulWidget {
@override
_DestinationCarouselState createState() => _DestinationCarouselState();
}
class _DestinationCarouselState extends State<DestinationCarousel> {
final String imagePath = 'assets/images/';
final CarouselController _controller = CarouselController();
List _isHovering = [false, false, false, false, false, false, false];
List _isSelected = [true, false, false, false, false, false, false];
int _current = 0;
final List<String> images = [
'assets/images/asia.jpg',
'assets/images/africa.jpg',
'assets/images/europe.jpg',
'assets/images/south_america.jpg',
'assets/images/australia.jpg',
'assets/images/antarctica.jpg',
];
final List<String> places = [
'ASIA',
'AFRICA',
'EUROPE',
'SOUTH AMERICA',
'AUSTRALIA',
'ANTARCTICA',
];
List<Widget> generateImageTiles(screenSize) {
return images
.map(
(element) => ClipRRect(
borderRadius: BorderRadius.circular(8.0),
child: Image.asset(
element,
fit: BoxFit.cover,
),
),
)
.toList();
}
@override
Widget build(BuildContext context) {
var screenSize = MediaQuery.of(context).size;
var imageSliders = generateImageTiles(screenSize);
return Stack(
children: [
CarouselSlider(
items: imageSliders,
options: CarouselOptions(
scrollPhysics: ResponsiveWidget.isSmallScreen(context)
? PageScrollPhysics()
: NeverScrollableScrollPhysics(),
enlargeCenterPage: true,
aspectRatio: 18 / 8,
autoPlay: true,
onPageChanged: (index, reason) {
setState(() {
_current = index;
for (int i = 0; i < imageSliders.length; i++) {
if (i == index) {
_isSelected[i] = true;
} else {
_isSelected[i] = false;
}
}
});
}),
carouselController: _controller,
),
AspectRatio(
aspectRatio: 18 / 8,
child: Center(
child: Text(
places[_current],
style: TextStyle(
letterSpacing: 8,
fontFamily: 'Electrolize',
fontSize: screenSize.width / 25,
color: Colors.white,
),
),
),
),
ResponsiveWidget.isSmallScreen(context)
? Container()
: AspectRatio(
aspectRatio: 17 / 8,
child: Center(
heightFactor: 1,
child: Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: EdgeInsets.only(
left: screenSize.width / 8,
right: screenSize.width / 8,
),
child: Card(
elevation: 5,
child: Padding(
padding: EdgeInsets.only(
top: screenSize.height / 50,
bottom: screenSize.height / 50,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
for (int i = 0; i < places.length; i++)
Column(
mainAxisSize: MainAxisSize.min,
children: [
InkWell(
splashColor: Colors.blueGrey,
hoverColor: Colors.transparent,
onHover: (value) {
setState(() {
value
? _isHovering[i] = true
: _isHovering[i] = false;
});
},
onTap: () {
_controller.animateToPage(i);
},
child: Padding(
padding: EdgeInsets.only(
top: screenSize.height / 80,
bottom: screenSize.height / 90),
child: Text(
places[i],
style: TextStyle(
color: _isHovering[i]
? Theme.of(context)
.primaryTextTheme
.button!
.decorationColor
: Theme.of(context)
.primaryTextTheme
.button!
.decorationColor,
),
),
),
),
Visibility(
maintainSize: true,
maintainAnimation: true,
maintainState: true,
visible: _isSelected[i],
child: AnimatedOpacity(
duration: Duration(milliseconds: 400),
opacity: _isSelected[i] ? 1 : 0,
child: Container(
height: 5,
decoration: BoxDecoration(
color: Colors.blueGrey,
borderRadius: BorderRadius.all(
Radius.circular(10),
),
),
width: screenSize.width / 10,
),
),
)
],
),
],
),
),
),
),
),
),
),
],
);
}
}
import 'package:like/widgets/responsive.dart';
import 'package:flutter/material.dart';
class DestinationHeading extends StatelessWidget {
const DestinationHeading({
Key? key,
required this.screenSize,
}) : super(key: key);
final Size screenSize;
@override
Widget build(BuildContext context) {
return ResponsiveWidget.isSmallScreen(context)
? Container(
padding: EdgeInsets.only(
top: screenSize.height / 20,
bottom: screenSize.height / 20,
),
width: screenSize.width,
// color: Colors.black,
child: Text(
'Destinations diversity',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 24,
fontFamily: 'Montserrat',
fontWeight: FontWeight.bold,
),
),
)
: Container(
padding: EdgeInsets.only(
top: screenSize.height / 10,
bottom: screenSize.height / 15,
),
width: screenSize.width,
// color: Colors.black,
child: Text(
'Destinations diversity',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 40,
fontFamily: 'Montserrat',
fontWeight: FontWeight.bold,
),
),
);
}
}
import 'package:like/screens/home_page.dart';
import 'package:like/utils/authentication.dart';
import 'package:flutter/material.dart';
import 'auth_dialog.dart';
class ExploreDrawer extends StatefulWidget {
const ExploreDrawer({
Key? key,
}) : super(key: key);
@override
_ExploreDrawerState createState() => _ExploreDrawerState();
}
class _ExploreDrawerState extends State<ExploreDrawer> {
bool _isProcessing = false;
@override
Widget build(BuildContext context) {
return Drawer(
child: Container(
color: Theme.of(context).bottomAppBarColor,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
userEmail == null
? Container(
width: double.maxFinite,
child: TextButton(
// color: Colors.black,
// hoverColor: Colors.blueGrey[800],
// highlightColor: Colors.blueGrey[700],
style: TextButton.styleFrom(
primary: Colors.black,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
),
onPressed: () {
showDialog(
context: context,
builder: (context) => AuthDialog(),
);
},
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(15),
// ),
child: Padding(
padding: EdgeInsets.only(
top: 15.0,
bottom: 15.0,
),
child: Text(
'Sign in',
style: TextStyle(
fontSize: 20,
color: Colors.white,
),
),
),
),
)
: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
CircleAvatar(
radius: 20,
backgroundImage:
imageUrl != null ? NetworkImage(imageUrl!) : null,
child: imageUrl == null
? Icon(
Icons.account_circle,
size: 40,
)
: Container(),
),
SizedBox(width: 10),
Text(
name ?? userEmail!,
style: TextStyle(
fontSize: 20,
color: Colors.white70,
),
)
],
),
SizedBox(height: 20),
userEmail != null
? Container(
width: double.maxFinite,
child: TextButton(
// color: Colors.black,
// hoverColor: Colors.blueGrey[800],
// highlightColor: Colors.blueGrey[700],
style: TextButton.styleFrom(
primary: Colors.black,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
),
onPressed: _isProcessing
? null
: () async {
setState(() {
_isProcessing = true;
});
await signOut().then((result) {
print(result);
Navigator.of(context).pushReplacement(
MaterialPageRoute(
fullscreenDialog: true,
builder: (context) => HomePage(),
),
);
}).catchError((error) {
print('Sign Out Error: $error');
});
setState(() {
_isProcessing = false;
});
},
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(15),
// ),
child: Padding(
padding: EdgeInsets.only(
top: 15.0,
bottom: 15.0,
),
child: _isProcessing
? CircularProgressIndicator()
: Text(
'Sign out',
style: TextStyle(
fontSize: 20,
color: Colors.white,
),
),
),
),
)
: Container(),
userEmail != null ? SizedBox(height: 20) : Container(),
InkWell(
onTap: () {},
child: Text(
'Discover',
style: TextStyle(color: Colors.white, fontSize: 22),
),
),
Padding(
padding: const EdgeInsets.only(top: 5.0, bottom: 5.0),
child: Divider(
color: Colors.blueGrey[400],
thickness: 2,
),
),
InkWell(
onTap: () {},
child: Text(
'Contact Us',
style: TextStyle(color: Colors.white, fontSize: 22),
),
),
Expanded(
child: Align(
alignment: Alignment.bottomCenter,
child: Text(
'Copyright © 2020 | EXPLORE',
style: TextStyle(
color: Colors.blueGrey[300],
fontSize: 14,
),
),
),
)
],
),
),
),
);
}
}
import 'package:like/widgets/responsive.dart';
import 'package:flutter/material.dart';
class FeaturedHeading extends StatelessWidget {
const FeaturedHeading({
Key? key,
required this.screenSize,
}) : super(key: key);
final Size screenSize;
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.only(
top: screenSize.height * 0.06,
left: screenSize.width / 15,
right: screenSize.width / 15,
),
child: ResponsiveWidget.isSmallScreen(context)
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Row(),
Text(
'Featured',
style: TextStyle(
fontSize: 24,
fontFamily: 'Montserrat',
fontWeight: FontWeight.bold,
),
),
SizedBox(height: 5),
Text(
'Unique wildlife tours & destinations',
textAlign: TextAlign.end,
style: Theme.of(context).primaryTextTheme.subtitle1,
),
SizedBox(height: 10),
],
)
: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
'Featured',
style: TextStyle(
fontSize: 40,
fontFamily: 'Montserrat',
fontWeight: FontWeight.bold,
),
),
Expanded(
child: Text(
'Unique wildlife tours & destinations',
textAlign: TextAlign.end,
style: Theme.of(context).primaryTextTheme.subtitle1,
),
),
],
),
);
}
}
import 'package:like/widgets/responsive.dart';
import 'package:flutter/material.dart';
class FeaturedTiles extends StatelessWidget {
FeaturedTiles({
Key? key,
required this.screenSize,
}) : super(key: key);
final Size screenSize;
final List<String> assets = [
'assets/images/trekking.jpg',
'assets/images/animals.jpg',
'assets/images/photography.jpeg',
];
final List<String> title = ['Trekking', 'Animals', 'Photography'];
@override
Widget build(BuildContext context) {
return ResponsiveWidget.isSmallScreen(context)
? Padding(
padding: EdgeInsets.only(top: screenSize.height / 50),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(width: screenSize.width / 15),
...Iterable<int>.generate(assets.length).map(
(int pageIndex) => Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: screenSize.width / 2.5,
width: screenSize.width / 1.5,
child: ClipRRect(
borderRadius: BorderRadius.circular(5.0),
child: Image.asset(
assets[pageIndex],
fit: BoxFit.cover,
),
),
),
Padding(
padding: EdgeInsets.only(
top: screenSize.height / 70,
),
child: Text(
title[pageIndex],
style: TextStyle(
fontSize: 16,
fontFamily: 'Montserrat',
fontWeight: FontWeight.w500,
color: Theme.of(context)
.primaryTextTheme
.subtitle1!
.color,
),
),
),
],
),
SizedBox(width: screenSize.width / 15),
],
),
),
],
),
),
)
: Padding(
padding: EdgeInsets.only(
top: screenSize.height * 0.06,
left: screenSize.width / 15,
right: screenSize.width / 15,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
...Iterable<int>.generate(assets.length).map(
(int pageIndex) => Column(
children: [
SizedBox(
height: screenSize.width / 6,
width: screenSize.width / 3.8,
child: ClipRRect(
borderRadius: BorderRadius.circular(5.0),
child: Image.asset(
assets[pageIndex],
fit: BoxFit.cover,
),
),
),
Padding(
padding: EdgeInsets.only(
top: screenSize.height / 70,
),
child: Text(
title[pageIndex],
style: TextStyle(
fontSize: 16,
fontFamily: 'Montserrat',
fontWeight: FontWeight.w500,
color: Theme.of(context)
.primaryTextTheme
.subtitle1!
.color,
),
),
),
],
),
),
],
),
);
}
}
import 'package:like/widgets/responsive.dart';
import 'package:flutter/material.dart';
class FloatingQuickAccessBar extends StatefulWidget {
const FloatingQuickAccessBar({
Key? key,
required this.screenSize,
}) : super(key: key);
final Size screenSize;
@override
_FloatingQuickAccessBarState createState() => _FloatingQuickAccessBarState();
}
class _FloatingQuickAccessBarState extends State<FloatingQuickAccessBar> {
List _isHovering = [false, false, false, false];
List<Widget> rowElements = [];
List<String> items = ['Destination', 'Dates', 'People', 'Experience'];
List<IconData> icons = [
Icons.location_on,
Icons.date_range,
Icons.people,
Icons.wb_sunny
];
List<Widget> generateRowElements() {
rowElements.clear();
for (int i = 0; i < items.length; i++) {
Widget elementTile = InkWell(
splashColor: Colors.transparent,
hoverColor: Colors.transparent,
onHover: (value) {
setState(() {
value ? _isHovering[i] = true : _isHovering[i] = false;
});
},
onTap: () {},
child: Text(
items[i],
style: TextStyle(
color: _isHovering[i]
? Theme.of(context).primaryTextTheme.button!.decorationColor
: Theme.of(context).primaryTextTheme.button!.decorationColor,
),
),
);
Widget spacer = SizedBox(
height: widget.screenSize.height / 20,
child: VerticalDivider(
width: 1,
color: Colors.blueGrey[100],
thickness: 1,
),
);
rowElements.add(elementTile);
if (i < items.length - 1) {
rowElements.add(spacer);
}
}
return rowElements;
}
@override
Widget build(BuildContext context) {
return Center(
heightFactor: 1,
child: Padding(
padding: EdgeInsets.only(
top: widget.screenSize.height * 0.40,
left: ResponsiveWidget.isSmallScreen(context)
? widget.screenSize.width / 12
: widget.screenSize.width / 5,
right: ResponsiveWidget.isSmallScreen(context)
? widget.screenSize.width / 12
: widget.screenSize.width / 5,
),
child: ResponsiveWidget.isSmallScreen(context)
? Column(
children: [
...Iterable<int>.generate(items.length).map(
(int pageIndex) => Padding(
padding:
EdgeInsets.only(top: widget.screenSize.height / 80),
child: Card(
color: Theme.of(context).cardColor,
elevation: 4,
child: Padding(
padding: EdgeInsets.only(
top: widget.screenSize.height / 45,
bottom: widget.screenSize.height / 45,
left: widget.screenSize.width / 20),
child: Row(
children: [
Icon(
icons[pageIndex],
color: Theme.of(context).iconTheme.color,
),
SizedBox(width: widget.screenSize.width / 20),
InkWell(
splashColor: Colors.transparent,
hoverColor: Colors.transparent,
onTap: () {},
child: Text(
items[pageIndex],
style: TextStyle(
color: Theme.of(context)
.primaryTextTheme
.button!
.color,
fontSize: 16),
),
),
],
),
),
),
),
),
],
)
: Card(
elevation: 5,
child: Padding(
padding: EdgeInsets.only(
top: widget.screenSize.height / 50,
bottom: widget.screenSize.height / 50,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: generateRowElements(),
),
),
),
),
);
}
}
import 'package:like/screens/home_page.dart';
//import 'package:like/utils/authentication.dart';
import 'package:flutter/material.dart';
class GoogleButton extends StatefulWidget {
@override
_GoogleButtonState createState() => _GoogleButtonState();
}
class _GoogleButtonState extends State<GoogleButton> {
bool _isProcessing = false;
@override
Widget build(BuildContext context) {
return DecoratedBox(
decoration: ShapeDecoration(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
side: BorderSide(color: Colors.blueGrey, width: 3),
),
color: Colors.white,
),
child: OutlinedButton(
style: OutlinedButton.styleFrom(
primary: Colors.blueGrey.shade100,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
side: BorderSide(color: Colors.blueGrey, width: 3),
),
elevation: 0,
),
onPressed: () async {
setState(() {
_isProcessing = true;
});
/*await signInWithGoogle().then((result) {
print(result);
if (result != null) {
Navigator.of(context).pop();
Navigator.of(context).pushReplacement(
MaterialPageRoute(
fullscreenDialog: true,
builder: (context) => HomePage(),
),
);
}
}).catchError((error) {
print('Registration Error: $error');
});
setState(() {
_isProcessing = false;
});*/
},
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 10, 0, 10),
child: _isProcessing
? CircularProgressIndicator(
valueColor: new AlwaysStoppedAnimation<Color>(
Colors.blueGrey,
),
)
: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Image(
image: AssetImage("assets/images/google_logo.png"),
height: 30.0,
),
Padding(
padding: const EdgeInsets.only(left: 20),
child: Text(
'Continue with Google',
style: TextStyle(
fontSize: 20,
color: Colors.blueGrey,
),
),
)
],
),
),
),
);
}
}
import 'package:flutter/material.dart';
class InfoText extends StatelessWidget {
final String type;
final String text;
InfoText({required this.type, required this.text});
@override
Widget build(BuildContext context) {
return Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'$type: ',
style: TextStyle(
color: Colors.blueGrey[300],
fontSize: 16,
),
),
Flexible(
child: Text(
text,
style: TextStyle(
color: Colors.blueGrey[100],
fontSize: 16,
),
),
)
],
);
}
}
import 'package:flutter/material.dart';
class ResponsiveWidget extends StatelessWidget {
final Widget largeScreen;
final Widget? mediumScreen;
final Widget? smallScreen;
const ResponsiveWidget(
{Key? key,
required this.largeScreen,
this.mediumScreen,
this.smallScreen})
: super(key: key);
static bool isSmallScreen(BuildContext context) {
return MediaQuery.of(context).size.width < 800;
}
static bool isLargeScreen(BuildContext context) {
return MediaQuery.of(context).size.width > 1200;
}
static bool isMediumScreen(BuildContext context) {
return MediaQuery.of(context).size.width >= 800 &&
MediaQuery.of(context).size.width <= 1200;
}
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, constraints) {
if (constraints.maxWidth > 1200) {
return largeScreen;
} else if (constraints.maxWidth <= 1200 &&
constraints.maxWidth >= 800) {
return mediumScreen ?? largeScreen;
} else {
return smallScreen ?? largeScreen;
}
},
);
}
}
import 'package:easy_dynamic_theme/easy_dynamic_theme.dart';
import 'package:like/screens/home_page.dart';
import 'package:like/utils/authentication.dart';
import 'package:like/widgets/auth_dialog.dart';
import 'package:flutter/material.dart';
class TopBarContents extends StatefulWidget {
final double opacity;
TopBarContents(this.opacity);
@override
_TopBarContentsState createState() => _TopBarContentsState();
}
class _TopBarContentsState extends State<TopBarContents> {
final List _isHovering = [
false,
false,
false,
false,
false,
false,
false,
false
];
bool _isProcessing = false;
@override
Widget build(BuildContext context) {
var screenSize = MediaQuery.of(context).size;
return PreferredSize(
preferredSize: Size(screenSize.width, 1000),
child: Container(
color: Theme.of(context).bottomAppBarColor.withOpacity(widget.opacity),
child: Padding(
padding: EdgeInsets.all(20),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'EXPLORE',
style: TextStyle(
color: Colors.blueGrey[100],
fontSize: 20,
fontFamily: 'Montserrat',
fontWeight: FontWeight.w400,
letterSpacing: 3,
),
),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(width: screenSize.width / 8),
InkWell(
onHover: (value) {
setState(() {
value
? _isHovering[0] = true
: _isHovering[0] = false;
});
},
onTap: () {},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Discover',
style: TextStyle(
color: _isHovering[0]
? Colors.blue[200]
: Colors.white,
),
),
SizedBox(height: 5),
Visibility(
maintainAnimation: true,
maintainState: true,
maintainSize: true,
visible: _isHovering[0],
child: Container(
height: 2,
width: 20,
color: Colors.white,
),
)
],
),
),
SizedBox(width: screenSize.width / 20),
InkWell(
onHover: (value) {
setState(() {
value
? _isHovering[1] = true
: _isHovering[1] = false;
});
},
onTap: () {},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Contact Us',
style: TextStyle(
color: _isHovering[1]
? Colors.blue[200]
: Colors.white,
),
),
SizedBox(height: 5),
Visibility(
maintainAnimation: true,
maintainState: true,
maintainSize: true,
visible: _isHovering[1],
child: Container(
height: 2,
width: 20,
color: Colors.white,
),
)
],
),
),
],
),
),
IconButton(
icon: Icon(Icons.brightness_6),
splashColor: Colors.transparent,
highlightColor: Colors.transparent,
color: Colors.white,
onPressed: () {
EasyDynamicTheme.of(context).changeTheme();
},
),
SizedBox(
width: screenSize.width / 50,
),
InkWell(
onHover: (value) {
setState(() {
value ? _isHovering[3] = true : _isHovering[3] = false;
});
},
onTap: userEmail == null
? () {
showDialog(
context: context,
builder: (context) => AuthDialog(),
);
}
: null,
child: userEmail == null
? Text(
'Sign in',
style: TextStyle(
color: _isHovering[3] ? Colors.white : Colors.white70,
),
)
: Row(
children: [
CircleAvatar(
radius: 15,
backgroundImage: imageUrl != null
? NetworkImage(imageUrl!)
: null,
child: imageUrl == null
? Icon(
Icons.account_circle,
size: 30,
)
: Container(),
),
SizedBox(width: 5),
Text(
name ?? userEmail!,
style: TextStyle(
color: _isHovering[3]
? Colors.white
: Colors.white70,
),
),
SizedBox(width: 10),
TextButton(
style: TextButton.styleFrom(
primary: Colors.blueGrey,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
),
onPressed: _isProcessing
? null
: () async {
setState(() {
_isProcessing = true;
});
await signOut().then((result) {
print(result);
Navigator.of(context).pushReplacement(
MaterialPageRoute(
fullscreenDialog: true,
builder: (context) => HomePage(),
),
);
}).catchError((error) {
print('Sign Out Error: $error');
});
setState(() {
_isProcessing = false;
});
},
child: Padding(
padding: EdgeInsets.only(
top: 8.0,
bottom: 8.0,
),
child: _isProcessing
? CircularProgressIndicator()
: Text(
'Sign out',
style: TextStyle(
fontSize: 14,
color: Colors.white,
),
),
),
)
],
),
),
],
),
),
),
);
}
}
import 'dart:async';
import 'package:flutter/material.dart';
class WebScrollbar extends StatefulWidget {
final Widget child;
final ScrollController controller;
final double heightFraction;
final double width;
final Color color;
final Color backgroundColor;
final bool isAlwaysShown;
WebScrollbar({
required this.child,
required this.controller,
this.heightFraction = 0.20,
this.width = 8,
this.color = Colors.black45,
this.backgroundColor = Colors.black12,
this.isAlwaysShown = false,
}) : assert(heightFraction < 1.0 && heightFraction > 0.0);
@override
_WebScrollbarState createState() => _WebScrollbarState();
}
class _WebScrollbarState extends State<WebScrollbar> {
double _scrollPosition = 0;
late bool _isUpdating;
late Timer timer;
_scrollListener() {
setState(() {
_scrollPosition = widget.controller.position.pixels;
});
}
@override
void initState() {
widget.controller.addListener(_scrollListener);
_isUpdating = false;
super.initState();
}
@override
Widget build(BuildContext context) {
var screenSize = MediaQuery.of(context).size;
double _scrollerHeight = screenSize.height * widget.heightFraction;
double _topMargin = widget.controller.hasClients
? ((screenSize.height *
_scrollPosition /
widget.controller.position.maxScrollExtent) -
(_scrollerHeight *
_scrollPosition /
widget.controller.position.maxScrollExtent))
: 0;
return NotificationListener<ScrollNotification>(
onNotification: (notification) {
if (notification.depth == 0) {
if (notification is ScrollUpdateNotification) {
timer.cancel();
setState(() {
_isUpdating = true;
});
} else {
timer = Timer(Duration(seconds: 5), () {
setState(() {
_isUpdating = false;
});
});
}
}
return true;
},
child: Stack(
children: [
widget.child,
AnimatedOpacity(
opacity: widget.isAlwaysShown
? 1
: widget.controller.hasClients
? _isUpdating
? 1
: 0
: 0,
duration: Duration(milliseconds: 300),
child: Container(
alignment: Alignment.centerRight,
height: MediaQuery.of(context).size.height,
width: widget.width + 2,
margin: EdgeInsets.only(
left: MediaQuery.of(context).size.width - widget.width + 2,
),
color: widget.backgroundColor,
child: Align(
alignment: Alignment.topCenter,
child: GestureDetector(
child: Container(
height: _scrollerHeight,
width: widget.width,
margin: EdgeInsets.only(
left: 1.0,
right: 1.0,
top: _topMargin,
),
decoration: BoxDecoration(
color: widget.color,
borderRadius: BorderRadius.all(
Radius.circular(3.0),
),
),
),
onTapCancel: () {
timer = Timer(Duration(seconds: 5), () {
setState(() {
_isUpdating = false;
});
});
},
onTapDown: (details) {
timer.cancel();
setState(() {
_isUpdating = true;
});
},
onVerticalDragUpdate: (dragUpdate) {
widget.controller.position.moveTo(dragUpdate
.globalPosition.dy +
dragUpdate.globalPosition.dy *
(_scrollPosition /
widget.controller.position.maxScrollExtent) -
(_scrollerHeight *
_scrollPosition /
widget.controller.position.maxScrollExtent));
setState(() {
if (dragUpdate.globalPosition.dy >= 0 &&
_scrollPosition <=
widget.controller.position.maxScrollExtent) {
_scrollPosition = dragUpdate.globalPosition.dy +
dragUpdate.globalPosition.dy *
(_scrollPosition /
widget
.controller.position.maxScrollExtent) -
(_scrollerHeight *
_scrollPosition /
widget.controller.position.maxScrollExtent);
}
});
},
),
),
),
),
],
),
);
}
}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.

917 Bytes

This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.