├── .github └── FUNDING.yml ├── README.md ├── android ├── android.iml ├── app │ ├── app.iml │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ ├── com │ │ │ │ └── puneeth │ │ │ │ │ └── technic_help │ │ │ │ │ └── MainActivity.java │ │ │ └── io │ │ │ │ └── flutter │ │ │ │ └── plugins │ │ │ │ └── GeneratedPluginRegistrant.java │ │ └── res │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties ├── settings.gradle └── technic_help_android.iml ├── assets ├── CustomIcons.ttf ├── Montserrat-Black.ttf ├── Montserrat-Medium.ttf ├── Oswald-Bold.ttf ├── Poppins-Bold.ttf ├── Poppins-Medium.ttf ├── background.jpg ├── diamond.png ├── food.jpg ├── illustration.png ├── illustration2.png ├── illustration3.png ├── image_01.png ├── image_02.png ├── logo.png └── slanted_menu.png ├── firebase.json ├── fonts ├── Rubik-Medium.ttf └── Rubik-Regular.ttf ├── ios ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ ├── Generated.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ └── contents.xcworkspacedata └── Runner │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── GeneratedPluginRegistrant.h │ ├── GeneratedPluginRegistrant.m │ ├── Info.plist │ └── main.m ├── lib ├── CheckConectivity.dart ├── authpages │ ├── CustomIcons.dart │ ├── Widgets │ │ ├── CustomIcons.dart │ │ ├── FormCard.dart │ │ ├── SocialButtons.dart │ │ └── SocialIcons.dart │ └── main.dart ├── generated │ └── i18n.dart ├── main.dart ├── mainuipages │ ├── global_config.dart │ ├── home │ │ ├── article.dart │ │ ├── ask_page.dart │ │ ├── follow.dart │ │ ├── home_page.dart │ │ ├── hot.dart │ │ ├── product.dart │ │ ├── question.dart │ │ ├── question_page.dart │ │ ├── recommend.dart │ │ ├── reply_page.dart │ │ ├── search_page.dart │ │ └── widgets │ │ │ ├── barsearch.dart │ │ │ ├── customicons.dart │ │ │ ├── product_fab.dart │ │ │ ├── products.dart │ │ │ └── wordscard.dart │ ├── idea │ │ └── main.dart │ ├── index │ │ ├── index.dart │ │ └── navigation_icon_view.dart │ ├── market │ │ └── main.dart │ ├── my │ │ ├── my_page.dart │ │ └── widgets │ │ │ ├── barsearch.dart │ │ │ ├── ideacard.dart │ │ │ ├── infocard.dart │ │ │ ├── servicecard.dart │ │ │ ├── settingcard.dart │ │ │ └── videocard.dart │ ├── notice │ │ └── main.dart │ └── pages │ │ ├── auth.dart │ │ ├── product.dart │ │ ├── product_edit.dart │ │ ├── product_list.dart │ │ ├── products.dart │ │ └── products_admin.dart ├── models │ ├── attributes.dart │ ├── auth.dart │ ├── location_data.dart │ └── user.dart ├── onboarding │ ├── data.dart │ ├── onboard.dart │ └── page_indicator.dart ├── scopedmodel │ ├── connected_process.dart │ └── main.dart ├── shared │ ├── adaptive_theme.dart │ └── global_config.dart └── widgets │ ├── form_inputs │ └── image.dart │ ├── helpers │ ├── custom_route.dart │ └── ensure_visible.dart │ ├── posts │ ├── product_card.dart │ └── products.dart │ ├── products │ ├── address_tag.dart │ ├── price_tag.dart │ ├── product_card.dart │ ├── product_fab.dart │ └── products.dart │ └── ui_elements │ ├── adapative_progress_indicator.dart │ ├── logout_list_tile.dart │ └── title_default.dart ├── package-lock.json ├── pubspec.lock ├── pubspec.yaml ├── screenrecord └── 20190621_205435.gif ├── technic_help.iml └── test └── widget_test.dart /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with a single custom sponsorship URL 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![GitHub](https://img.shields.io/github/license/PuneethReddyHC/online-shopping-system-advanced) 2 | 3 | Buy Me A Coffee 4 | 5 |

Things I code with

6 |

7 | npm 8 | html5 9 | vue.js 10 | Django 11 | Flutter 12 | JavaScript 13 | Mysql 14 | postgresql 15 | Amazon_AWS 16 | Css 17 | Sass 18 | Styled Components 19 | git 20 | Heroku 21 | Docker 22 | angular 23 | MongoDB 24 | Nodejs 25 | Google Cloud Platform 26 | TypeScript 27 | 28 |

29 |

Projects We develop

30 | 31 | 41 |

Projects with installation support and code explaination for Premium contact phone: +919535688928 gmail: puneethreddy951@gmail.com or visit :Projects Wall

42 | 43 | 44 | # technic_help 45 | 46 | A new Flutter application. 47 | 48 | # video 49 | 50 | [![Watch the video](https://i.imgur.com/vKb2F1B.png)](https://youtu.be/haApAi_pdFk) 51 | 52 | # Screen Record 53 | 54 | 55 | 56 | 57 | ## Getting Started 58 | 59 | This project is a starting point for a Flutter application. 60 | 61 | A few resources to get you started if this is your first Flutter project: 62 | 63 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 64 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 65 | 66 | For help getting started with Flutter, view our 67 | [online documentation](https://flutter.dev/docs), which offers tutorials, 68 | samples, guidance on mobile development, and a full API reference. 69 | -------------------------------------------------------------------------------- /android/android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 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 from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.puneeth.technic_help" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | } 62 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 11 | 15 | tools:replace="android:appComponentFactory" 16 | android:appComponentFactory="whateverString" 17 | 18 | 25 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/puneeth/technic_help/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.puneeth.technic_help; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins; 2 | 3 | import io.flutter.plugin.common.PluginRegistry; 4 | import io.flutter.plugins.connectivity.ConnectivityPlugin; 5 | import io.flutter.plugins.imagepicker.ImagePickerPlugin; 6 | import io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin; 7 | import io.flutter.plugins.urllauncher.UrlLauncherPlugin; 8 | 9 | /** 10 | * Generated file. Do not edit. 11 | */ 12 | public final class GeneratedPluginRegistrant { 13 | public static void registerWith(PluginRegistry registry) { 14 | if (alreadyRegisteredWith(registry)) { 15 | return; 16 | } 17 | ConnectivityPlugin.registerWith(registry.registrarFor("io.flutter.plugins.connectivity.ConnectivityPlugin")); 18 | ImagePickerPlugin.registerWith(registry.registrarFor("io.flutter.plugins.imagepicker.ImagePickerPlugin")); 19 | SharedPreferencesPlugin.registerWith(registry.registrarFor("io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin")); 20 | UrlLauncherPlugin.registerWith(registry.registrarFor("io.flutter.plugins.urllauncher.UrlLauncherPlugin")); 21 | } 22 | 23 | private static boolean alreadyRegisteredWith(PluginRegistry registry) { 24 | final String key = GeneratedPluginRegistrant.class.getCanonicalName(); 25 | if (registry.hasPlugin(key)) { 26 | return true; 27 | } 28 | registry.registrarFor(key); 29 | return false; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | 10 | } 11 | } 12 | 13 | allprojects { 14 | repositories { 15 | google() 16 | jcenter() 17 | } 18 | } 19 | 20 | rootProject.buildDir = '../build' 21 | subprojects { 22 | project.buildDir = "${rootProject.buildDir}/${project.name}" 23 | } 24 | subprojects { 25 | project.evaluationDependsOn(':app') 26 | } 27 | 28 | task clean(type: Delete) { 29 | delete rootProject.buildDir 30 | } 31 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/local.properties: -------------------------------------------------------------------------------- 1 | flutter.buildMode=debug 2 | ndk.dir=C\:\\Android\\sdk\\ndk-bundle 3 | flutter.versionName=1.0.0 4 | flutter.sdk=C:\\flutter 5 | sdk.dir=C:/Android/sdk 6 | flutter.versionCode=1 -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /android/technic_help_android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /assets/CustomIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/CustomIcons.ttf -------------------------------------------------------------------------------- /assets/Montserrat-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/Montserrat-Black.ttf -------------------------------------------------------------------------------- /assets/Montserrat-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/Montserrat-Medium.ttf -------------------------------------------------------------------------------- /assets/Oswald-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/Oswald-Bold.ttf -------------------------------------------------------------------------------- /assets/Poppins-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/Poppins-Bold.ttf -------------------------------------------------------------------------------- /assets/Poppins-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/Poppins-Medium.ttf -------------------------------------------------------------------------------- /assets/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/background.jpg -------------------------------------------------------------------------------- /assets/diamond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/diamond.png -------------------------------------------------------------------------------- /assets/food.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/food.jpg -------------------------------------------------------------------------------- /assets/illustration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/illustration.png -------------------------------------------------------------------------------- /assets/illustration2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/illustration2.png -------------------------------------------------------------------------------- /assets/illustration3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/illustration3.png -------------------------------------------------------------------------------- /assets/image_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/image_01.png -------------------------------------------------------------------------------- /assets/image_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/image_02.png -------------------------------------------------------------------------------- /assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/logo.png -------------------------------------------------------------------------------- /assets/slanted_menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/assets/slanted_menu.png -------------------------------------------------------------------------------- /firebase.json: -------------------------------------------------------------------------------- 1 | {} 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /fonts/Rubik-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/fonts/Rubik-Medium.ttf -------------------------------------------------------------------------------- /fonts/Rubik-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/fonts/Rubik-Regular.ttf -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Generated.xcconfig: -------------------------------------------------------------------------------- 1 | // This is a generated file; do not edit or check into version control. 2 | FLUTTER_ROOT=C:\flutter 3 | FLUTTER_APPLICATION_PATH=C:\Users\PUNEHEMU KEERU\Documents\A aFlutter\technic_help 4 | FLUTTER_TARGET=lib/main.dart 5 | FLUTTER_BUILD_DIR=build 6 | SYMROOT=${SOURCE_ROOT}/../build\ios 7 | FLUTTER_FRAMEWORK_DIR=C:\flutter\bin\cache\artifacts\engine\ios 8 | FLUTTER_BUILD_NAME=1.0.0 9 | FLUTTER_BUILD_NUMBER=1 10 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 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 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 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 | } 24 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 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. -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/GeneratedPluginRegistrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #ifndef GeneratedPluginRegistrant_h 6 | #define GeneratedPluginRegistrant_h 7 | 8 | #import 9 | 10 | @interface GeneratedPluginRegistrant : NSObject 11 | + (void)registerWithRegistry:(NSObject*)registry; 12 | @end 13 | 14 | #endif /* GeneratedPluginRegistrant_h */ 15 | -------------------------------------------------------------------------------- /ios/Runner/GeneratedPluginRegistrant.m: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | #import "GeneratedPluginRegistrant.h" 6 | #import 7 | #import 8 | #import 9 | #import 10 | 11 | @implementation GeneratedPluginRegistrant 12 | 13 | + (void)registerWithRegistry:(NSObject*)registry { 14 | [FLTConnectivityPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTConnectivityPlugin"]]; 15 | [FLTImagePickerPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTImagePickerPlugin"]]; 16 | [FLTSharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTSharedPreferencesPlugin"]]; 17 | [FLTUrlLauncherPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTUrlLauncherPlugin"]]; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | technic_help 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lib/CheckConectivity.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; //InternetAddress utility 2 | import 'dart:async'; //For StreamController/Stream 3 | 4 | import 'package:connectivity/connectivity.dart'; 5 | 6 | class ConnectionStatusSingleton { 7 | //This creates the single instance by calling the `_internal` constructor specified below 8 | static final ConnectionStatusSingleton _singleton = new ConnectionStatusSingleton._internal(); 9 | ConnectionStatusSingleton._internal(); 10 | 11 | //This is what's used to retrieve the instance through the app 12 | static ConnectionStatusSingleton getInstance() => _singleton; 13 | 14 | //This tracks the current connection status 15 | bool hasConnection = false; 16 | 17 | //This is how we'll allow subscribing to connection changes 18 | StreamController connectionChangeController = new StreamController.broadcast(); 19 | 20 | //flutter_connectivity 21 | final Connectivity _connectivity = Connectivity(); 22 | 23 | //Hook into flutter_connectivity's Stream to listen for changes 24 | //And check the connection status out of the gate 25 | void initialize() { 26 | _connectivity.onConnectivityChanged.listen(_connectionChange); 27 | checkConnection(); 28 | } 29 | 30 | Stream get connectionChange => connectionChangeController.stream; 31 | 32 | //A clean up method to close our StreamController 33 | // Because this is meant to exist through the entire application life cycle this isn't 34 | // really an issue 35 | void dispose() { 36 | connectionChangeController.close(); 37 | } 38 | 39 | //flutter_connectivity's listener 40 | void _connectionChange(ConnectivityResult result) { 41 | checkConnection(); 42 | } 43 | 44 | //The test to actually see if there is a connection 45 | Future checkConnection() async { 46 | bool previousConnection = hasConnection; 47 | 48 | try { 49 | final result = await InternetAddress.lookup('google.com'); 50 | if (result.isNotEmpty && result[0].rawAddress.isNotEmpty) { 51 | hasConnection = true; 52 | } else { 53 | hasConnection = false; 54 | } 55 | } on SocketException catch(_) { 56 | hasConnection = false; 57 | } 58 | 59 | //The connection status changed send out an update to all listeners 60 | if (previousConnection != hasConnection) { 61 | connectionChangeController.add(hasConnection); 62 | } 63 | 64 | return hasConnection; 65 | } 66 | } -------------------------------------------------------------------------------- /lib/authpages/CustomIcons.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomIcons { 4 | static const IconData twitter = IconData(0xe900, fontFamily: "CustomIcons"); 5 | static const IconData facebook = IconData(0xe901, fontFamily: "CustomIcons"); 6 | static const IconData googlePlus = 7 | IconData(0xe902, fontFamily: "CustomIcons"); 8 | static const IconData linkedin = IconData(0xe903, fontFamily: "CustomIcons"); 9 | } 10 | -------------------------------------------------------------------------------- /lib/authpages/Widgets/CustomIcons.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomIcons { 4 | static const IconData twitter = IconData(0xe900, fontFamily: "CustomIcons"); 5 | static const IconData facebook = IconData(0xe901, fontFamily: "CustomIcons"); 6 | static const IconData googlePlus = 7 | IconData(0xe902, fontFamily: "CustomIcons"); 8 | static const IconData linkedin = IconData(0xe903, fontFamily: "CustomIcons"); 9 | } 10 | -------------------------------------------------------------------------------- /lib/authpages/Widgets/FormCard.dart: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/authpages/Widgets/SocialButtons.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter/material.dart'; 3 | import './SocialIcons.dart'; 4 | import './CustomIcons.dart'; 5 | 6 | class SocialButtons extends StatelessWidget { 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return new Row( 11 | mainAxisAlignment: MainAxisAlignment.center, 12 | children: [ 13 | SocialIcon( 14 | colors: [ 15 | Color(0xFF102397), 16 | Color(0xFF187adf), 17 | Color(0xFF00eaf8), 18 | ], 19 | iconData: CustomIcons.facebook, 20 | onPressed: () {}, 21 | ), 22 | SocialIcon( 23 | colors: [ 24 | Color(0xFFff4f38), 25 | Color(0xFFff355d), 26 | ], 27 | iconData: CustomIcons.googlePlus, 28 | onPressed: () {}, 29 | ), 30 | SocialIcon( 31 | colors: [ 32 | Color(0xFF17ead9), 33 | Color(0xFF6078ea), 34 | ], 35 | iconData: CustomIcons.twitter, 36 | onPressed: () {}, 37 | ), 38 | SocialIcon( 39 | colors: [ 40 | Color(0xFF00c6fb), 41 | Color(0xFF005bea), 42 | ], 43 | iconData: CustomIcons.linkedin, 44 | onPressed: () {}, 45 | ) 46 | ], 47 | ); 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /lib/authpages/Widgets/SocialIcons.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SocialIcon extends StatelessWidget { 4 | final List colors; 5 | final IconData iconData; 6 | final Function onPressed; 7 | SocialIcon({this.colors, this.iconData, this.onPressed}); 8 | @override 9 | Widget build(BuildContext context) { 10 | return new Padding( 11 | padding: EdgeInsets.only(left: 14.0), 12 | child: Container( 13 | width: 45.0, 14 | height: 45.0, 15 | decoration: BoxDecoration( 16 | shape: BoxShape.circle, 17 | gradient: LinearGradient(colors: colors, tileMode: TileMode.clamp)), 18 | child: RawMaterialButton( 19 | shape: CircleBorder(), 20 | onPressed: onPressed, 21 | child: Icon(iconData, color: Colors.white), 22 | ), 23 | ), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/generated/i18n.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | // ignore_for_file: non_constant_identifier_names 7 | // ignore_for_file: camel_case_types 8 | // ignore_for_file: prefer_single_quotes 9 | 10 | // This file is automatically generated. DO NOT EDIT, all your changes would be lost. 11 | class S implements WidgetsLocalizations { 12 | const S(); 13 | 14 | static const GeneratedLocalizationsDelegate delegate = 15 | GeneratedLocalizationsDelegate(); 16 | 17 | static S of(BuildContext context) => Localizations.of(context, S); 18 | 19 | @override 20 | TextDirection get textDirection => TextDirection.ltr; 21 | 22 | } 23 | 24 | class $en extends S { 25 | const $en(); 26 | } 27 | 28 | class GeneratedLocalizationsDelegate extends LocalizationsDelegate { 29 | const GeneratedLocalizationsDelegate(); 30 | 31 | List get supportedLocales { 32 | return const [ 33 | Locale("en", ""), 34 | ]; 35 | } 36 | 37 | LocaleListResolutionCallback listResolution({Locale fallback, bool withCountry = true}) { 38 | return (List locales, Iterable supported) { 39 | if (locales == null || locales.isEmpty) { 40 | return fallback ?? supported.first; 41 | } else { 42 | return _resolve(locales.first, fallback, supported, withCountry); 43 | } 44 | }; 45 | } 46 | 47 | LocaleResolutionCallback resolution({Locale fallback, bool withCountry = true}) { 48 | return (Locale locale, Iterable supported) { 49 | return _resolve(locale, fallback, supported, withCountry); 50 | }; 51 | } 52 | 53 | @override 54 | Future load(Locale locale) { 55 | final String lang = getLang(locale); 56 | if (lang != null) { 57 | switch (lang) { 58 | case "en": 59 | return SynchronousFuture(const $en()); 60 | default: 61 | // NO-OP. 62 | } 63 | } 64 | return SynchronousFuture(const S()); 65 | } 66 | 67 | @override 68 | bool isSupported(Locale locale) => _isSupported(locale, true); 69 | 70 | @override 71 | bool shouldReload(GeneratedLocalizationsDelegate old) => false; 72 | 73 | /// 74 | /// Internal method to resolve a locale from a list of locales. 75 | /// 76 | Locale _resolve(Locale locale, Locale fallback, Iterable supported, bool withCountry) { 77 | if (locale == null || !_isSupported(locale, withCountry)) { 78 | return fallback ?? supported.first; 79 | } 80 | 81 | final Locale languageLocale = Locale(locale.languageCode, ""); 82 | if (supported.contains(locale)) { 83 | return locale; 84 | } else if (supported.contains(languageLocale)) { 85 | return languageLocale; 86 | } else { 87 | final Locale fallbackLocale = fallback ?? supported.first; 88 | return fallbackLocale; 89 | } 90 | } 91 | 92 | /// 93 | /// Returns true if the specified locale is supported, false otherwise. 94 | /// 95 | bool _isSupported(Locale locale, bool withCountry) { 96 | if (locale != null) { 97 | for (Locale supportedLocale in supportedLocales) { 98 | // Language must always match both locales. 99 | if (supportedLocale.languageCode != locale.languageCode) { 100 | continue; 101 | } 102 | 103 | // If country code matches, return this locale. 104 | if (supportedLocale.countryCode == locale.countryCode) { 105 | return true; 106 | } 107 | 108 | // If no country requirement is requested, check if this locale has no country. 109 | if (true != withCountry && (supportedLocale.countryCode == null || supportedLocale.countryCode.isEmpty)) { 110 | return true; 111 | } 112 | } 113 | } 114 | return false; 115 | } 116 | } 117 | 118 | String getLang(Locale l) => l == null 119 | ? null 120 | : l.countryCode != null && l.countryCode.isEmpty 121 | ? l.languageCode 122 | : l.toString(); 123 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import './authpages/main.dart'; 3 | import './onboarding/onboard.dart'; 4 | 5 | import 'package:flutter/services.dart'; 6 | import 'package:scoped_model/scoped_model.dart'; 7 | import './scopedmodel/main.dart'; 8 | 9 | import './mainuipages/index/index.dart'; 10 | import './mainuipages/pages/products_admin.dart'; 11 | import './mainuipages/pages/products.dart'; 12 | 13 | import './widgets/helpers/custom_route.dart'; 14 | 15 | import 'models/attributes.dart'; 16 | import './mainuipages/home/product.dart'; 17 | import './mainuipages/pages/product_edit.dart'; 18 | 19 | void main() { 20 | SystemChrome.setPreferredOrientations( 21 | [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]); 22 | 23 | 24 | runApp(MaterialApp( 25 | home: MyApp(), 26 | debugShowCheckedModeBanner: false, 27 | )); 28 | } 29 | 30 | class MyApp extends StatefulWidget { 31 | @override 32 | State createState() { 33 | return _MyAppState(); 34 | } 35 | } 36 | 37 | class _MyAppState extends State { 38 | 39 | @override 40 | final MainModel _model = MainModel(); 41 | bool _isAuthenticated = false; 42 | 43 | @override 44 | void initState() { 45 | _model.autoAuthenticate(); 46 | _model.userSubject.listen((bool isAuthenticated) { 47 | setState(() { 48 | _isAuthenticated = isAuthenticated; 49 | }); 50 | }); 51 | super.initState(); 52 | } 53 | 54 | Widget build(BuildContext context) { 55 | return ScopedModel( 56 | model: _model, 57 | child: MaterialApp( 58 | 59 | theme: ThemeData( 60 | brightness: Brightness.light, 61 | primarySwatch: Colors.deepOrange, 62 | accentColor: Colors.deepPurple, 63 | buttonColor: Colors.deepPurple), 64 | routes: { 65 | '/': (BuildContext context) =>!_isAuthenticated ? OnBoard() :Index(_model), 66 | '/login': (BuildContext context) => Login(), 67 | '/admin':(BuildContext context) => 68 | !_isAuthenticated ? Login() : ProductsAdminPage(_model), 69 | '/post':(BuildContext context) => 70 | !_isAuthenticated ? Login() : ProductEditPage(), 71 | }, 72 | onGenerateRoute: (RouteSettings settings) { 73 | 74 | if (!_isAuthenticated) { 75 | return MaterialPageRoute( 76 | builder: (BuildContext context) => Login(), 77 | ); 78 | } 79 | final List pathElements = settings.name.split('/'); 80 | print('on generate routes '+ pathElements[0] +' '+ pathElements[1]); 81 | if (pathElements[0] != '') { 82 | print('on generate routes Null[0]'); 83 | return null; 84 | 85 | } 86 | if (pathElements[1] == 'product') { 87 | print('on generate routes [2]'+pathElements[2]); 88 | final String productId = pathElements[2]; 89 | final Product product = 90 | _model.allProducts.firstWhere((Product product) { 91 | 92 | return product.id == productId; 93 | }); 94 | print(product.title); 95 | return CustomRoute( 96 | 97 | builder: (BuildContext context) => 98 | !_isAuthenticated ? Login() : ProductPage(product), 99 | 100 | ); 101 | } 102 | return null; 103 | }, 104 | onUnknownRoute: (RouteSettings settings) { 105 | print('on unknown routes'); 106 | return MaterialPageRoute( 107 | builder: (BuildContext context) => 108 | !_isAuthenticated ? Login() : ProductsPage(_model)); 109 | }, 110 | ), 111 | 112 | ); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /lib/mainuipages/global_config.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class GlobalConfig { 4 | static bool dark = true; 5 | static ThemeData themeData = new ThemeData.dark(); 6 | static Color searchBackgroundColor = new Color(0xFFEBEBEB); 7 | static Color searchFontColor = Colors.black54; 8 | static Color cardBackgroundColor = new Color(0xFF222222); 9 | static Color fontColor = Colors.white30; 10 | } -------------------------------------------------------------------------------- /lib/mainuipages/home/article.dart: -------------------------------------------------------------------------------- 1 | 2 | class Article { 3 | String headUrl; 4 | String user; 5 | String action; 6 | String time; 7 | String title; 8 | String mark; 9 | String imgUrl; 10 | int agreeNum; 11 | int commentNum; 12 | 13 | Article(this.headUrl, this.user, this.action, this.time, this.title, this.mark, this.agreeNum, this.commentNum, {this.imgUrl}); 14 | } 15 | 16 | List
articleList = [ 17 | new Article( 18 | "https://pic3.zhimg.com/50/2b8be8010409012e7cdd764e1befc4d1_s.jpg", 19 | "learner", 20 | "Endorsed the answer", 21 | "2 hours ago", 22 | "In the three-body, why did Luo Ji give control to Cheng Xin, did he not speculate on the consequences?", 23 | "Because Luo Ji adheres to human ethics. This ethic is probably called democracy. Da Liu is actually a typical elitist, in his writing...", 24 | 32, 10, 25 | imgUrl: "https://pic2.zhimg.com/50/v2-710b7a6fea12a7203945b666790b7181_hd.jpg" 26 | ), 27 | new Article( 28 | "https://pic4.zhimg.com/50/v2-9a3cb5d5ee4339b8cf4470ece18d404f_s.jpg", 29 | "learner", 30 | "Answered the question", 31 | "5 hours ago", 32 | "My mobile phone system is Android. Inadvertently found that his screen was monitored, how can I get rid of the situation being monitored?", 33 | "Check if you have installed any software on your phone and delete non-system software that you don't know. I will not go to the little brother in the mobile phone shop, why are so many people...", 34 | 38, 13, 35 | ), 36 | new Article( 37 | "https://pic3.zhimg.com/50/v2-8943c20cecab028e19644cccf0f3a38b_s.jpg", 38 | "learner", 39 | "Answered the question", 40 | "7 hours ago", 41 | "How to evaluate the 2018 Anhui Provincial Programming Competition?", 42 | "I took the political task and pressure to play the game. Fortunately, I was finally raised by the high school student. The list can see another answer. Probably the experience is before...", 43 | 38, 13, 44 | imgUrl: "https://pic4.zhimg.com/v2-a7493d69f0d8f849c6345f8f693454f3_200x112.jpg" 45 | ), 46 | new Article( 47 | "https://pic3.zhimg.com/50/v2-8943c20cecab028e19644cccf0f3a38b_s.jpg", 48 | "learner", 49 | "Answered the question", 50 | "7 hours ago", 51 | "What is the ultimate civilization? Will it really kill other low-level creatures like the Dark Forest Rules?", 52 | "The favorite characters are Zhang Beihai and Wade but the favorite plot is this one. The people on the earth promise to give them flowers and honors...", 53 | 38, 13, 54 | imgUrl: "https://pic3.zhimg.com/v2-b67be50be51e2e6d6112a64528683b09_b.jpg" 55 | ) 56 | ]; -------------------------------------------------------------------------------- /lib/mainuipages/home/ask_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | 4 | class AskPage extends StatefulWidget { 5 | 6 | @override 7 | AskPageState createState() => new AskPageState(); 8 | } 9 | 10 | class AskPageState extends State { 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return new MaterialApp( 15 | theme: GlobalConfig.themeData, 16 | home: new Scaffold( 17 | appBar: new AppBar( 18 | title: new Container( 19 | child: new Row( 20 | children: [ 21 | new FlatButton.icon( 22 | onPressed: (){ 23 | Navigator.of(context).pop(); 24 | }, 25 | icon: new Icon(Icons.clear, color: Colors.white70), 26 | label: new Text(""), 27 | ), 28 | new Expanded( 29 | child: new Container( 30 | child: new Text("Ask a question"), 31 | ) 32 | ), 33 | new FlatButton( 34 | onPressed: (){}, 35 | child: new Text("next step", style: new TextStyle(color: Colors.white12)) 36 | ) 37 | ], 38 | ), 39 | ) 40 | ), 41 | body: new SingleChildScrollView( 42 | child: new Column( 43 | children: [ 44 | new Container( 45 | child: new TextField( 46 | decoration: new InputDecoration( 47 | hintText: "Please enter a title", 48 | hintStyle: new TextStyle(color: Colors.white70) 49 | ), 50 | ), 51 | margin: const EdgeInsets.all(16.0), 52 | ) 53 | 54 | ], 55 | ), 56 | ) 57 | ) 58 | ); 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /lib/mainuipages/home/follow.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import './widgets/products.dart'; 4 | import 'package:scoped_model/scoped_model.dart'; 5 | import '../../scopedmodel/main.dart'; 6 | import '../../CheckConectivity.dart'; 7 | 8 | 9 | class Follow extends StatefulWidget { 10 | final MainModel model; 11 | 12 | Follow(this.model,{Key key}):super(key: key); 13 | 14 | @override 15 | State createState() { 16 | 17 | return _FollowState(); 18 | } 19 | } 20 | 21 | class _FollowState extends State { 22 | 23 | 24 | 25 | ConnectionStatusSingleton connectionStatus = ConnectionStatusSingleton.getInstance(); 26 | 27 | bool isOffline = true; 28 | 29 | @override 30 | initState() { 31 | 32 | super.initState(); 33 | widget.model.fetchProducts(); 34 | connectionStatus.checkConnection().then((hasconnection) { 35 | isOffline = !hasconnection; 36 | 37 | // Do something else... 38 | }); 39 | 40 | } 41 | void _checkConn(){ 42 | setState(() { 43 | connectionStatus.checkConnection().then((hascon) { 44 | isOffline = !hascon; 45 | if(!isOffline){ 46 | Navigator.of(context).pushReplacementNamed('/'); 47 | } 48 | }); 49 | }); 50 | } 51 | Widget _buildProductsList() { 52 | return ScopedModelDescendant( 53 | builder: (BuildContext context, Widget child, MainModel model) { 54 | Widget content = 55 | Container(child: Center(child: Text('products not found'),)); 56 | if(isOffline){ 57 | content =Center(child:Column(mainAxisAlignment: MainAxisAlignment.center, 58 | crossAxisAlignment: CrossAxisAlignment.center,children: [Text('No Network Connection'),SizedBox(height: 20),RaisedButton(onPressed:()=>_checkConn(), 59 | child: Text("Retry"))],)); 60 | } 61 | 62 | if (model.displayedProducts.length > 0 && !model.isLoading) { 63 | content = Products(); 64 | 65 | } else if (model.isLoading) { 66 | content = Center(child: SizedBox( 67 | child: CircularProgressIndicator( 68 | valueColor: new AlwaysStoppedAnimation( 69 | Colors.purpleAccent), 70 | strokeWidth: 4.0, 71 | ), 72 | height: 25.0, 73 | width: 25.0, 74 | ),); 75 | } 76 | return RefreshIndicator( 77 | onRefresh: model.fetchProducts, 78 | child: content, 79 | ); 80 | }, 81 | ); 82 | } 83 | 84 | 85 | 86 | @override 87 | Widget build(BuildContext context) { 88 | 89 | return new Container( 90 | margin: const EdgeInsets.only(top: 5.0), 91 | child:_buildProductsList(), 92 | ); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /lib/mainuipages/home/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | import 'follow.dart'; 4 | import 'recommend.dart'; 5 | import 'hot.dart'; 6 | import 'widgets/barsearch.dart'; 7 | import '../../scopedmodel/main.dart'; 8 | import './widgets/product_fab.dart'; 9 | class HomePage extends StatelessWidget { 10 | final MainModel model; 11 | HomePage(this.model); 12 | 13 | 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return new DefaultTabController( 18 | length: 3, 19 | child: new Scaffold( 20 | appBar: new AppBar( 21 | title: BarSearchPage(), 22 | bottom: new TabBar( 23 | labelColor: GlobalConfig.dark == true ? new Color(0xFF63FDD9) : Colors.blue, 24 | unselectedLabelColor: GlobalConfig.dark == true ? Colors.white : Colors.black, 25 | tabs: [ 26 | new Tab(text: "attention"), 27 | new Tab(text: "recommend"), 28 | new Tab(text: "Hot list"), 29 | ], 30 | ), 31 | ), 32 | body: new TabBarView( 33 | children: [ 34 | new Follow(model), 35 | new Recommend(), 36 | new Hot() 37 | ] 38 | ), 39 | floatingActionButton: ProductFAB(), 40 | ), 41 | 42 | ); 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /lib/mainuipages/home/hot.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'question.dart'; 3 | import 'question_page.dart'; 4 | import '../global_config.dart'; 5 | 6 | class Hot extends StatefulWidget{ 7 | 8 | @override 9 | HotState createState() => new HotState(); 10 | } 11 | 12 | class HotState extends State{ 13 | 14 | Widget hotCard(Question question) { 15 | return new Container( 16 | decoration: new BoxDecoration( 17 | color: GlobalConfig.cardBackgroundColor, 18 | border: new BorderDirectional( 19 | bottom: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12, width: 1.0) 20 | ) 21 | ), 22 | child: new FlatButton( 23 | onPressed: (){ 24 | Navigator.of(context).push(new MaterialPageRoute( 25 | builder: (context) { 26 | return new QuestionPage(); 27 | } 28 | )); 29 | }, 30 | child: new Container( 31 | padding: const EdgeInsets.only(top: 8.0, bottom: 8.0), 32 | child: new Row( 33 | children: [ 34 | new Expanded( 35 | flex: 1, 36 | child: new Column( 37 | children: [ 38 | new Container( 39 | child: new Text( 40 | question.order, 41 | style: new TextStyle( 42 | color: question.order.compareTo("03") <= 0 ? Colors.red : Colors.yellow, 43 | fontSize: 18.0 44 | ) 45 | ), 46 | alignment: Alignment.topLeft, 47 | ), 48 | question.rise != null ? 49 | new Row( 50 | children: [ 51 | new Icon(Icons.arrow_upward, color: Colors.red, size: 10.0,), 52 | new Text(question.rise, style: new TextStyle(color: Colors.red, fontSize: 10.0),) 53 | ], 54 | ) : new Container() 55 | ], 56 | ) 57 | ), 58 | new Expanded( 59 | flex: 6, 60 | child: new Column( 61 | children: [ 62 | new Container( 63 | child: new Text( 64 | question.title, 65 | style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0, height: 1.1, color: GlobalConfig.dark == true ? Colors.white70 : Colors.black), 66 | ), 67 | padding: const EdgeInsets.only(bottom: 10.0,right: 4.0), 68 | alignment: Alignment.topLeft, 69 | ), 70 | question.mark != null ? 71 | new Container( 72 | child: new Text(question.mark, style: new TextStyle(color: GlobalConfig.fontColor)), 73 | alignment: Alignment.topLeft, 74 | padding: const EdgeInsets.only(bottom: 8.0,right: 4.0) 75 | ) : new Container(), 76 | new Container( 77 | child: new Text(question.hotNum, style: new TextStyle(color: GlobalConfig.fontColor)), 78 | alignment: Alignment.topLeft, 79 | ) 80 | ], 81 | ) 82 | ), 83 | new Expanded( 84 | flex: 3, 85 | child: new AspectRatio( 86 | aspectRatio: 3.0 / 2.0, 87 | child: new Container( 88 | foregroundDecoration:new BoxDecoration( 89 | image: new DecorationImage( 90 | image: new NetworkImage(question.imgUrl), 91 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 92 | ), 93 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 94 | ), 95 | ) 96 | ) 97 | ) 98 | ], 99 | ), 100 | ) 101 | ), 102 | ); 103 | } 104 | 105 | @override 106 | Widget build(BuildContext context) { 107 | return new SingleChildScrollView( 108 | child: new Container( 109 | margin: const EdgeInsets.only(top: 5.0), 110 | child: new Column( 111 | children: [ 112 | new Container( 113 | margin: const EdgeInsets.only(top: 5.0), 114 | ), 115 | hotCard(questionList[0]), 116 | hotCard(questionList[1]), 117 | hotCard(questionList[2]), 118 | hotCard(questionList[3]), 119 | hotCard(questionList[4]), 120 | hotCard(questionList[4]), 121 | hotCard(questionList[4]), 122 | hotCard(questionList[4]), 123 | ], 124 | ), 125 | ) 126 | ); 127 | } 128 | } -------------------------------------------------------------------------------- /lib/mainuipages/home/product.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:flutter/material.dart'; 3 | import '../../widgets/ui_elements/title_default.dart'; 4 | import '../../widgets/products/product_fab.dart'; 5 | import '../../models/attributes.dart'; 6 | 7 | 8 | class ProductPage extends StatelessWidget { 9 | final Product product; 10 | 11 | ProductPage(this.product); 12 | 13 | 14 | 15 | Widget _buildAddressPriceRow(double price) { 16 | return Row( 17 | mainAxisAlignment: MainAxisAlignment.center, 18 | children: [ 19 | GestureDetector( 20 | onTap:(){}, 21 | child: Text( 22 | 'address', 23 | style: TextStyle(fontFamily: 'Oswald', color: Colors.grey), 24 | ), 25 | ), 26 | Container( 27 | margin: EdgeInsets.symmetric(horizontal: 5.0), 28 | child: Text( 29 | '|', 30 | style: TextStyle(color: Colors.grey), 31 | ), 32 | ), 33 | Text( 34 | '\$' + price.toString(), 35 | style: TextStyle(fontFamily: 'Oswald', color: Colors.grey), 36 | ) 37 | ], 38 | ); 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | return WillPopScope( 44 | onWillPop: () { 45 | print('Back button pressed!'); 46 | Navigator.pop(context, false); 47 | return Future.value(false); 48 | }, 49 | child: Scaffold( 50 | // appBar: AppBar( 51 | // title: Text(product.title), 52 | // ), 53 | body: CustomScrollView( 54 | slivers: [ 55 | SliverAppBar( 56 | expandedHeight: 256.0, 57 | pinned: true, 58 | flexibleSpace: FlexibleSpaceBar( 59 | title: Text(product.title), 60 | background: Hero( 61 | tag: product.id, 62 | child: FadeInImage( 63 | image: NetworkImage(product.image), 64 | height: 300.0, 65 | fit: BoxFit.cover, 66 | placeholder: AssetImage('assets/food.jpg'), 67 | ), 68 | ), 69 | ), 70 | ), 71 | SliverList( 72 | delegate: SliverChildListDelegate( 73 | [ 74 | Container( 75 | padding: EdgeInsets.all(10.0), 76 | alignment: Alignment.center, 77 | child: TitleDefault(product.title), 78 | ), 79 | _buildAddressPriceRow(product.price), 80 | Container( 81 | padding: EdgeInsets.all(10.0), 82 | child: Text( 83 | product.description, 84 | textAlign: TextAlign.center, 85 | ), 86 | ) 87 | ], 88 | ), 89 | ) 90 | ], 91 | ), 92 | floatingActionButton: ProductFAB(product), 93 | ), 94 | ); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/mainuipages/home/question.dart: -------------------------------------------------------------------------------- 1 | 2 | class Question { 3 | String order; 4 | String rise; 5 | String title; 6 | String mark; 7 | String hotNum; 8 | String imgUrl; 9 | 10 | Question(this.order, this.title, this.hotNum, this.imgUrl, {this.mark, this.rise}); 11 | } 12 | 13 | List questionList = [ 14 | new Question("01", "A great new era, made in China in the world of competition", "4427 Million", "https://pic2.zhimg.com/50/v2-710b7a6fea12a7203945b666790b7181_hd.jpg"), 15 | new Question("02", "How can a girl see the world?", "4157 Million", "https://pic3.zhimg.com/50/v2-56dca99cd8718f9303d43b3015342ba7_hd.jpg", rise: "3", mark: "The so-called world is every aspect of the world."), 16 | new Question("03", "If Zhu Biao is not dead, if you cut it, will Zhu Xi rebel?", "4009 Million", "https://pic4.zhimg.com/v2-095d2b48970889b108247e6d2dd0fa6b_b.jpg"), 17 | new Question("04", "How to compile Linux Kernel?", "3110 Million", "https://pic3.zhimg.com/80/v2-1ea1b0cf80c85b88893b2b97a94d7e71_hd.jpg", mark: "Kernel? Ha ha"), 18 | new Question("05", "How do you view the story of making a mythical story into a movie?", "2119 Million", "https://pic4.zhimg.com/50/v2-267b1dda62f770bd2bd13cb545117b78_hd.jpg",rise: "3",) 19 | ]; -------------------------------------------------------------------------------- /lib/mainuipages/home/recommend.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'article.dart'; 3 | import 'reply_page.dart'; 4 | import '../global_config.dart'; 5 | 6 | class Recommend extends StatefulWidget { 7 | 8 | @override 9 | RecommendState createState() => new RecommendState(); 10 | 11 | } 12 | 13 | class RecommendState extends State { 14 | 15 | Widget commonCard(Article article) { 16 | Widget markWidget; 17 | if (article.imgUrl == null) { 18 | markWidget = new Text( 19 | article.user + " : " + article.mark, 20 | style: new TextStyle(height: 1.3, color: GlobalConfig.fontColor) 21 | ); 22 | } else { 23 | markWidget = new Row( 24 | children: [ 25 | new Expanded( 26 | flex: 2, 27 | child: new Container( 28 | child: new Text( 29 | article.user + " : " + article.mark, 30 | style: new TextStyle(height: 1.3, color: GlobalConfig.fontColor) 31 | ), 32 | ), 33 | ), 34 | new Expanded( 35 | flex: 1, 36 | child: new AspectRatio( 37 | aspectRatio: 3.0 / 2.0, 38 | child:new Container( 39 | foregroundDecoration:new BoxDecoration( 40 | image: new DecorationImage( 41 | image: new NetworkImage(article.imgUrl), 42 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 43 | ), 44 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 45 | ), 46 | ) 47 | ) 48 | ), 49 | ], 50 | ); 51 | } 52 | return new Container( 53 | color: GlobalConfig.cardBackgroundColor, 54 | margin: const EdgeInsets.only(top: 5.0, bottom: 5.0), 55 | child: new FlatButton( 56 | onPressed: (){ 57 | Navigator.of(context).push(new MaterialPageRoute( 58 | builder: (context) { 59 | return new ReplyPage(); 60 | } 61 | )); 62 | }, 63 | child: new Column( 64 | children: [ 65 | new Container( 66 | child: new Text( 67 | article.title, 68 | style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0, height: 1.3, color: GlobalConfig.dark == true? Colors.white70 : Colors.black) 69 | ), 70 | margin: new EdgeInsets.only(top: 6.0, bottom: 2.0), 71 | alignment: Alignment.topLeft 72 | ), 73 | new Container( 74 | child: markWidget, 75 | margin: new EdgeInsets.only(top: 6.0, bottom: 14.0), 76 | alignment: Alignment.topLeft 77 | ), 78 | new Container( 79 | child: new Row( 80 | children: [ 81 | new Expanded( 82 | child: new Text(article.agreeNum.toString() + " Agree " + article.commentNum.toString() + "comment", style: new TextStyle(color: GlobalConfig.fontColor)) 83 | ), 84 | new Icon(Icons.linear_scale, color: GlobalConfig.fontColor) 85 | ], 86 | ), 87 | padding: const EdgeInsets.only(bottom: 10.0), 88 | ) 89 | ], 90 | ), 91 | ) 92 | ); 93 | } 94 | 95 | @override 96 | Widget build(BuildContext context) { 97 | return new SingleChildScrollView( 98 | child: new Container( 99 | margin: const EdgeInsets.only(top: 5.0), 100 | child: new Column( 101 | children: [ 102 | commonCard(articleList[0]), 103 | commonCard(articleList[1]), 104 | ], 105 | ), 106 | ) 107 | ); 108 | } 109 | 110 | } -------------------------------------------------------------------------------- /lib/mainuipages/home/search_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | 4 | class SearchPage extends StatefulWidget{ 5 | @override 6 | SearchPageState createState() => new SearchPageState(); 7 | } 8 | 9 | class SearchPageState extends State { 10 | 11 | Widget searchInput() { 12 | return new Container( 13 | child: new Row( 14 | children: [ 15 | new Container( 16 | child: new FlatButton.icon( 17 | onPressed: (){ 18 | Navigator.of(context).pop(); 19 | }, 20 | icon: new Icon(Icons.arrow_back, color: Colors.black54), 21 | label: new Text("",style: TextStyle(color: Colors.black54),), 22 | ), 23 | width: 60.0, 24 | ), 25 | new Expanded( 26 | child: new TextField( 27 | autofocus: true, 28 | decoration: new InputDecoration.collapsed( 29 | hintText: "Search the content", 30 | hintStyle: new TextStyle(color: Colors.black54) 31 | ), 32 | ), 33 | ) 34 | ], 35 | ), 36 | decoration: new BoxDecoration( 37 | borderRadius: const BorderRadius.all(const Radius.circular(4.0)), 38 | color: GlobalConfig.searchBackgroundColor 39 | ), 40 | ); 41 | } 42 | 43 | @override 44 | Widget build(BuildContext context) { 45 | return new MaterialApp( 46 | theme: GlobalConfig.themeData, 47 | home: new Scaffold( 48 | appBar: new AppBar( 49 | title: searchInput(), 50 | ), 51 | body: new SingleChildScrollView( 52 | child: new Column( 53 | children: [ 54 | new Container( 55 | child: new Text("Hot search", style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0)), 56 | margin: const EdgeInsets.only(top: 16.0, left: 16.0, bottom: 16.0), 57 | alignment: Alignment.topLeft, 58 | ), 59 | new Row( 60 | children: [ 61 | new Container( 62 | child: new Chip( 63 | label: new FlatButton(onPressed: (){}, child: new Text("Car tariff reduction",style: new TextStyle(color: GlobalConfig.fontColor),)), 64 | backgroundColor: GlobalConfig.dark == true ? Colors.white10 : Colors.black12, 65 | ), 66 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0), 67 | alignment: Alignment.topLeft, 68 | ), 69 | new Container( 70 | child: new Chip( 71 | label: new FlatButton(onPressed: (){}, child: new Text("Li Yanhong rumors",style: new TextStyle(color: GlobalConfig.fontColor))), 72 | backgroundColor: GlobalConfig.dark == true ? Colors.white10 : Colors.black12, 73 | ), 74 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0), 75 | alignment: Alignment.topLeft, 76 | ), 77 | ], 78 | ), 79 | new Row( 80 | children: [ 81 | new Container( 82 | child: new Chip( 83 | label: new FlatButton(onPressed: (){}, child: new Text("小米8",style: new TextStyle(color: GlobalConfig.fontColor))), 84 | backgroundColor: GlobalConfig.dark == true ? Colors.white10 : Colors.black12, 85 | ), 86 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0), 87 | alignment: Alignment.topLeft, 88 | ), 89 | new Container( 90 | child: new Chip( 91 | label: new FlatButton(onPressed: (){}, child: new Text("Time-space cohabitation",style: new TextStyle(color: GlobalConfig.fontColor))), 92 | backgroundColor: GlobalConfig.dark == true ? Colors.white10 : Colors.black12, 93 | ), 94 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0), 95 | alignment: Alignment.topLeft, 96 | ), 97 | ], 98 | ), 99 | new Container( 100 | child: new Text("search history", style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0)), 101 | margin: const EdgeInsets.only(left: 16.0, bottom: 16.0), 102 | alignment: Alignment.topLeft, 103 | ), 104 | new Container( 105 | child: new Row( 106 | children: [ 107 | new Container( 108 | child: new Icon(Icons.access_time, color: GlobalConfig.fontColor, size: 16.0), 109 | margin: const EdgeInsets.only(right: 12.0), 110 | ), 111 | new Expanded( 112 | child: new Container( 113 | child: new Text("Amateur interest", style: new TextStyle( color: GlobalConfig.fontColor, fontSize: 14.0),), 114 | ), 115 | ), 116 | new Container( 117 | child: new Icon(Icons.clear, color: GlobalConfig.fontColor, size: 16.0), 118 | ) 119 | ], 120 | ), 121 | margin: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 10.0), 122 | padding: const EdgeInsets.only(bottom: 10.0), 123 | decoration: new BoxDecoration( 124 | border: new BorderDirectional(bottom: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12)) 125 | ), 126 | ), 127 | new Container( 128 | child: new Row( 129 | children: [ 130 | new Container( 131 | child: new Icon(Icons.access_time, color: GlobalConfig.fontColor, size: 16.0), 132 | margin: const EdgeInsets.only(right: 12.0), 133 | ), 134 | new Expanded( 135 | child: new Container( 136 | child: new Text("Three-body", style: new TextStyle( color: GlobalConfig.fontColor, fontSize: 14.0),), 137 | ), 138 | ), 139 | new Container( 140 | child: new Icon(Icons.clear, color: GlobalConfig.fontColor, size: 16.0), 141 | ) 142 | ], 143 | ), 144 | margin: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 10.0), 145 | padding: const EdgeInsets.only(bottom: 10.0), 146 | decoration: new BoxDecoration( 147 | border: new BorderDirectional(bottom: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12)) 148 | ), 149 | ), 150 | new Container( 151 | child: new Row( 152 | children: [ 153 | new Container( 154 | child: new Icon(Icons.access_time, color: GlobalConfig.fontColor, size: 16.0), 155 | margin: const EdgeInsets.only(right: 12.0), 156 | ), 157 | new Expanded( 158 | child: new Container( 159 | child: new Text("Human future", style: new TextStyle( color: GlobalConfig.fontColor, fontSize: 14.0),), 160 | ), 161 | ), 162 | new Container( 163 | child: new Icon(Icons.clear, color: GlobalConfig.fontColor, size: 16.0), 164 | ) 165 | ], 166 | ), 167 | margin: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 10.0), 168 | padding: const EdgeInsets.only(bottom: 10.0), 169 | decoration: new BoxDecoration( 170 | border: new BorderDirectional(bottom: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12)) 171 | ), 172 | ), 173 | ], 174 | ), 175 | ) 176 | ) 177 | ); 178 | } 179 | } -------------------------------------------------------------------------------- /lib/mainuipages/home/widgets/barsearch.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../../mainuipages/global_config.dart'; 3 | import '../../home/search_page.dart'; 4 | import '../search_page.dart'; 5 | import '../ask_page.dart'; 6 | class BarSearchPage extends StatelessWidget{ 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return new Container( 11 | child: new Row( 12 | children: [ 13 | new Expanded( 14 | child: new FlatButton.icon( 15 | onPressed: (){ 16 | Navigator.of(context).push(new MaterialPageRoute( 17 | builder: (context) { 18 | return new SearchPage(); 19 | } 20 | )); 21 | }, 22 | icon: new Icon( 23 | Icons.search, 24 | color: Colors.black54, 25 | size: 16.0 26 | ), 27 | label: new Text( 28 | "search the content", 29 | style: new TextStyle(color: Colors.black54), 30 | ), 31 | ) 32 | ), 33 | new Container( 34 | decoration: new BoxDecoration( 35 | border: new BorderDirectional( 36 | start: new BorderSide(color: GlobalConfig.fontColor, width: 1.0) 37 | ) 38 | ), 39 | height: 14.0, 40 | width: 1.0, 41 | ), 42 | new Container( 43 | child: new FlatButton.icon( 44 | onPressed: (){ 45 | Navigator.of(context).push(new MaterialPageRoute( 46 | builder: (context) { 47 | return new AskPage(); 48 | } 49 | )); 50 | }, 51 | icon: new Icon( 52 | Icons.border_color, 53 | color: Colors.black54, 54 | size: 14.0 55 | ), 56 | label: new Text( 57 | "Ask a question", 58 | style: new TextStyle(color: Colors.black54), 59 | ), 60 | ) 61 | ) 62 | ], 63 | ), 64 | decoration: new BoxDecoration( 65 | borderRadius: const BorderRadius.all(const Radius.circular(4.0)), 66 | color: GlobalConfig.searchBackgroundColor, 67 | ) 68 | ); 69 | } 70 | } -------------------------------------------------------------------------------- /lib/mainuipages/home/widgets/customicons.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomIcons { 4 | static const IconData menu = const IconData(0xe901, fontFamily: "CustomFont"); 5 | static const IconData back_icon = 6 | const IconData(0xe900, fontFamily: "back_icon"); 7 | } -------------------------------------------------------------------------------- /lib/mainuipages/home/widgets/product_fab.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' as math; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | 6 | import 'package:url_launcher/url_launcher.dart'; 7 | import '../../pages/product_edit.dart'; 8 | 9 | class ProductFAB extends StatefulWidget { 10 | 11 | @override 12 | State createState() { 13 | return _ProductFABState(); 14 | } 15 | } 16 | 17 | class _ProductFABState extends State with TickerProviderStateMixin { 18 | AnimationController _controller; 19 | 20 | @override 21 | void initState() { 22 | _controller = AnimationController( 23 | vsync: this, 24 | duration: Duration(milliseconds: 200), 25 | ); 26 | super.initState(); 27 | } 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return Column( 32 | mainAxisSize: MainAxisSize.min, 33 | children: [ 34 | Container( 35 | height: 70.0, 36 | width: 56.0, 37 | alignment: FractionalOffset.topCenter, 38 | child: ScaleTransition( 39 | scale: CurvedAnimation( 40 | parent: _controller, 41 | curve: Interval(0.0, 1.0, curve: Curves.easeOut)), 42 | child: FloatingActionButton( 43 | backgroundColor: Theme.of(context).unselectedWidgetColor, 44 | heroTag: 'contact', 45 | mini: true, 46 | onPressed: () async { 47 | final url = 'mailto:'; 48 | if (await canLaunch(url)) { 49 | await launch(url); 50 | } else { 51 | throw 'Could not launch!'; 52 | } 53 | }, 54 | child: Icon( 55 | Icons.mail, 56 | color: Theme.of(context).primaryColorDark, 57 | ), 58 | ), 59 | ), 60 | ), 61 | Container( 62 | height: 70.0, 63 | width: 56.0, 64 | alignment: FractionalOffset.topCenter, 65 | child: ScaleTransition( 66 | scale: CurvedAnimation( 67 | parent: _controller, 68 | curve: Interval(0.0, 0.5, curve: Curves.easeOut), 69 | ), 70 | child: FloatingActionButton( 71 | backgroundColor: Theme.of(context).unselectedWidgetColor, 72 | heroTag: 'favorite', 73 | mini: true, 74 | onPressed: () { 75 | Navigator.push( 76 | context, 77 | MaterialPageRoute(builder: (context) => ProductEditPage()), 78 | ); 79 | }, 80 | child: Icon( 81 | Icons.add, 82 | color: Colors.red, 83 | ), 84 | ), 85 | ), 86 | ), 87 | FloatingActionButton( 88 | heroTag: 'options', 89 | onPressed: () { 90 | if (_controller.isDismissed) { 91 | _controller.forward(); 92 | } else { 93 | _controller.reverse(); 94 | } 95 | }, 96 | child: AnimatedBuilder( 97 | animation: _controller, 98 | builder: (BuildContext context, Widget child) { 99 | return Transform( 100 | alignment: FractionalOffset.center, 101 | transform: Matrix4.rotationZ(_controller.value * 0.5 * math.pi), 102 | child: Icon(_controller.isDismissed ? Icons.add : Icons.close), 103 | ); 104 | }, 105 | ), 106 | ), 107 | ], 108 | ); 109 | 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /lib/mainuipages/home/widgets/products.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:scoped_model/scoped_model.dart'; 4 | 5 | import './wordscard.dart'; 6 | import '../../../models/attributes.dart'; 7 | import '../../../scopedmodel/main.dart'; 8 | 9 | class Products extends StatelessWidget { 10 | 11 | 12 | Widget _buildProductList(List products) { 13 | Widget productCards; 14 | 15 | if (products.length > 0) { 16 | productCards = ListView.builder( 17 | 18 | itemBuilder: (BuildContext context, int index) => 19 | WordsCards(products[index]), 20 | itemCount: products.length, 21 | ); 22 | } else { 23 | productCards = ListView.builder( 24 | 25 | itemBuilder: (BuildContext context, int index) => 26 | Container(), 27 | itemCount: products.length, 28 | ); 29 | } 30 | return productCards; 31 | } 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | 36 | return ScopedModelDescendant(builder: (BuildContext context, Widget child, MainModel model) { 37 | 38 | return _buildProductList(model.displayedProducts); 39 | },); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/mainuipages/home/widgets/wordscard.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../global_config.dart'; 3 | import '../../../models/attributes.dart'; 4 | import 'package:scoped_model/scoped_model.dart'; 5 | import '../../../scopedmodel/main.dart'; 6 | import '../product.dart'; 7 | 8 | class WordsCards extends StatelessWidget { 9 | final Product product; 10 | 11 | WordsCards(this.product); 12 | 13 | 14 | Widget billboard(context) { 15 | return new ScopedModelDescendant( 16 | builder: (BuildContext context, Widget child, MainModel model) { 17 | return Container( 18 | margin: const EdgeInsets.only(top: 5.0, bottom: 5.0), 19 | color: GlobalConfig.cardBackgroundColor, 20 | child: new FlatButton( 21 | onPressed: () { 22 | model.selectProduct(product.id); 23 | String prodid=product.id; 24 | Product prod= model.allProducts.firstWhere((Product product) { 25 | return product.id==prodid; 26 | }); 27 | Navigator.of(context).push( 28 | new MaterialPageRoute( 29 | builder: (context) => new ProductPage(prod) 30 | ) 31 | ); 32 | 33 | }, 34 | child: new Column( 35 | children: [ 36 | new Container( 37 | child: new Row( 38 | children: [ 39 | new Container( 40 | child: new CircleAvatar( 41 | backgroundImage: new NetworkImage( 42 | "https://pic1.zhimg.com/50/v2-0c9de2012cc4c5e8b01657d96da35534_s.jpg"), 43 | radius: 13.0), 44 | ), 45 | new Text(' ' + product.id + ' ' + '2 hours', 46 | style: new TextStyle(color: GlobalConfig.fontColor)) 47 | ], 48 | ), 49 | padding: const EdgeInsets.only(top: 10.0), 50 | ), 51 | new Container( 52 | child: new Text(product.title, 53 | style: new TextStyle( 54 | fontWeight: FontWeight.bold, 55 | fontSize: 16.0, 56 | height: 1.3, 57 | color: GlobalConfig.dark == true 58 | ? Colors.white70 59 | : Colors.black)), 60 | margin: new EdgeInsets.only(top: 6.0, bottom: 2.0), 61 | alignment: Alignment.topLeft), 62 | new Container( 63 | child: new AspectRatio( 64 | aspectRatio: 1.7 / 1.0, 65 | child: new Container( 66 | child: Hero( 67 | tag: product.id, 68 | child: FadeInImage( 69 | placeholder: const AssetImage('assets/food.jpg'), 70 | image: NetworkImage(product.image), 71 | fit: BoxFit.cover, 72 | width: double.infinity, 73 | height: 556, 74 | ), 75 | ), 76 | )), 77 | margin: new EdgeInsets.only(top: 6.0, bottom: 14.0), 78 | alignment: Alignment.topLeft), 79 | new Container( 80 | child: new Text( 81 | "Still envious of the good work of others? Receive a free Certified Public Accountant course worth 1980 to charge yourself!", 82 | style: new TextStyle( 83 | height: 1.3, color: GlobalConfig.fontColor)), 84 | padding: const EdgeInsets.only(bottom: 8.0)), 85 | new Container( 86 | child: new Row( 87 | children: [ 88 | new Container( 89 | child: new Text("advertising", 90 | style: new TextStyle( 91 | fontSize: 10.0, color: GlobalConfig.fontColor)), 92 | decoration: new BoxDecoration( 93 | border: new Border.all(color: GlobalConfig.fontColor), 94 | borderRadius: 95 | new BorderRadius.all(const Radius.circular(2.0)), 96 | ), 97 | padding: const EdgeInsets.only( 98 | top: 2.0, bottom: 2.0, left: 3.0, right: 3.0)), 99 | new Expanded( 100 | child: new Text(" see details", 101 | style: 102 | new TextStyle(color: GlobalConfig.fontColor))), 103 | new IconButton( 104 | icon: Icon(Icons.share), 105 | color: GlobalConfig.fontColor, 106 | onPressed: () { 107 | model.selectProduct(product.id); 108 | }, 109 | ), 110 | new IconButton( 111 | icon: Icon(Icons.comment), 112 | color: GlobalConfig.fontColor, 113 | onPressed: () { 114 | model.selectProduct(product.id); 115 | }, 116 | ), 117 | new IconButton( 118 | icon: Icon(product.isFavorite 119 | ? Icons.favorite 120 | : Icons.favorite_border), 121 | color: product.isFavorite 122 | ? Colors.redAccent[200] 123 | : GlobalConfig.fontColor, 124 | onPressed: () { 125 | model.selectProduct(product.id); 126 | model.toggleProductFavoriteStatus(); 127 | }, 128 | ), 129 | new PopupMenuButton( 130 | icon: new Icon( 131 | Icons.linear_scale, 132 | color: Colors.white10, 133 | ), 134 | itemBuilder: (BuildContext context) => 135 | >[ 136 | new PopupMenuItem( 137 | value: 'The value of option one', 138 | child: new Text('Block this problem')), 139 | new PopupMenuItem( 140 | value: 'The value of option two', 141 | child: new Text('unsubscribe learner')), 142 | new PopupMenuItem( 143 | value: 'The value of option two', 144 | child: new Text("Report")) 145 | ]) 146 | ], 147 | ), 148 | padding: const EdgeInsets.only(bottom: 10.0), 149 | ) 150 | ], 151 | ), 152 | ), 153 | ); 154 | }); 155 | } 156 | 157 | @override 158 | Widget build(BuildContext context) { 159 | // TODO: implement build 160 | 161 | return billboard(context); 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /lib/mainuipages/idea/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | 4 | 5 | 6 | 7 | class IdeaPage extends StatelessWidget { 8 | 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return new MaterialApp( 13 | home: new Scaffold( 14 | body: new AppBar( 15 | 16 | title: Text('idea page'), 17 | 18 | ) 19 | ), 20 | theme: GlobalConfig.themeData 21 | ); 22 | } 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /lib/mainuipages/index/index.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'navigation_icon_view.dart'; 3 | import '../global_config.dart'; 4 | import '../home/home_page.dart'; 5 | import '../idea/main.dart'; 6 | import '../market/main.dart'; 7 | import '../my/my_page.dart'; 8 | import '../notice/main.dart'; 9 | import '../../scopedmodel/main.dart'; 10 | 11 | 12 | class Index extends StatefulWidget { 13 | final MainModel model; 14 | Index(this.model); 15 | @override 16 | State createState() => new _IndexState(this.model); 17 | } 18 | 19 | class _IndexState extends State with TickerProviderStateMixin { 20 | final MainModel model; 21 | _IndexState(this.model); 22 | 23 | int _currentIndex = 0; 24 | List _navigationViews; 25 | List _pageList; 26 | StatelessWidget _currentPage; 27 | 28 | @override 29 | void initState() { 30 | super.initState(); 31 | 32 | _navigationViews = [ 33 | new NavigationIconView( 34 | icon: new Icon(Icons.assignment), 35 | title: new Text("Home"), 36 | vsync: this, 37 | ), 38 | new NavigationIconView( 39 | icon: new Icon(Icons.all_inclusive), 40 | title: new Text("idea"), 41 | vsync: this, 42 | ), 43 | new NavigationIconView( 44 | icon: new Icon(Icons.add_shopping_cart), 45 | title: new Text("market"), 46 | vsync: this, 47 | ), 48 | new NavigationIconView( 49 | icon: new Icon(Icons.add_alert), 50 | title: new Text("Notice"), 51 | vsync: this, 52 | ), 53 | new NavigationIconView( 54 | icon: new Icon(Icons.perm_identity), 55 | title: new Text("mine"), 56 | vsync: this, 57 | ), 58 | ]; 59 | for (NavigationIconView view in _navigationViews) { 60 | view.controller.addListener(_rebuild); 61 | } 62 | 63 | _pageList = [ 64 | new HomePage(model), 65 | new IdeaPage(), 66 | new MarketPage(), 67 | new NoticePage(), 68 | new MyPage() 69 | ]; 70 | _currentPage = _pageList[_currentIndex]; 71 | } 72 | 73 | void _rebuild() { 74 | setState(() {}); 75 | } 76 | 77 | @override 78 | void dispose() { 79 | super.dispose(); 80 | for (NavigationIconView view in _navigationViews) { 81 | view.controller.dispose(); 82 | } 83 | } 84 | 85 | 86 | @override 87 | Widget build(BuildContext context) { 88 | final BottomNavigationBar bottomNavigationBar = new BottomNavigationBar( 89 | items: _navigationViews 90 | .map((NavigationIconView navigationIconView) => 91 | navigationIconView.item) 92 | .toList(), 93 | currentIndex: _currentIndex, 94 | fixedColor: Colors.blue, 95 | type: BottomNavigationBarType.fixed, 96 | onTap: (int index) { 97 | setState(() { 98 | _navigationViews[_currentIndex].controller.reverse(); 99 | _currentIndex = index; 100 | _navigationViews[_currentIndex].controller.forward(); 101 | _currentPage = _pageList[_currentIndex]; 102 | }); 103 | }); 104 | 105 | return new MaterialApp( 106 | 107 | home:new Scaffold( 108 | body: new Center(child: _currentPage), 109 | bottomNavigationBar: bottomNavigationBar, 110 | ), 111 | theme: GlobalConfig.themeData 112 | 113 | ); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /lib/mainuipages/index/navigation_icon_view.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class NavigationIconView { 4 | 5 | NavigationIconView({ 6 | Widget icon, 7 | Widget title, 8 | TickerProvider vsync 9 | }): 10 | item = new BottomNavigationBarItem( 11 | icon: icon, 12 | title: title, 13 | ), 14 | controller = new AnimationController( 15 | duration: kThemeAnimationDuration, 16 | vsync: vsync 17 | ); 18 | 19 | final BottomNavigationBarItem item; 20 | final AnimationController controller; 21 | } -------------------------------------------------------------------------------- /lib/mainuipages/market/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | 4 | 5 | class MarketPage extends StatelessWidget { 6 | 7 | 8 | 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return new MaterialApp( 13 | home: new Scaffold( 14 | 15 | body: new Container( 16 | child: AppBar( 17 | title: Text('market page'), 18 | ), 19 | ), 20 | ), 21 | theme: GlobalConfig.themeData 22 | ); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /lib/mainuipages/my/my_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../global_config.dart'; 3 | import './widgets/barsearch.dart'; 4 | import './widgets/ideacard.dart'; 5 | import './widgets/infocard.dart'; 6 | import './widgets/servicecard.dart'; 7 | import './widgets/settingcard.dart'; 8 | import './widgets/videocard.dart'; 9 | 10 | class MyPage extends StatelessWidget { 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return new MaterialApp( 15 | theme: GlobalConfig.themeData, 16 | home: new Scaffold( 17 | appBar: new AppBar( 18 | title: BarSearchPage(), 19 | ), 20 | body: new SingleChildScrollView( 21 | child: new Container( 22 | child: new Column( 23 | children: [ 24 | InfoCard(), 25 | ServiceCard(), 26 | SettingCard(), 27 | VideoCard(), 28 | IdeaCard() 29 | ], 30 | ), 31 | ), 32 | ) 33 | ), 34 | ); 35 | } 36 | 37 | } -------------------------------------------------------------------------------- /lib/mainuipages/my/widgets/barsearch.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../../mainuipages/global_config.dart'; 3 | import '../../home/search_page.dart'; 4 | 5 | class BarSearchPage extends StatelessWidget{ 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | // TODO: implement build 10 | return new Container( 11 | child: new FlatButton( 12 | onPressed: (){ 13 | Navigator.of(context).push(new MaterialPageRoute( 14 | builder: (context) { 15 | return new SearchPage(); 16 | } 17 | )); 18 | }, 19 | child: new Row( 20 | children: [ 21 | new Container( 22 | child: new Icon(Icons.search, size: 18.0,color: Colors.black54,), 23 | margin: const EdgeInsets.only(right: 26.0), 24 | ), 25 | new Expanded( 26 | child: new Container( 27 | child: new Text("Search for content",style: TextStyle(color: Colors.black54),), 28 | ) 29 | ), 30 | new Container( 31 | child: new FlatButton( 32 | onPressed: (){}, 33 | child: new Icon(Icons.settings_overscan, size: 18.0,color: Colors.black54,), 34 | ), 35 | width: 40.0, 36 | ), 37 | ], 38 | ) 39 | ), 40 | decoration: new BoxDecoration( 41 | borderRadius: const BorderRadius.all(const Radius.circular(4.0)), 42 | color: GlobalConfig.searchBackgroundColor 43 | ) 44 | ); 45 | } 46 | } -------------------------------------------------------------------------------- /lib/mainuipages/my/widgets/infocard.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../../mainuipages/global_config.dart'; 3 | 4 | 5 | class InfoCard extends StatelessWidget{ 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | // TODO: implement build 10 | return new Container( 11 | color: GlobalConfig.cardBackgroundColor, 12 | margin: const EdgeInsets.only(top: 10.0, bottom: 6.0), 13 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0), 14 | child: new Column( 15 | children: [ 16 | new Container( 17 | margin: const EdgeInsets.only(left: 16.0, right: 16.0, bottom: 16.0), 18 | decoration: new BoxDecoration( 19 | color: GlobalConfig.dark == true ? Colors.white10 : new Color(0xFFF5F5F5), 20 | borderRadius: new BorderRadius.all(new Radius.circular(6.0)) 21 | ), 22 | child: new FlatButton( 23 | onPressed: (){}, 24 | child: new Container( 25 | child: new ListTile( 26 | leading: new Container( 27 | child: new CircleAvatar( 28 | backgroundImage: new NetworkImage("https://pic1.zhimg.com/v2-ec7ed574da66e1b495fcad2cc3d71cb9_xl.jpg"), 29 | radius: 20.0 30 | ), 31 | ), 32 | title: new Container( 33 | margin: const EdgeInsets.only(bottom: 2.0), 34 | child: new Text("learner"), 35 | ), 36 | subtitle: new Container( 37 | margin: const EdgeInsets.only(top: 2.0), 38 | child: new Text("View or edit your profile"), 39 | ), 40 | ), 41 | ) 42 | ), 43 | ), 44 | new Container( 45 | child: new Row( 46 | mainAxisAlignment: MainAxisAlignment.center, 47 | children: [ 48 | new Container( 49 | width: (MediaQuery.of(context).size.width - 6.0) / 4, 50 | child: new FlatButton ( 51 | onPressed: (){}, 52 | child: new Container( 53 | height: 50.0, 54 | child: new Column( 55 | children: [ 56 | new Container( 57 | child: new Text("57", style: new TextStyle(fontSize: 16.0, color: GlobalConfig.fontColor),), 58 | ), 59 | new Container( 60 | child: new Text("My creation", style: new TextStyle(fontSize: 12.0, color: GlobalConfig.fontColor),), 61 | ), 62 | ], 63 | ), 64 | ) 65 | ), 66 | ), 67 | new Container( 68 | height: 14.0, 69 | width: 1.0, 70 | decoration: new BoxDecoration( 71 | border: new BorderDirectional( 72 | start: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12, width: 1.0) 73 | ) 74 | ), 75 | ), 76 | new Container( 77 | width: (MediaQuery.of(context).size.width - 6.0) / 4, 78 | child: new FlatButton( 79 | onPressed: (){}, 80 | child: new Container( 81 | height: 50.0, 82 | child: new Column( 83 | children: [ 84 | new Container( 85 | child: new Text("210", style: new TextStyle(fontSize: 16.0, color: GlobalConfig.fontColor),), 86 | ), 87 | new Container( 88 | child: new Text("attention", style: new TextStyle(fontSize: 12.0, color: GlobalConfig.fontColor),), 89 | ) 90 | ], 91 | ), 92 | ) 93 | ), 94 | ), 95 | new Container( 96 | height: 14.0, 97 | width: 1.0, 98 | decoration: new BoxDecoration( 99 | border: new BorderDirectional( 100 | start: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12, width: 1.0) 101 | ) 102 | ), 103 | ), 104 | new Container( 105 | width: (MediaQuery.of(context).size.width - 6.0) / 4, 106 | child: new FlatButton( 107 | onPressed: (){}, 108 | child: new Container( 109 | height: 50.0, 110 | child: new Column( 111 | children: [ 112 | new Container( 113 | child: new Text("18", style: new TextStyle(fontSize: 16.0, color: GlobalConfig.fontColor),), 114 | ), 115 | new Container( 116 | child: new Text("my collection", style: new TextStyle(fontSize: 12.0, color: GlobalConfig.fontColor),), 117 | ) 118 | ], 119 | ), 120 | ) 121 | ), 122 | ), 123 | new Container( 124 | height: 14.0, 125 | width: 1.0, 126 | decoration: new BoxDecoration( 127 | border: new BorderDirectional( 128 | start: new BorderSide(color: GlobalConfig.dark == true ? Colors.white12 : Colors.black12, width: 1.0) 129 | ) 130 | ), 131 | ), 132 | new Container( 133 | width: (MediaQuery.of(context).size.width - 6.0) / 4, 134 | child: new FlatButton( 135 | onPressed: (){}, 136 | child: new Container( 137 | height: 50.0, 138 | child: new Column( 139 | children: [ 140 | new Container( 141 | child: new Text("33", style: new TextStyle(fontSize: 16.0, color: GlobalConfig.fontColor),), 142 | ), 143 | new Container( 144 | child: new Text("Recently Viewed", style: new TextStyle(fontSize: 12.0, color: GlobalConfig.fontColor),), 145 | ) 146 | ], 147 | ), 148 | ) 149 | ) 150 | ) 151 | ], 152 | ), 153 | ) 154 | ], 155 | ), 156 | ); 157 | } 158 | } -------------------------------------------------------------------------------- /lib/mainuipages/my/widgets/settingcard.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../../mainuipages/global_config.dart'; 3 | 4 | 5 | class SettingCard extends StatefulWidget { 6 | @override 7 | State createState() { 8 | return _SettingState(); 9 | } 10 | } 11 | class _SettingState extends State{ 12 | @override 13 | Widget build(BuildContext context) { 14 | // TODO: implement build 15 | return new Container( 16 | color: GlobalConfig.cardBackgroundColor, 17 | margin: const EdgeInsets.only(top: 6.0, bottom: 6.0), 18 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0), 19 | child: new Row( 20 | mainAxisAlignment: MainAxisAlignment.start, 21 | children: [ 22 | new Container( 23 | width: MediaQuery.of(context).size.width / 4, 24 | child: new FlatButton( 25 | onPressed: (){}, 26 | child: new Container( 27 | child: new Column( 28 | children: [ 29 | new Container( 30 | margin: const EdgeInsets.only(bottom: 6.0), 31 | child: new CircleAvatar( 32 | radius: 20.0, 33 | child: new Icon(Icons.invert_colors, color: Colors.white), 34 | backgroundColor: new Color(0xFFB88800), 35 | ), 36 | ), 37 | new Container( 38 | child: new Text("Community Building", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0)), 39 | ) 40 | ], 41 | ), 42 | ) 43 | ), 44 | ), 45 | new Container( 46 | width: MediaQuery.of(context).size.width / 4, 47 | child: new FlatButton( 48 | onPressed: () => {}, 49 | child: new Container( 50 | child: new Column( 51 | children: [ 52 | new Container( 53 | margin: const EdgeInsets.only(bottom: 6.0), 54 | child: new CircleAvatar( 55 | radius: 20.0, 56 | child: new Icon(Icons.golf_course, color: Colors.white), 57 | backgroundColor: new Color(0xFF63616D), 58 | ), 59 | ), 60 | new Container( 61 | child: new Text("Feedback", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0,)), 62 | ) 63 | ], 64 | ), 65 | ) 66 | ), 67 | ), 68 | new Container( 69 | width: MediaQuery.of(context).size.width / 4, 70 | child: new FlatButton( 71 | onPressed: (){ 72 | setState((){ 73 | if (GlobalConfig.dark == true) { 74 | GlobalConfig.themeData = new ThemeData( 75 | primaryColor: Colors.cyan, 76 | scaffoldBackgroundColor: new Color(0xFFEBEBEB), 77 | ); 78 | GlobalConfig.searchBackgroundColor = new Color(0xFFEBEBEB); 79 | GlobalConfig.cardBackgroundColor = Colors.white; 80 | GlobalConfig.fontColor = Colors.black54; 81 | GlobalConfig.dark = false; 82 | } else { 83 | GlobalConfig.themeData = new ThemeData.dark(); 84 | GlobalConfig.searchBackgroundColor = Colors.white10; 85 | GlobalConfig.cardBackgroundColor = new Color(0xFF222222); 86 | GlobalConfig.fontColor = Colors.white30; 87 | GlobalConfig.dark = true; 88 | } 89 | }); 90 | }, 91 | child: new Container( 92 | child: new Column( 93 | children: [ 94 | new Container( 95 | margin: const EdgeInsets.only(bottom: 6.0), 96 | child: new CircleAvatar( 97 | radius: 20.0, 98 | child: new Icon(GlobalConfig.dark == true ? Icons.wb_sunny : Icons.brightness_2, color: Colors.white), 99 | backgroundColor: new Color(0xFFB86A0D), 100 | ), 101 | ), 102 | new Container( 103 | child: new Text(GlobalConfig.dark == true ? "Day mode" : "Night mode", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0)), 104 | ) 105 | ], 106 | ), 107 | ) 108 | ), 109 | ), 110 | new Container( 111 | width: MediaQuery.of(context).size.width / 4, 112 | child: new FlatButton( 113 | onPressed: (){}, 114 | child: new Container( 115 | child: new Column( 116 | children: [ 117 | new Container( 118 | margin: const EdgeInsets.only(bottom: 6.0), 119 | child: new CircleAvatar( 120 | radius: 20.0, 121 | child: new Icon(Icons.perm_data_setting, color: Colors.white), 122 | backgroundColor: new Color(0xFF636269), 123 | ), 124 | ), 125 | new Container( 126 | child: new Text("Setting", style: new TextStyle(color: GlobalConfig.fontColor, fontSize: 14.0)), 127 | ) 128 | ], 129 | ), 130 | ) 131 | ), 132 | ), 133 | ], 134 | ), 135 | ); 136 | } 137 | } -------------------------------------------------------------------------------- /lib/mainuipages/my/widgets/videocard.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import '../../../mainuipages/global_config.dart'; 3 | 4 | 5 | class VideoCard extends StatelessWidget{ 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | // TODO: implement build 10 | return new Container( 11 | color: GlobalConfig.cardBackgroundColor, 12 | margin: const EdgeInsets.only(top: 6.0, bottom: 6.0), 13 | padding: const EdgeInsets.only(top: 12.0, bottom: 8.0), 14 | child: new Column( 15 | children: [ 16 | new Container( 17 | margin: const EdgeInsets.only(left: 16.0, bottom: 20.0), 18 | child: new Row( 19 | children: [ 20 | new Container( 21 | child: new CircleAvatar( 22 | radius: 20.0, 23 | child: new Icon(Icons.videocam, color: Colors.white), 24 | backgroundColor: new Color(0xFFB36905), 25 | ), 26 | ), 27 | new Expanded( 28 | child: new Container( 29 | margin: const EdgeInsets.only(left: 8.0), 30 | child: new Text("Video creation", style: new TextStyle(fontSize: 18.0),), 31 | ), 32 | ), 33 | new Container( 34 | child: new FlatButton( 35 | onPressed: (){}, 36 | child: new Text("Take one", style: new TextStyle(color: Colors.blue),) 37 | ), 38 | ) 39 | ], 40 | ) 41 | ), 42 | new Container( 43 | margin: const EdgeInsets.only(left: 16.0), 44 | child: new SingleChildScrollView( 45 | scrollDirection: Axis.horizontal, 46 | child: new Row( 47 | children: [ 48 | new Container( 49 | width: MediaQuery.of(context).size.width / 2.5, 50 | margin: const EdgeInsets.only(right: 6.0), 51 | child: new AspectRatio( 52 | aspectRatio: 4.0 / 2.0, 53 | child: new Container( 54 | foregroundDecoration:new BoxDecoration( 55 | image: new DecorationImage( 56 | image: new NetworkImage("https://pic2.zhimg.com/50/v2-5942a51e6b834f10074f8d50be5bbd4d_400x224.jpg"), 57 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 58 | ), 59 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 60 | ), 61 | ) 62 | ) 63 | ), 64 | new Container( 65 | margin: const EdgeInsets.only(right: 6.0), 66 | width: MediaQuery.of(context).size.width / 2.5, 67 | child: new AspectRatio( 68 | aspectRatio: 4.0 / 2.0, 69 | child: new Container( 70 | foregroundDecoration:new BoxDecoration( 71 | image: new DecorationImage( 72 | image: new NetworkImage("https://pic3.zhimg.com/50/v2-7fc9a1572c6fc72a3dea0b73a9be36e7_400x224.jpg"), 73 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 74 | ), 75 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 76 | ), 77 | ) 78 | ) 79 | ), 80 | new Container( 81 | margin: const EdgeInsets.only(right: 6.0), 82 | width: MediaQuery.of(context).size.width / 2.5, 83 | child: new AspectRatio( 84 | aspectRatio: 4.0 / 2.0, 85 | child: new Container( 86 | foregroundDecoration:new BoxDecoration( 87 | image: new DecorationImage( 88 | image: new NetworkImage("https://pic4.zhimg.com/50/v2-898f43a488b606061c877ac2a471e221_400x224.jpg"), 89 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 90 | ), 91 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 92 | ), 93 | ) 94 | ) 95 | ), 96 | new Container( 97 | width: MediaQuery.of(context).size.width / 2.5, 98 | child: new AspectRatio( 99 | aspectRatio: 4.0 / 2.0, 100 | child: new Container( 101 | foregroundDecoration:new BoxDecoration( 102 | image: new DecorationImage( 103 | image: new NetworkImage("https://pic1.zhimg.com/50/v2-0008057d1ad2bd813aea4fc247959e63_400x224.jpg"), 104 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 105 | ), 106 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 107 | ), 108 | ) 109 | ) 110 | ) 111 | ], 112 | ), 113 | ), 114 | ) 115 | ], 116 | ) 117 | ); 118 | } 119 | } -------------------------------------------------------------------------------- /lib/mainuipages/notice/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../global_config.dart'; 4 | 5 | 6 | class NoticePage extends StatelessWidget { 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | // TODO: implement build 11 | return new MaterialApp( 12 | home: new Scaffold( 13 | body: new AppBar( 14 | 15 | title: Text('notice page'), 16 | 17 | ) 18 | ), 19 | theme: GlobalConfig.themeData 20 | ); 21 | } 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /lib/mainuipages/pages/auth.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:scoped_model/scoped_model.dart'; 4 | 5 | import '../../widgets/ui_elements/adapative_progress_indicator.dart'; 6 | import '../../scopedmodel/main.dart'; 7 | import '../../models/auth.dart'; 8 | 9 | class AuthPage extends StatefulWidget { 10 | @override 11 | State createState() { 12 | return _AuthPageState(); 13 | } 14 | } 15 | 16 | class _AuthPageState extends State with TickerProviderStateMixin { 17 | final Map _formData = { 18 | 'email': null, 19 | 'password': null, 20 | 'acceptTerms': false 21 | }; 22 | final GlobalKey _formKey = GlobalKey(); 23 | final TextEditingController _passwordTextController = TextEditingController(); 24 | AuthMode _authMode = AuthMode.Login; 25 | AnimationController _controller; 26 | Animation _slideAnimation; 27 | 28 | void initState() { 29 | _controller = AnimationController( 30 | vsync: this, 31 | duration: Duration(milliseconds: 300), 32 | ); 33 | _slideAnimation = 34 | Tween(begin: Offset(0.0, -1.5), end: Offset.zero).animate( 35 | CurvedAnimation(parent: _controller, curve: Curves.fastOutSlowIn), 36 | ); 37 | super.initState(); 38 | } 39 | 40 | DecorationImage _buildBackgroundImage() { 41 | return DecorationImage( 42 | fit: BoxFit.cover, 43 | colorFilter: 44 | ColorFilter.mode(Colors.black.withOpacity(0.5), BlendMode.dstATop), 45 | image: AssetImage('assets/background.jpg'), 46 | ); 47 | } 48 | 49 | Widget _buildEmailTextField() { 50 | return TextFormField( 51 | decoration: InputDecoration( 52 | labelText: 'E-Mail', filled: true, fillColor: Colors.white), 53 | keyboardType: TextInputType.emailAddress, 54 | validator: (String value) { 55 | if (value.isEmpty || 56 | !RegExp(r"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?") 57 | .hasMatch(value)) { 58 | return 'Please enter a valid email'; 59 | } 60 | }, 61 | onSaved: (String value) { 62 | _formData['email'] = value; 63 | }, 64 | ); 65 | } 66 | 67 | Widget _buildPasswordTextField() { 68 | return TextFormField( 69 | decoration: InputDecoration( 70 | labelText: 'Password', filled: true, fillColor: Colors.white), 71 | obscureText: true, 72 | controller: _passwordTextController, 73 | validator: (String value) { 74 | if (value.isEmpty || value.length < 6) { 75 | return 'Password invalid'; 76 | } 77 | }, 78 | onSaved: (String value) { 79 | _formData['password'] = value; 80 | }, 81 | ); 82 | } 83 | 84 | Widget _buildPasswordConfirmTextField() { 85 | return FadeTransition( 86 | opacity: CurvedAnimation(parent: _controller, curve: Curves.easeIn), 87 | child: SlideTransition( 88 | position: _slideAnimation, 89 | child: TextFormField( 90 | decoration: InputDecoration( 91 | labelText: 'Confirm Password', 92 | filled: true, 93 | fillColor: Colors.white), 94 | obscureText: true, 95 | validator: (String value) { 96 | if (_passwordTextController.text != value && 97 | _authMode == AuthMode.Signup) { 98 | return 'Passwords do not match.'; 99 | } 100 | }, 101 | ), 102 | ), 103 | ); 104 | } 105 | 106 | Widget _buildAcceptSwitch() { 107 | return SwitchListTile( 108 | value: _formData['acceptTerms'], 109 | onChanged: (bool value) { 110 | setState(() { 111 | _formData['acceptTerms'] = value; 112 | }); 113 | }, 114 | title: Text('Accept Terms'), 115 | ); 116 | } 117 | 118 | void _submitForm(Function authenticate) async { 119 | if (!_formKey.currentState.validate() || !_formData['acceptTerms']) { 120 | return; 121 | } 122 | _formKey.currentState.save(); 123 | Map successInformation; 124 | successInformation = await authenticate( 125 | _formData['email'], _formData['password'], _authMode); 126 | if (successInformation['success']) { 127 | // Navigator.pushReplacementNamed(context, '/'); 128 | } else { 129 | showDialog( 130 | context: context, 131 | builder: (BuildContext context) { 132 | return AlertDialog( 133 | title: Text('An Error Occurred!'), 134 | content: Text(successInformation['message']), 135 | actions: [ 136 | FlatButton( 137 | child: Text('Okay'), 138 | onPressed: () { 139 | Navigator.of(context).pop(); 140 | }, 141 | ) 142 | ], 143 | ); 144 | }, 145 | ); 146 | } 147 | } 148 | 149 | @override 150 | Widget build(BuildContext context) { 151 | final double deviceWidth = MediaQuery.of(context).size.width; 152 | final double targetWidth = deviceWidth > 550.0 ? 500.0 : deviceWidth * 0.95; 153 | return Scaffold( 154 | appBar: AppBar( 155 | title: Text('Login'), 156 | ), 157 | body: Container( 158 | decoration: BoxDecoration( 159 | image: _buildBackgroundImage(), 160 | ), 161 | padding: EdgeInsets.all(10.0), 162 | child: Center( 163 | child: SingleChildScrollView( 164 | child: Container( 165 | width: targetWidth, 166 | child: Form( 167 | key: _formKey, 168 | child: Column( 169 | children: [ 170 | _buildEmailTextField(), 171 | SizedBox( 172 | height: 10.0, 173 | ), 174 | _buildPasswordTextField(), 175 | SizedBox( 176 | height: 10.0, 177 | ), 178 | _buildPasswordConfirmTextField(), 179 | _buildAcceptSwitch(), 180 | SizedBox( 181 | height: 10.0, 182 | ), 183 | FlatButton( 184 | child: Text( 185 | 'Switch to ${_authMode == AuthMode.Login ? 'Signup' : 'Login'}'), 186 | onPressed: () { 187 | if (_authMode == AuthMode.Login) { 188 | setState(() { 189 | _authMode = AuthMode.Signup; 190 | }); 191 | _controller.forward(); 192 | } else { 193 | setState(() { 194 | _authMode = AuthMode.Login; 195 | }); 196 | _controller.reverse(); 197 | } 198 | }, 199 | ), 200 | SizedBox( 201 | height: 10.0, 202 | ), 203 | ScopedModelDescendant( 204 | builder: (BuildContext context, Widget child, 205 | MainModel model) { 206 | return model.isLoading 207 | ? AdaptiveProgressIndicator() 208 | : RaisedButton( 209 | textColor: Colors.white, 210 | child: Text(_authMode == AuthMode.Login 211 | ? 'LOGIN' 212 | : 'SIGNUP'), 213 | onPressed: () => 214 | _submitForm(model.authenticate), 215 | ); 216 | }, 217 | ), 218 | ], 219 | ), 220 | ), 221 | ), 222 | ), 223 | ), 224 | ), 225 | ); 226 | } 227 | } 228 | -------------------------------------------------------------------------------- /lib/mainuipages/pages/product.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'package:flutter/material.dart'; 3 | import '../../widgets/ui_elements/title_default.dart'; 4 | import '../../widgets/products/product_fab.dart'; 5 | import '../../models/attributes.dart'; 6 | 7 | 8 | class ProductPage extends StatelessWidget { 9 | final Product product; 10 | 11 | ProductPage(this.product); 12 | 13 | 14 | 15 | Widget _buildAddressPriceRow(double price) { 16 | return Row( 17 | mainAxisAlignment: MainAxisAlignment.center, 18 | children: [ 19 | GestureDetector( 20 | onTap:(){}, 21 | child: Text( 22 | 'address', 23 | style: TextStyle(fontFamily: 'Oswald', color: Colors.grey), 24 | ), 25 | ), 26 | Container( 27 | margin: EdgeInsets.symmetric(horizontal: 5.0), 28 | child: Text( 29 | '|', 30 | style: TextStyle(color: Colors.grey), 31 | ), 32 | ), 33 | Text( 34 | '\$' + price.toString(), 35 | style: TextStyle(fontFamily: 'Oswald', color: Colors.grey), 36 | ) 37 | ], 38 | ); 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | return WillPopScope( 44 | onWillPop: () { 45 | print('Back button pressed!'); 46 | Navigator.pop(context, false); 47 | return Future.value(false); 48 | }, 49 | child: Scaffold( 50 | // appBar: AppBar( 51 | // title: Text(product.title), 52 | // ), 53 | body: CustomScrollView( 54 | slivers: [ 55 | SliverAppBar( 56 | expandedHeight: 256.0, 57 | pinned: true, 58 | flexibleSpace: FlexibleSpaceBar( 59 | title: Text(product.title), 60 | background: Hero( 61 | tag: product.id, 62 | child: FadeInImage( 63 | image: NetworkImage(product.image), 64 | height: 300.0, 65 | fit: BoxFit.cover, 66 | placeholder: AssetImage('assets/food.jpg'), 67 | ), 68 | ), 69 | ), 70 | ), 71 | SliverList( 72 | delegate: SliverChildListDelegate( 73 | [ 74 | Container( 75 | padding: EdgeInsets.all(10.0), 76 | alignment: Alignment.center, 77 | child: TitleDefault(product.title), 78 | ), 79 | _buildAddressPriceRow(product.price), 80 | Container( 81 | padding: EdgeInsets.all(10.0), 82 | child: Text( 83 | product.description, 84 | textAlign: TextAlign.center, 85 | ), 86 | ) 87 | ], 88 | ), 89 | ) 90 | ], 91 | ), 92 | floatingActionButton: ProductFAB(product), 93 | ), 94 | ); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/mainuipages/pages/product_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:scoped_model/scoped_model.dart'; 4 | 5 | import './product_edit.dart'; 6 | import '../../scopedmodel/main.dart'; 7 | 8 | class ProductListPage extends StatefulWidget { 9 | final MainModel model; 10 | 11 | ProductListPage(this.model); 12 | 13 | @override 14 | State createState() { 15 | return _ProductListPageState(); 16 | } 17 | } 18 | 19 | class _ProductListPageState extends State { 20 | @override 21 | initState() { 22 | widget.model.fetchProducts(onlyForUser: true, clearExisting: true); 23 | super.initState(); 24 | } 25 | 26 | Widget _buildEditButton(BuildContext context, int index, MainModel model) { 27 | return IconButton( 28 | icon: Icon(Icons.edit), 29 | onPressed: () { 30 | model.selectProduct(model.allProducts[index].id); 31 | Navigator.of(context).push( 32 | MaterialPageRoute( 33 | builder: (BuildContext context) { 34 | return ProductEditPage(); 35 | }, 36 | ), 37 | ).then((_) { 38 | model.selectProduct(null); 39 | }); 40 | }, 41 | ); 42 | } 43 | 44 | @override 45 | Widget build(BuildContext context) { 46 | return ScopedModelDescendant( 47 | builder: (BuildContext context, Widget child, MainModel model) { 48 | return ListView.builder( 49 | itemBuilder: (BuildContext context, int index) { 50 | return Dismissible( 51 | key: Key(model.allProducts[index].title), 52 | onDismissed: (DismissDirection direction) { 53 | if (direction == DismissDirection.endToStart) { 54 | model.selectProduct(model.allProducts[index].id); 55 | model.deleteProduct(); 56 | } else if (direction == DismissDirection.startToEnd) { 57 | print('Swiped start to end'); 58 | } else { 59 | print('Other swiping'); 60 | } 61 | }, 62 | background: Container(color: Colors.red), 63 | child: Column( 64 | children: [ 65 | ListTile( 66 | leading: CircleAvatar( 67 | backgroundImage: 68 | NetworkImage(model.allProducts[index].image), 69 | ), 70 | title: Text(model.allProducts[index].title), 71 | subtitle: 72 | Text('\$${model.allProducts[index].price.toString()}'), 73 | trailing: _buildEditButton(context, index, model), 74 | ), 75 | Divider() 76 | ], 77 | ), 78 | ); 79 | }, 80 | itemCount: model.allProducts.length, 81 | ); 82 | }, 83 | ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /lib/mainuipages/pages/products.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:scoped_model/scoped_model.dart'; 4 | 5 | import '../../widgets/products/products.dart'; 6 | import '../../widgets/ui_elements/logout_list_tile.dart'; 7 | import '../../scopedmodel/main.dart'; 8 | 9 | class ProductsPage extends StatefulWidget { 10 | final MainModel model; 11 | 12 | ProductsPage(this.model); 13 | 14 | @override 15 | State createState() { 16 | return _ProductsPageState(); 17 | } 18 | } 19 | 20 | class _ProductsPageState extends State { 21 | @override 22 | initState() { 23 | 24 | widget.model.fetchProducts(); 25 | super.initState(); 26 | } 27 | 28 | Widget _buildSideDrawer(BuildContext context) { 29 | return Drawer( 30 | child: Column( 31 | children: [ 32 | AppBar( 33 | automaticallyImplyLeading: false, 34 | title: Text('Choose'), 35 | elevation: 36 | Theme.of(context).platform == TargetPlatform.iOS ? 0.0 : 4.0, 37 | ), 38 | ListTile( 39 | leading: Icon(Icons.edit), 40 | title: Text('Manage Products'), 41 | onTap: () { 42 | Navigator.pushReplacementNamed(context, '/admin'); 43 | }, 44 | ), 45 | Divider(), 46 | LogoutListTile() 47 | ], 48 | ), 49 | ); 50 | } 51 | 52 | Widget _buildProductsList() { 53 | return ScopedModelDescendant( 54 | builder: (BuildContext context, Widget child, MainModel model) { 55 | Widget content = Center(child: Text('No Products Found!')); 56 | if (model.displayedProducts.length > 0 && !model.isLoading) { 57 | content = Products(); 58 | } else if (model.isLoading) { 59 | content = Center(child: CircularProgressIndicator()); 60 | } 61 | return RefreshIndicator( 62 | onRefresh: model.fetchProducts, 63 | child: content, 64 | ); 65 | }, 66 | ); 67 | } 68 | 69 | @override 70 | Widget build(BuildContext context) { 71 | return Scaffold( 72 | drawer: _buildSideDrawer(context), 73 | appBar: AppBar( 74 | title: Text('EasyList'), 75 | elevation: Theme.of(context).platform == TargetPlatform.iOS ? 0.0 : 4.0, 76 | actions: [ 77 | ScopedModelDescendant( 78 | builder: (BuildContext context, Widget child, MainModel model) { 79 | return IconButton( 80 | icon: Icon(model.displayFavoritesOnly 81 | ? Icons.favorite 82 | : Icons.favorite_border), 83 | onPressed: () { 84 | model.toggleDisplayMode(); 85 | }, 86 | ); 87 | }, 88 | ) 89 | ], 90 | ), 91 | body: _buildProductsList(), 92 | ); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /lib/mainuipages/pages/products_admin.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import './product_edit.dart'; 4 | import './product_list.dart'; 5 | import '../../widgets/ui_elements/logout_list_tile.dart'; 6 | import '../../scopedmodel/main.dart'; 7 | 8 | class ProductsAdminPage extends StatelessWidget { 9 | final MainModel model; 10 | 11 | ProductsAdminPage(this.model); 12 | 13 | Widget _buildSideDrawer(BuildContext context) { 14 | return Drawer( 15 | child: Column( 16 | children: [ 17 | AppBar( 18 | automaticallyImplyLeading: false, 19 | title: Text('Choose'), 20 | elevation: 21 | Theme.of(context).platform == TargetPlatform.iOS ? 0.0 : 4.0, 22 | ), 23 | ListTile( 24 | leading: Icon(Icons.shop), 25 | title: Text('All Products'), 26 | onTap: () { 27 | Navigator.pushReplacementNamed(context, '/'); 28 | }, 29 | ), 30 | Divider(), 31 | LogoutListTile() 32 | ], 33 | ), 34 | ); 35 | } 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | return DefaultTabController( 40 | length: 2, 41 | child: Scaffold( 42 | drawer: _buildSideDrawer(context), 43 | appBar: AppBar( 44 | title: Text('Manage Products'), 45 | elevation: 46 | Theme.of(context).platform == TargetPlatform.iOS ? 0.0 : 4.0, 47 | bottom: TabBar( 48 | tabs: [ 49 | Tab( 50 | icon: Icon(Icons.create), 51 | text: 'Create Product', 52 | ), 53 | Tab( 54 | icon: Icon(Icons.list), 55 | text: 'My Products', 56 | ), 57 | ], 58 | ), 59 | ), 60 | body: TabBarView( 61 | children: [ProductEditPage(), ProductListPage(model)], 62 | ), 63 | ), 64 | ); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /lib/models/attributes.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import './location_data.dart'; 4 | 5 | class Product { 6 | final String id; 7 | final String title; 8 | final String description; 9 | final double price; 10 | final String image; 11 | final String imagePath; 12 | final bool isFavorite; 13 | final String userEmail; 14 | final String userId; 15 | final String comment; 16 | 17 | Product( 18 | {@required this.id, 19 | @required this.title, 20 | @required this.description, 21 | @required this.price, 22 | @required this.image, 23 | @required this.userEmail, 24 | @required this.userId, 25 | @required this.imagePath, 26 | this.isFavorite = false, 27 | this.comment}); 28 | } 29 | -------------------------------------------------------------------------------- /lib/models/auth.dart: -------------------------------------------------------------------------------- 1 | enum AuthMode { 2 | Signup, 3 | Login 4 | } -------------------------------------------------------------------------------- /lib/models/location_data.dart: -------------------------------------------------------------------------------- 1 | class LocationData { 2 | final double latitude; 3 | final double longitude; 4 | final String address; 5 | 6 | LocationData({this.latitude, this.longitude, this.address}); 7 | } -------------------------------------------------------------------------------- /lib/models/user.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class User { 4 | final String id; 5 | final String email; 6 | final String token; 7 | 8 | User({@required this.id, @required this.email, @required this.token}); 9 | } 10 | -------------------------------------------------------------------------------- /lib/onboarding/data.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | var pageList = [ 4 | PageModel( 5 | imageUrl: "assets/illustration.png", 6 | title: "MUSIC", 7 | body: "EXPERIENCE WICKED PLAYLISTS", 8 | titleGradient: gradients[0]), 9 | PageModel( 10 | imageUrl: "assets/illustration2.png", 11 | title: "SPA", 12 | body: "FEEL THE MAGIC OF WELLNESS", 13 | titleGradient: gradients[1]), 14 | PageModel( 15 | imageUrl: "assets/illustration3.png", 16 | title: "TRAVEL", 17 | body: "LET'S HIKE UP", 18 | titleGradient: gradients[2]), 19 | ]; 20 | 21 | List> gradients = [ 22 | [Color(0xFF9708CC), Color(0xFF43CBFF)], 23 | [Color(0xFFE2859F), Color(0xFFFCCF31)], 24 | [Color(0xFF5EFCE8), Color(0xFF736EFE)], 25 | ]; 26 | 27 | class PageModel { 28 | var imageUrl; 29 | var title; 30 | var body; 31 | List titleGradient = []; 32 | PageModel({this.imageUrl, this.title, this.body, this.titleGradient}); 33 | } 34 | -------------------------------------------------------------------------------- /lib/onboarding/onboard.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import './data.dart'; 3 | import './page_indicator.dart'; 4 | import 'package:gradient_text/gradient_text.dart'; 5 | 6 | import 'package:shared_preferences/shared_preferences.dart'; 7 | 8 | class OnBoard extends StatefulWidget { 9 | @override 10 | _MyOnBoardState createState() => new _MyOnBoardState(); 11 | } 12 | 13 | class _MyOnBoardState extends State with TickerProviderStateMixin { 14 | PageController _controller; 15 | int currentPage = 0; 16 | bool lastPage = false; 17 | AnimationController animationController; 18 | Animation _scaleAnimation; 19 | 20 | @override 21 | void initState() { 22 | super.initState(); 23 | _controller = PageController( 24 | initialPage: currentPage, 25 | ); 26 | animationController = 27 | AnimationController(duration: Duration(milliseconds: 300), vsync: this); 28 | _scaleAnimation = Tween(begin: 0.6, end: 1.0).animate(animationController); 29 | } 30 | 31 | @override 32 | void dispose() { 33 | _controller.dispose(); 34 | super.dispose(); 35 | } 36 | Future checkFirstSeen() async { 37 | SharedPreferences prefs = await SharedPreferences.getInstance(); 38 | bool _seen = (prefs.getBool('seen') ?? false); 39 | 40 | if (_seen) { 41 | Navigator.pushNamed(context, '/login'); 42 | } else { 43 | prefs.setBool('seen', true); 44 | Navigator.pushNamed(context, '/'); 45 | } 46 | } 47 | @override 48 | Widget build(BuildContext context) { 49 | return Container( 50 | decoration: BoxDecoration( 51 | gradient: LinearGradient( 52 | colors: [Color(0xFF485563), Color(0xFF29323C)], 53 | tileMode: TileMode.clamp, 54 | begin: Alignment.topCenter, 55 | stops: [0.0, 1.0], 56 | end: Alignment.bottomCenter), 57 | ), 58 | child: Scaffold( 59 | backgroundColor: Colors.transparent, 60 | body: new Stack( 61 | fit: StackFit.expand, 62 | children: [ 63 | PageView.builder( 64 | itemCount: pageList.length, 65 | controller: _controller, 66 | onPageChanged: (index) { 67 | setState(() { 68 | currentPage = index; 69 | if (currentPage == pageList.length - 1) { 70 | lastPage = true; 71 | animationController.forward(); 72 | } else { 73 | lastPage = false; 74 | animationController.reset(); 75 | } 76 | print(lastPage); 77 | }); 78 | }, 79 | itemBuilder: (context, index) { 80 | return AnimatedBuilder( 81 | animation: _controller, 82 | builder: (context, child) { 83 | var page = pageList[index]; 84 | var delta; 85 | var y = 1.0; 86 | 87 | if (_controller.position.haveDimensions) { 88 | delta = _controller.page - index; 89 | y = 1 - delta.abs().clamp(0.0, 1.0); 90 | } 91 | return Column( 92 | mainAxisAlignment: MainAxisAlignment.center, 93 | crossAxisAlignment: CrossAxisAlignment.start, 94 | mainAxisSize: MainAxisSize.min, 95 | children: [ 96 | Image.asset(page.imageUrl), 97 | Container( 98 | margin: EdgeInsets.only(left: 12.0), 99 | height: 100.0, 100 | child: Stack( 101 | children: [ 102 | Opacity( 103 | opacity: .10, 104 | child: GradientText( 105 | page.title, 106 | gradient: LinearGradient( 107 | colors: pageList[index].titleGradient), 108 | style: TextStyle( 109 | fontSize: 100.0, 110 | fontFamily: "Montserrat-Black", 111 | letterSpacing: 1.0), 112 | ), 113 | ), 114 | Padding( 115 | padding: EdgeInsets.only(top: 30.0, left: 22.0), 116 | child: GradientText( 117 | page.title, 118 | gradient: LinearGradient( 119 | colors: pageList[index].titleGradient), 120 | style: TextStyle( 121 | fontSize: 70.0, 122 | fontFamily: "Montserrat-Black", 123 | ), 124 | ), 125 | ), 126 | ], 127 | ), 128 | ), 129 | Padding( 130 | padding: const EdgeInsets.only(left: 34.0, top: 12.0), 131 | child: Transform( 132 | transform: 133 | Matrix4.translationValues(0, 50.0 * (1 - y), 0), 134 | child: Text( 135 | page.body, 136 | style: TextStyle( 137 | fontSize: 20.0, 138 | fontFamily: "Montserrat-Medium", 139 | color: Color(0xFF9B9B9B)), 140 | ), 141 | ), 142 | ) 143 | ], 144 | ); 145 | }, 146 | ); 147 | }, 148 | ), 149 | Positioned( 150 | left: 30.0, 151 | bottom: 55.0, 152 | child: Container( 153 | width: 160.0, 154 | child: PageIndicator(currentPage, pageList.length)), 155 | ), 156 | Positioned( 157 | right: 30.0, 158 | bottom: 30.0, 159 | child: ScaleTransition( 160 | scale: _scaleAnimation, 161 | child: lastPage 162 | ? FloatingActionButton( 163 | backgroundColor: Colors.white, 164 | child: Icon( 165 | Icons.arrow_forward, 166 | color: Colors.black, 167 | ), 168 | onPressed: () { 169 | checkFirstSeen(); 170 | }, 171 | ) 172 | : Container(), 173 | ), 174 | ), 175 | ], 176 | ), 177 | ), 178 | ); 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /lib/onboarding/page_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class PageIndicator extends StatelessWidget { 4 | final int currentIndex; 5 | final int pageCount; 6 | PageIndicator(this.currentIndex, this.pageCount); 7 | 8 | _indicator(bool isActive) { 9 | return Expanded( 10 | child: Padding( 11 | padding: EdgeInsets.symmetric(horizontal: 4.0), 12 | child: Container( 13 | height: 4.0, 14 | decoration: BoxDecoration( 15 | color: isActive ? Colors.white : Color(0xFF3E4750), 16 | boxShadow: [ 17 | BoxShadow( 18 | color: Colors.black12, 19 | offset: Offset(0.0, 2.0), 20 | blurRadius: 2.0) 21 | ]), 22 | ), 23 | ), 24 | ); 25 | } 26 | 27 | _buildPageIndicators() { 28 | List indicatorList = []; 29 | for (int i = 0; i < pageCount; i++) { 30 | indicatorList 31 | .add(i == currentIndex ? _indicator(true) : _indicator(false)); 32 | } 33 | return indicatorList; 34 | } 35 | 36 | @override 37 | Widget build(BuildContext context) { 38 | return new Row( 39 | children: _buildPageIndicators(), 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /lib/scopedmodel/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:scoped_model/scoped_model.dart'; 2 | 3 | import './connected_process.dart'; 4 | 5 | class MainModel extends Model with ConnectedProductsModel, UserModel, ProductsModel, UtilityModel { 6 | } 7 | -------------------------------------------------------------------------------- /lib/shared/adaptive_theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | final ThemeData _androidTheme = ThemeData( 4 | brightness: Brightness.light, 5 | primarySwatch: Colors.deepOrange, 6 | accentColor: Colors.deepPurple, 7 | buttonColor: Colors.deepPurple, 8 | ); 9 | 10 | final ThemeData _iOSTheme = ThemeData( 11 | brightness: Brightness.light, 12 | primarySwatch: Colors.grey, 13 | accentColor: Colors.blue, 14 | buttonColor: Colors.blue, 15 | ); 16 | 17 | ThemeData getAdaptiveThemeData(context) { 18 | return Theme.of(context).platform == TargetPlatform.android ? _androidTheme : _iOSTheme; 19 | } 20 | -------------------------------------------------------------------------------- /lib/shared/global_config.dart: -------------------------------------------------------------------------------- 1 | final String apiKey = 'AIzaSyCLQTG59usHzrIRrkQwmb8Pzu8OMqsa7ho'; -------------------------------------------------------------------------------- /lib/widgets/form_inputs/image.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | import 'package:image_picker/image_picker.dart'; 6 | 7 | import '../../models/attributes.dart'; 8 | 9 | class ImageInput extends StatefulWidget { 10 | final Function setImage; 11 | final Product product; 12 | 13 | ImageInput(this.setImage, this.product); 14 | 15 | @override 16 | State createState() { 17 | return _ImageInputState(); 18 | } 19 | } 20 | 21 | class _ImageInputState extends State { 22 | File _imageFile; 23 | 24 | void _getImage(BuildContext context, ImageSource source) { 25 | ImagePicker.pickImage(source: source, maxWidth: 400.0).then((File image) { 26 | setState(() { 27 | _imageFile = image; 28 | }); 29 | widget.setImage(image); 30 | Navigator.pop(context); 31 | }); 32 | } 33 | 34 | void _openImagePicker(BuildContext context) { 35 | showModalBottomSheet( 36 | context: context, 37 | builder: (BuildContext context) { 38 | return Container( 39 | height: 150.0, 40 | padding: EdgeInsets.all(10.0), 41 | child: Column(children: [ 42 | Text( 43 | 'Pick an Image', 44 | style: TextStyle(fontWeight: FontWeight.bold), 45 | ), 46 | SizedBox( 47 | height: 10.0, 48 | ), 49 | FlatButton( 50 | textColor: Theme.of(context).primaryColor, 51 | child: Text('Use Camera'), 52 | onPressed: () { 53 | _getImage(context, ImageSource.camera); 54 | }, 55 | ), 56 | FlatButton( 57 | textColor: Theme.of(context).primaryColor, 58 | child: Text('Use Gallery'), 59 | onPressed: () { 60 | _getImage(context, ImageSource.gallery); 61 | }, 62 | ) 63 | ]), 64 | ); 65 | }); 66 | } 67 | 68 | @override 69 | Widget build(BuildContext context) { 70 | final buttonColor = Theme.of(context).primaryColor; 71 | Widget previewImage = Text('Please select an image.'); 72 | if (_imageFile != null) { 73 | previewImage = Image.file( 74 | _imageFile, 75 | fit: BoxFit.cover, 76 | height: 300.0, 77 | width: MediaQuery.of(context).size.width, 78 | alignment: Alignment.topCenter, 79 | ); 80 | } else if (widget.product != null) { 81 | previewImage = Image.network( 82 | widget.product.image, 83 | fit: BoxFit.cover, 84 | height: 300.0, 85 | width: MediaQuery.of(context).size.width, 86 | alignment: Alignment.topCenter, 87 | ); 88 | } 89 | 90 | return Column( 91 | children: [ 92 | OutlineButton( 93 | borderSide: BorderSide( 94 | color: buttonColor, 95 | width: 2.0, 96 | ), 97 | onPressed: () { 98 | _openImagePicker(context); 99 | }, 100 | child: Row( 101 | mainAxisAlignment: MainAxisAlignment.center, 102 | children: [ 103 | Icon( 104 | Icons.camera_alt, 105 | color: buttonColor, 106 | ), 107 | SizedBox( 108 | width: 5.0, 109 | ), 110 | Text( 111 | 'Add Image', 112 | style: TextStyle(color: buttonColor), 113 | ) 114 | ], 115 | ), 116 | ), 117 | SizedBox(height: 10.0), 118 | previewImage 119 | // _imageFile == null 120 | // ? Text('Please pick an image.') 121 | // : 122 | ], 123 | ); 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /lib/widgets/helpers/custom_route.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class CustomRoute extends MaterialPageRoute { 4 | CustomRoute({WidgetBuilder builder, RouteSettings settings}) 5 | : super(builder: builder, settings: settings); 6 | 7 | @override 8 | Widget buildTransitions(BuildContext context, Animation animation, 9 | Animation secondaryAnimation, Widget child) { 10 | if (settings.isInitialRoute) { 11 | return child; 12 | } 13 | return FadeTransition( 14 | opacity: animation, 15 | child: child, 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/widgets/helpers/ensure_visible.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/rendering.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | import 'package:meta/meta.dart'; 6 | 7 | class EnsureVisibleWhenFocused extends StatefulWidget { 8 | const EnsureVisibleWhenFocused({ 9 | Key key, 10 | @required this.child, 11 | @required this.focusNode, 12 | this.curve: Curves.ease, 13 | this.duration: const Duration(milliseconds: 100), 14 | }) : super(key: key); 15 | 16 | /// The node we will monitor to determine if the child is focused 17 | final FocusNode focusNode; 18 | 19 | /// The child widget that we are wrapping 20 | final Widget child; 21 | 22 | /// The curve we will use to scroll ourselves into view. 23 | /// 24 | /// Defaults to Curves.ease. 25 | final Curve curve; 26 | 27 | /// The duration we will use to scroll ourselves into view 28 | /// 29 | /// Defaults to 100 milliseconds. 30 | final Duration duration; 31 | 32 | EnsureVisibleWhenFocusedState createState() => new EnsureVisibleWhenFocusedState(); 33 | } 34 | 35 | class EnsureVisibleWhenFocusedState extends State { 36 | @override 37 | void initState() { 38 | super.initState(); 39 | widget.focusNode.addListener(_ensureVisible); 40 | } 41 | 42 | @override 43 | void dispose() { 44 | super.dispose(); 45 | widget.focusNode.removeListener(_ensureVisible); 46 | } 47 | 48 | Future _ensureVisible() async { 49 | // Wait for the keyboard to come into view 50 | // TODO: position doesn't seem to notify listeners when metrics change, 51 | // perhaps a NotificationListener around the scrollable could avoid 52 | // the need insert a delay here. 53 | await Future.delayed(const Duration(milliseconds: 300)); 54 | 55 | if (!widget.focusNode.hasFocus) 56 | return; 57 | 58 | final RenderObject object = context.findRenderObject(); 59 | final RenderAbstractViewport viewport = RenderAbstractViewport.of(object); 60 | assert(viewport != null); 61 | 62 | ScrollableState scrollableState = Scrollable.of(context); 63 | assert(scrollableState != null); 64 | 65 | ScrollPosition position = scrollableState.position; 66 | double alignment; 67 | if (position.pixels > viewport.getOffsetToReveal(object, 0.0).offset) { 68 | // Move down to the top of the viewport 69 | alignment = 0.0; 70 | } else if (position.pixels < viewport.getOffsetToReveal(object, 1.0).offset) { 71 | // Move up to the bottom of the viewport 72 | alignment = 1.0; 73 | } else { 74 | // No scrolling is necessary to reveal the child 75 | return; 76 | } 77 | position.ensureVisible( 78 | object, 79 | alignment: alignment, 80 | duration: widget.duration, 81 | curve: widget.curve, 82 | ); 83 | } 84 | 85 | Widget build(BuildContext context) => widget.child; 86 | } -------------------------------------------------------------------------------- /lib/widgets/posts/product_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | 4 | import '../../models/attributes.dart'; 5 | 6 | import '../../mainuipages/global_config.dart'; 7 | 8 | class ProductCard extends StatelessWidget { 9 | final Product product; 10 | 11 | ProductCard(this.product); 12 | 13 | 14 | Widget wordsCard() { 15 | Widget markWidget; 16 | if (product.image == null) { 17 | markWidget = new Text( 18 | product.id, 19 | style: new TextStyle(height: 1.3, color: GlobalConfig.fontColor) 20 | ); 21 | } else { 22 | markWidget = new Row( 23 | children: [ 24 | new Expanded( 25 | flex: 2, 26 | child: new Container( 27 | child: new Text( 28 | product.title, 29 | style: new TextStyle(height: 1.3, color: GlobalConfig.fontColor) 30 | ), 31 | ), 32 | ), 33 | new Expanded( 34 | flex: 1, 35 | child: new AspectRatio( 36 | aspectRatio: 3.0 / 2.0, 37 | child: new Container( 38 | foregroundDecoration:new BoxDecoration( 39 | image: new DecorationImage( 40 | image: new NetworkImage(product.image), 41 | centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0), 42 | ), 43 | borderRadius: const BorderRadius.all(const Radius.circular(6.0)) 44 | ), 45 | ) 46 | ) 47 | ), 48 | ], 49 | ); 50 | } 51 | return new Container( 52 | color: GlobalConfig.cardBackgroundColor, 53 | margin: const EdgeInsets.only(top: 5.0, bottom: 5.0), 54 | child: new FlatButton( 55 | onPressed: (){ 56 | 57 | 58 | }, 59 | child: new Column( 60 | children: [ 61 | new Container( 62 | child: new Row( 63 | children: [ 64 | new Container( 65 | child: new CircleAvatar( 66 | backgroundImage: new NetworkImage(product.imagePath), 67 | radius: 11.0 68 | ), 69 | ), 70 | new Text(" " + product.id + " " + product.title + " · " + '12 hours', style: new TextStyle(color: GlobalConfig.fontColor)) 71 | ], 72 | ), 73 | padding: const EdgeInsets.only(top: 10.0), 74 | ), 75 | new Container( 76 | child: new Text( 77 | product.title, 78 | style: new TextStyle(fontWeight: FontWeight.bold, fontSize: 16.0, height: 1.3, color: GlobalConfig.dark == true? Colors.white70 : Colors.black) 79 | ), 80 | margin: new EdgeInsets.only(top: 6.0, bottom: 2.0), 81 | alignment: Alignment.topLeft 82 | ), 83 | new Container( 84 | child: markWidget, 85 | margin: new EdgeInsets.only(top: 6.0), 86 | alignment: Alignment.topLeft 87 | ), 88 | new Container( 89 | child: new Row( 90 | children: [ 91 | new Expanded( 92 | child: new Text(product.price.toString() + " Agree " + product.price.toString() + "comment", style: new TextStyle(color: GlobalConfig.fontColor)) 93 | ), 94 | new PopupMenuButton( 95 | icon: new Icon(Icons.linear_scale, color: Colors.white10,), 96 | itemBuilder: (BuildContext context) => >[ 97 | new PopupMenuItem( 98 | value: 'The value of option one', 99 | child: new Text('Block this problem') 100 | ), 101 | new PopupMenuItem( 102 | value: 'The value of option two', 103 | child: new Text('unsubscribe learner') 104 | ), 105 | new PopupMenuItem( 106 | value: 'The value of option two', 107 | child: new Text("Report") 108 | ) 109 | ] 110 | ) 111 | ], 112 | ), 113 | padding: const EdgeInsets.only(), 114 | ) 115 | ], 116 | ), 117 | ) 118 | ); 119 | } 120 | 121 | 122 | 123 | @override 124 | Widget build(BuildContext context) { 125 | return wordsCard(); 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /lib/widgets/posts/products.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:scoped_model/scoped_model.dart'; 4 | 5 | import './product_card.dart'; 6 | import '../../models/attributes.dart'; 7 | import '../../scopedmodel/main.dart'; 8 | 9 | class Products extends StatelessWidget { 10 | Widget _buildProductList(List products) { 11 | Widget productCards; 12 | if (products.length > 0) { 13 | productCards = ListView.builder( 14 | itemBuilder: (BuildContext context, int index) => 15 | ProductCard(products[index]), 16 | itemCount: products.length, 17 | ); 18 | } else { 19 | productCards = Container(); 20 | } 21 | return productCards; 22 | } 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | print('[Products Widget] build()'); 27 | return ScopedModelDescendant(builder: (BuildContext context, Widget child, MainModel model) { 28 | return _buildProductList(model.displayedProducts); 29 | },); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/widgets/products/address_tag.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AddressTag extends StatelessWidget { 4 | final String address; 5 | 6 | AddressTag(this.address); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | padding: EdgeInsets.symmetric(horizontal: 6.0, vertical: 2.5), 12 | decoration: BoxDecoration( 13 | border: Border.all(color: Colors.grey, width: 1.0), 14 | borderRadius: BorderRadius.circular(4.0)), 15 | child: Text(address), 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/widgets/products/price_tag.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class PriceTag extends StatelessWidget { 4 | final String price; 5 | 6 | PriceTag(this.price); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | padding: EdgeInsets.symmetric(horizontal: 6.0, vertical: 2.5), 12 | decoration: BoxDecoration( 13 | color: Theme.of(context).accentColor, 14 | borderRadius: BorderRadius.circular(5.0)), 15 | child: Text( 16 | '\$$price', 17 | style: TextStyle(color: Colors.white), 18 | ), 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/widgets/products/product_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:scoped_model/scoped_model.dart'; 4 | 5 | import './price_tag.dart'; 6 | import '../ui_elements/title_default.dart'; 7 | import '../../models/attributes.dart'; 8 | import '../../scopedmodel/main.dart'; 9 | 10 | class ProductCard extends StatelessWidget { 11 | final Product product; 12 | 13 | ProductCard(this.product); 14 | 15 | Widget _buildTitlePriceRow() { 16 | return Container( 17 | padding: EdgeInsets.only(top: 10.0), 18 | child: Row( 19 | mainAxisAlignment: MainAxisAlignment.center, 20 | children: [ 21 | Flexible( 22 | child: TitleDefault(product.title), 23 | ), 24 | Flexible( 25 | child: SizedBox( 26 | width: 8.0, 27 | ), 28 | ), 29 | Flexible( 30 | child: PriceTag(product.price.toString()), 31 | ) 32 | ], 33 | ), 34 | ); 35 | } 36 | 37 | Widget _buildActionButtons(BuildContext context) { 38 | return ScopedModelDescendant( 39 | builder: (BuildContext context, Widget child, MainModel model) { 40 | return ButtonBar( 41 | alignment: MainAxisAlignment.center, 42 | children: [ 43 | IconButton( 44 | icon: Icon(Icons.info), 45 | color: Theme.of(context).accentColor, 46 | onPressed: () { 47 | model.selectProduct(product.id); 48 | Navigator 49 | .pushNamed(context, '/product/' + product.id) 50 | .then((_) => model.selectProduct(null)); 51 | }, 52 | ), 53 | IconButton( 54 | icon: Icon(product.isFavorite 55 | ? Icons.favorite 56 | : Icons.favorite_border), 57 | color: Colors.red, 58 | onPressed: () { 59 | model.selectProduct(product.id); 60 | model.toggleProductFavoriteStatus(); 61 | }, 62 | ), 63 | ]); 64 | }, 65 | ); 66 | } 67 | 68 | @override 69 | Widget build(BuildContext context) { 70 | return Card( 71 | child: Column( 72 | children: [ 73 | Hero( 74 | tag: product.id, 75 | child: FadeInImage( 76 | image: NetworkImage(product.image), 77 | height: 300.0, 78 | fit: BoxFit.cover, 79 | placeholder: AssetImage('assets/food.jpg'), 80 | ), 81 | ), 82 | _buildTitlePriceRow(), 83 | SizedBox( 84 | height: 10.0, 85 | ), 86 | 87 | _buildActionButtons(context) 88 | ], 89 | ), 90 | ); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/widgets/products/product_fab.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' as math; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | import 'package:scoped_model/scoped_model.dart'; 6 | import 'package:url_launcher/url_launcher.dart'; 7 | 8 | import '../../models/attributes.dart'; 9 | import '../../scopedmodel/main.dart'; 10 | 11 | class ProductFAB extends StatefulWidget { 12 | final Product product; 13 | 14 | ProductFAB(this.product); 15 | 16 | @override 17 | State createState() { 18 | return _ProductFABState(); 19 | } 20 | } 21 | 22 | class _ProductFABState extends State with TickerProviderStateMixin { 23 | AnimationController _controller; 24 | 25 | @override 26 | void initState() { 27 | _controller = AnimationController( 28 | vsync: this, 29 | duration: Duration(milliseconds: 200), 30 | ); 31 | super.initState(); 32 | } 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return ScopedModelDescendant( 37 | builder: (BuildContext context, Widget child, MainModel model) { 38 | return Column( 39 | mainAxisSize: MainAxisSize.min, 40 | children: [ 41 | Container( 42 | height: 70.0, 43 | width: 56.0, 44 | alignment: FractionalOffset.topCenter, 45 | child: ScaleTransition( 46 | scale: CurvedAnimation( 47 | parent: _controller, 48 | curve: Interval(0.0, 1.0, curve: Curves.easeOut)), 49 | child: FloatingActionButton( 50 | backgroundColor: Theme.of(context).cardColor, 51 | heroTag: 'contact', 52 | mini: true, 53 | onPressed: () async { 54 | final url = 'mailto:${widget.product.userEmail}'; 55 | if (await canLaunch(url)) { 56 | await launch(url); 57 | } else { 58 | throw 'Could not launch!'; 59 | } 60 | }, 61 | child: Icon( 62 | Icons.mail, 63 | color: Theme.of(context).primaryColor, 64 | ), 65 | ), 66 | ), 67 | ), 68 | Container( 69 | height: 70.0, 70 | width: 56.0, 71 | alignment: FractionalOffset.topCenter, 72 | child: ScaleTransition( 73 | scale: CurvedAnimation( 74 | parent: _controller, 75 | curve: Interval(0.0, 0.5, curve: Curves.easeOut), 76 | ), 77 | child: FloatingActionButton( 78 | backgroundColor: Theme.of(context).cardColor, 79 | heroTag: 'favorite', 80 | mini: true, 81 | onPressed: () { 82 | model.toggleProductFavoriteStatus(); 83 | }, 84 | child: Icon( 85 | model.selectedProduct.isFavorite 86 | ? Icons.favorite 87 | : Icons.favorite_border, 88 | color: Colors.red, 89 | ), 90 | ), 91 | ), 92 | ), 93 | FloatingActionButton( 94 | heroTag: 'options', 95 | onPressed: () { 96 | if (_controller.isDismissed) { 97 | _controller.forward(); 98 | } else { 99 | _controller.reverse(); 100 | } 101 | }, 102 | child: AnimatedBuilder( 103 | animation: _controller, 104 | builder: (BuildContext context, Widget child) { 105 | return Transform( 106 | alignment: FractionalOffset.center, 107 | transform: Matrix4.rotationZ(_controller.value * 0.5 * math.pi), 108 | child: Icon(_controller.isDismissed ? Icons.more_vert : Icons.close), 109 | ); 110 | }, 111 | ), 112 | ), 113 | ], 114 | ); 115 | }, 116 | ); 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /lib/widgets/products/products.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:scoped_model/scoped_model.dart'; 4 | 5 | import './product_card.dart'; 6 | import '../../models/attributes.dart'; 7 | import '../../scopedmodel/main.dart'; 8 | 9 | class Products extends StatelessWidget { 10 | 11 | 12 | Widget _buildProductList(List products) { 13 | Widget productCards; 14 | 15 | if (products.length > 0) { 16 | productCards = ListView.builder( 17 | itemBuilder: (BuildContext context, int index) => 18 | ProductCard(products[index]), 19 | itemCount: products.length, 20 | ); 21 | } else { 22 | productCards = Container(); 23 | } 24 | return productCards; 25 | } 26 | 27 | @override 28 | Widget build(BuildContext context) { 29 | print('[Products Widget] build()'); 30 | return ScopedModelDescendant(builder: (BuildContext context, Widget child, MainModel model) { 31 | 32 | return _buildProductList(model.displayedProducts); 33 | },); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/widgets/ui_elements/adapative_progress_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | class AdaptiveProgressIndicator extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Theme.of(context).platform == TargetPlatform.iOS 8 | ? CupertinoActivityIndicator() 9 | : CircularProgressIndicator(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /lib/widgets/ui_elements/logout_list_tile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:scoped_model/scoped_model.dart'; 4 | 5 | import '../../scopedmodel/main.dart'; 6 | 7 | class LogoutListTile extends StatelessWidget { 8 | @override 9 | Widget build(BuildContext context) { 10 | return ScopedModelDescendant( 11 | builder: (BuildContext context, Widget child, MainModel model) { 12 | return ListTile( 13 | leading: Icon(Icons.exit_to_app), 14 | title: Text('Logout'), 15 | onTap: () { 16 | model.logout(); 17 | }, 18 | ); 19 | }, 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/widgets/ui_elements/title_default.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class TitleDefault extends StatelessWidget { 4 | final String title; 5 | 6 | TitleDefault(this.title); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | final deviceWidth = MediaQuery.of(context).size.width; 11 | return Text( 12 | title, 13 | softWrap: true, 14 | textAlign: TextAlign.center, 15 | style: TextStyle( 16 | fontSize: deviceWidth > 700 ? 26.0 : 14.0, fontWeight: FontWeight.bold, fontFamily: 'Oswald'), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://www.dartlang.org/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.1.0" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.0.4" 18 | charcode: 19 | dependency: transitive 20 | description: 21 | name: charcode 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.2" 25 | collection: 26 | dependency: transitive 27 | description: 28 | name: collection 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.14.11" 32 | connectivity: 33 | dependency: "direct main" 34 | description: 35 | name: connectivity 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "0.4.3+1" 39 | cupertino_icons: 40 | dependency: "direct main" 41 | description: 42 | name: cupertino_icons 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "0.1.2" 46 | fancy_bottom_navigation: 47 | dependency: "direct main" 48 | description: 49 | name: fancy_bottom_navigation 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "0.3.2" 53 | flutter: 54 | dependency: "direct main" 55 | description: flutter 56 | source: sdk 57 | version: "0.0.0" 58 | flutter_screenutil: 59 | dependency: "direct main" 60 | description: 61 | name: flutter_screenutil 62 | url: "https://pub.dartlang.org" 63 | source: hosted 64 | version: "0.5.2" 65 | flutter_test: 66 | dependency: "direct dev" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | gradient_text: 71 | dependency: "direct main" 72 | description: 73 | name: gradient_text 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "1.0.2" 77 | http: 78 | dependency: "direct main" 79 | description: 80 | name: http 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "0.12.0+2" 84 | http_parser: 85 | dependency: transitive 86 | description: 87 | name: http_parser 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "3.1.3" 91 | image_picker: 92 | dependency: "direct main" 93 | description: 94 | name: image_picker 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.6.0+1" 98 | matcher: 99 | dependency: transitive 100 | description: 101 | name: matcher 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "0.12.5" 105 | meta: 106 | dependency: transitive 107 | description: 108 | name: meta 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.1.6" 112 | mime: 113 | dependency: "direct main" 114 | description: 115 | name: mime 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "0.9.6+2" 119 | path: 120 | dependency: transitive 121 | description: 122 | name: path 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "1.6.2" 126 | pedantic: 127 | dependency: transitive 128 | description: 129 | name: pedantic 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "1.5.0" 133 | quiver: 134 | dependency: transitive 135 | description: 136 | name: quiver 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "2.0.2" 140 | rect_getter: 141 | dependency: "direct main" 142 | description: 143 | name: rect_getter 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "0.0.1" 147 | rxdart: 148 | dependency: "direct main" 149 | description: 150 | name: rxdart 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "0.21.0" 154 | scoped_model: 155 | dependency: "direct main" 156 | description: 157 | name: scoped_model 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "1.0.1" 161 | shared_preferences: 162 | dependency: "direct main" 163 | description: 164 | name: shared_preferences 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "0.5.2" 168 | sky_engine: 169 | dependency: transitive 170 | description: flutter 171 | source: sdk 172 | version: "0.0.99" 173 | source_span: 174 | dependency: transitive 175 | description: 176 | name: source_span 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "1.5.5" 180 | stack_trace: 181 | dependency: transitive 182 | description: 183 | name: stack_trace 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "1.9.3" 187 | stream_channel: 188 | dependency: transitive 189 | description: 190 | name: stream_channel 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "2.0.0" 194 | string_scanner: 195 | dependency: transitive 196 | description: 197 | name: string_scanner 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "1.0.4" 201 | term_glyph: 202 | dependency: transitive 203 | description: 204 | name: term_glyph 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "1.1.0" 208 | test_api: 209 | dependency: transitive 210 | description: 211 | name: test_api 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "0.2.4" 215 | transparent_image: 216 | dependency: "direct main" 217 | description: 218 | name: transparent_image 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "1.0.0" 222 | typed_data: 223 | dependency: transitive 224 | description: 225 | name: typed_data 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "1.1.6" 229 | url_launcher: 230 | dependency: "direct main" 231 | description: 232 | name: url_launcher 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "5.0.2" 236 | vector_math: 237 | dependency: transitive 238 | description: 239 | name: vector_math 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "2.0.8" 243 | sdks: 244 | dart: ">=2.2.0 <3.0.0" 245 | flutter: ">=1.2.0 <2.0.0" 246 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: technic_help 2 | description: A new Flutter application. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | 24 | 25 | rect_getter: ^0.0.1 26 | gradient_text: ^1.0.2 27 | flutter_screenutil: ^0.5.2 28 | shared_preferences: ^0.5.2 29 | scoped_model: ^1.0.1 30 | http: ^0.12.0+2 31 | rxdart: ^0.21.0 32 | mime: ^0.9.6+2 33 | image_picker: ^0.6.0+1 34 | transparent_image: ^1.0.0 35 | connectivity: ^0.4.3+1 36 | 37 | url_launcher: ^5.0.2 38 | fancy_bottom_navigation: ^0.3.2 39 | # The following adds the Cupertino Icons font to your application. 40 | # Use with the CupertinoIcons class for iOS style icons. 41 | cupertino_icons: ^0.1.2 42 | 43 | dev_dependencies: 44 | flutter_test: 45 | sdk: flutter 46 | 47 | 48 | # For information on the generic Dart part of this file, see the 49 | # following page: https://www.dartlang.org/tools/pub/pubspec 50 | 51 | # The following section is specific to Flutter. 52 | flutter: 53 | 54 | # The following line ensures that the Material Icons font is 55 | # included with your application, so that you can use the icons in 56 | # the material Icons class. 57 | uses-material-design: true 58 | 59 | # To add assets to your application, add an assets section, like this: 60 | # assets: 61 | # - images/a_dot_burr.jpeg 62 | # - images/a_dot_ham.jpeg 63 | assets: 64 | - assets/illustration.png 65 | - assets/illustration2.png 66 | - assets/illustration3.png 67 | - assets/image_01.png 68 | - assets/image_02.png 69 | - assets/logo.png 70 | - assets/food.jpg 71 | - assets/background.jpg 72 | # An image asset can refer to one or more resolution-specific "variants", see 73 | # https://flutter.dev/assets-and-images/#resolution-aware. 74 | 75 | # For details regarding adding assets from package dependencies, see 76 | # https://flutter.dev/assets-and-images/#from-packages 77 | 78 | # To add custom fonts to your application, add a fonts section here, 79 | # in this "flutter" section. Each entry in this list should have a 80 | # "family" key with the font family name, and a "fonts" key with a 81 | # list giving the asset and other descriptors for the font. For 82 | # example: 83 | fonts: 84 | - family: Montserrat-Black 85 | fonts: 86 | - asset: assets/Montserrat-Black.ttf 87 | 88 | - family: Montserrat-Medium 89 | fonts: 90 | - asset: assets/Montserrat-Medium.ttf 91 | 92 | - family: CustomIcons 93 | fonts: 94 | - asset: assets/CustomIcons.ttf 95 | 96 | - family: Poppins-Bold 97 | fonts: 98 | - asset: assets/Poppins-Bold.ttf 99 | 100 | - family: Poppins-Medium 101 | fonts: 102 | - asset: assets/Poppins-Medium.ttf 103 | - family: Rubik 104 | fonts: 105 | - asset: fonts/Rubik-Regular.ttf 106 | - asset: fonts/Rubik-Medium.ttf 107 | weight: 500 108 | - family: Oswald 109 | fonts: 110 | - asset: assets/Oswald-Bold.ttf 111 | weight: 700 112 | # fonts: 113 | # - family: Schyler 114 | # fonts: 115 | # - asset: fonts/Schyler-Regular.ttf 116 | # - asset: fonts/Schyler-Italic.ttf 117 | # style: italic 118 | # - family: Trajan Pro 119 | # fonts: 120 | # - asset: fonts/TrajanPro.ttf 121 | # - asset: fonts/TrajanPro_Bold.ttf 122 | # weight: 700 123 | # 124 | 125 | # For details regarding fonts from package dependencies, 126 | # see https://flutter.dev/custom-fonts/#from-packages 127 | -------------------------------------------------------------------------------- /screenrecord/20190621_205435.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PuneethReddyHC/flutter-project/603e202df48f5b306e73d694af2556d2cf20507e/screenrecord/20190621_205435.gif -------------------------------------------------------------------------------- /technic_help.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:technic_help/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | --------------------------------------------------------------------------------