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