Skip to content

Commit

Permalink
Final submission
Browse files Browse the repository at this point in the history
  • Loading branch information
ndungudedan committed Mar 30, 2022
1 parent 78fc911 commit 1820de9
Show file tree
Hide file tree
Showing 57 changed files with 3,801 additions and 8,491 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
.buildlog/
.history
.svn/
*.env


# IntelliJ related
Expand Down
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# hashnode_hasura_hackathon

A new Flutter project.
This is a submission for the hasura hashnode hackathon.

## Getting Started

This project is a starting point for a Flutter application.
1. Clone the repository.
2. Create a .env file on the root folder.
3. Add the following line of code
GOOGLE_API_KEY='Your Google maps api key'

A few resources to get you started if this is your first Flutter project:

- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
- [Get a Google Maps Api Key from here](https://cloud.google.com/maps-platform/)
3 changes: 2 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if (flutterVersionName == null) {

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
Expand All @@ -44,7 +45,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.hashnode_hasura_hackathon"
minSdkVersion flutter.minSdkVersion
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
9 changes: 9 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hashnode_hasura_hackathon">

<uses-permission android:name="android.permission.INTERNET"/>

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />


<application
android:label="hashnode_hasura_hackathon"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyBlvATdHf81z3tldYPp2QDCNjcSS56yeAc"/>
<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ buildscript {

dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.google.gms:google-services:4.3.5'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
Binary file added assets/images/cool_house.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/house_top.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/placeholder.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions lib/app/app.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
import 'package:hashnode_hasura_hackathon/ui/views/auth/login/login_view.dart';
import 'package:hashnode_hasura_hackathon/ui/views/auth/sign_up/sign_up_view.dart';
import 'package:hashnode_hasura_hackathon/ui/views/dashboard/dash_view.dart';
import 'package:hashnode_hasura_hackathon/ui/views/startup/startup_view.dart';
import 'package:stacked/stacked_annotations.dart';
import 'package:stacked_services/stacked_services.dart';
import 'package:stacked_themes/stacked_themes.dart';

import '../services/add_space_service.dart';
import '../services/api/api.dart';
import '../services/api/api_service.dart';
import '../services/api/fake_api_service.dart';
import '../services/auth_service.dart';
import '../services/local_storage_service.dart';
import '../services/startup_service.dart';
import '../services/user_service.dart';
import '../ui/views/dashboard/new_space/new_space.dart';
import '../ui/views/dashboard/new_space/widgets/cost_form_widget.dart';
import '../ui/views/dashboard/new_space/widgets/description_form_widget.dart';
import '../ui/views/dashboard/new_space/widgets/location_form_widget.dart';
import '../ui/views/dashboard/new_space/widgets/name_form_widget.dart';
import '../ui/views/dashboard/new_space/widgets/photos_form_widget.dart';
import '../ui/views/dashboard/new_space/widgets/submit_form_widget.dart';

/// Use this to switch to mock data or live data
const useFakeApiService = false;
Expand All @@ -21,6 +30,18 @@ const useFakeApiService = false;
CustomRoute(page: StartUpView, initial: true),
CustomRoute(page: LoginView),
CustomRoute(page: SignUpView),
CustomRoute(page: DashBoardView),
CustomRoute(
page: AddNewSpaceView,
children: [
MaterialRoute(page: NameFormWidget, initial: true),
MaterialRoute(page: DescriptionFormWidget),
MaterialRoute(page: CostFormWidget),
MaterialRoute(page: LocationFormWidget),
MaterialRoute(page: PhotosFormWidget),
MaterialRoute(page: SubmitFormWidget),
],
)
],
dependencies: [
Presolve(
Expand All @@ -30,6 +51,7 @@ const useFakeApiService = false;
LazySingleton(classType: NavigationService),
LazySingleton(classType: AuthService),
LazySingleton(classType: StartupService),
LazySingleton(classType: AddSpaceService),
LazySingleton(
classType: useFakeApiService ? FakeApiService : ApiService,
asType: Api),
Expand Down
2 changes: 2 additions & 0 deletions lib/app/app.locator.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

121 changes: 120 additions & 1 deletion lib/app/app.router.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions lib/constants/app_api_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ Uri baseUri = Uri(scheme: scheme, host: host, path: '/');

// Auth Endpoints

Uri signupUri = Uri(scheme: scheme, host: host, path: '/api/rest/register-app-user');
Uri signupUriEmail = Uri(scheme: scheme, host: host, path: '/api/rest/register-app-user-email');
Uri signupUriPhone = Uri(scheme: scheme, host: host, path: '/api/rest/register-app-user-phone');

Uri loginUri=
Uri(scheme: scheme, host: host, path: '/api/rest/login-app-user');
Uri(scheme: scheme, host: host, path: '/api/rest/login-app-user');

Uri exploreSpacesUri = Uri(scheme: scheme, host: host, path: '/api/rest/explore-spaces');
Uri checkSpacesUri = Uri(scheme: scheme, host: host, path: '/api/rest/check-space');
Uri bookSpacesUri = Uri(scheme: scheme, host: host, path: '/api/rest/book-space');
Uri newSpaceUri=
Uri(scheme: scheme, host: host, path: '/api/rest/new-space');
4 changes: 4 additions & 0 deletions lib/constants/app_assets.dart
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
const String buttonLottieAnimationJson = 'assets/button_load_animation.json';
const String placeHolder = 'assets/images/placeholder.jpg';
const String coolHouse = 'assets/images/cool_house.jpg';
const String houseTop = 'assets/images/house_top.jpg';

5 changes: 5 additions & 0 deletions lib/constants/app_constants.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'package:hashnode_hasura_hackathon/main.dart';

class AppConstants {
static final String GOOGLE_API_KEY = dotEnv.env['GOOGLE_API_KEY']??'';
}
1 change: 1 addition & 0 deletions lib/constants/app_strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,4 @@ const String countryHint = 'Country/Region';
const String continueText = 'Continue';
const String or = 'or';
const String continueWithGoogle = 'Continue with Google';
const String agreeAndContinue = 'Agree and continue';
Loading

0 comments on commit 1820de9

Please sign in to comment.