Skip to content

Commit

Permalink
Update packages (#94)
Browse files Browse the repository at this point in the history
* Start migrating project to new packages

* Update Android, iOS, Firebase project

* Fix argument type

* Refactor folders

* Fix import

* Update folders

* Add pubspec.lock and Podfile.lock to git

* Customise Podfile with minimum_deployment_target for all pod libraries

https://stackoverflow.com/questions/61823044/flutter-the-ios-simulator-deployment-target-iphoneos-deployment-target-is-se

* Move FirestoreService to main app

* Remove custom packages

* Restore unawaited calls

* Start cleaning up buttons code

* Create "authentication" feature

* Rename onboarding files

* Cleanup folders and repositories

* Pass UserID to all DB methods that require it

* Start implementing GoRouter

* Comment out broken code

* Move more code to GoRouter

* Fix navigation

* Add onboarding flow to GoRouter

* Cleanup SignInScreen

* Cleanup AccountScreen

* Remove unused file

* Refactor JobsScreen

* Start implementing EditJobScreenController

* Refactor jobs and entries pages

* Update all packages

* Fix JobEntriesScreen to only watch the jobStreamProvider

* Cleanup JobEntriesScreen, add AsyncValueWidget

* Cleanup buttons

* Rename some folders

* Fixed redirect code

* Minor fixes, revert to GoRouter 5.1.1

* Fix to prevent too many redirects on app startup

* Delete old tests

* Update .gitignore and commit launch.json

* Make app runnable on Android (gradle fixes)

* Updated linter rules and fixed analysis warnings

* Removed old flutter driver tests

* More linter fixes

* Removed Freezed and build_runner

* Removed logger package

* Cleanup README

* Updated screenshots
  • Loading branch information
bizz84 authored Jan 7, 2023
1 parent bf2e423 commit 98594f1
Show file tree
Hide file tree
Showing 132 changed files with 3,571 additions and 2,510 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

File renamed without changes
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Miscellaneous
*.class
*.lock
#*.lock
*.log
*.pyc
*.swp
Expand All @@ -17,7 +17,7 @@
.idea/

# Visual Studio Code related
.vscode/
#.vscode/

# Flutter repo-specific
/bin/cache/
Expand Down Expand Up @@ -96,5 +96,9 @@ web/firebase-config.js
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

# Firebase configuration files
lib/firebase_options.dart
ios/Runner/GoogleService-Info.plist
android/app/google-services.json
ios/firebase_app_id_file.json
macos/Runner/GoogleService-Info.plist
macos/firebase_app_id_file.json
android/app/google-services.json
24 changes: 22 additions & 2 deletions .metadata
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.
# This file should be version controlled.

version:
revision: 27321ebbad34b0a3fafe99fac037102196d655ff
revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
channel: stable

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
- platform: ios
create_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1
base_revision: e3c29ec00c9c825c891d75054c63fcc46454dca1

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Run",
"request": "launch",
"type": "dart"
},
{
"name": "Run (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "Run (release mode)",
"request": "launch",
"type": "dart",
"flutterMode": "release"
}
]
}
390 changes: 40 additions & 350 deletions README.md

Large diffs are not rendered by default.

103 changes: 16 additions & 87 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,92 +9,21 @@
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

analyzer:
strong-mode:
implicit-casts: false
implicit-dynamic: false
errors:
# Otherwise cause the import of all_lint_rules to warn because of some rules conflicts.
# The conflicts are fixed in this file instead, so we can safely ignore the warning.
included_file_warning: ignore
# treat missing required parameters as a warning (not a hint)
missing_required_param: warning
# treat missing returns as a warning (not a hint)
missing_return: warning
# allow having TODOs in the code
todo: ignore
# Ignore analyzer hints for updating pubspecs when using Future or
# Stream and not importing dart:async
# Please see https://github.com/flutter/flutter/pull/24528 for details.
sdk_version_async_exported_from_core: ignore
# Custom errors to be ignored
implicit_dynamic_type: ignore
#invalid_assignment: ignore
implicit_dynamic_map_literal: ignore
always_put_control_body_on_new_line: ignore
exclude:
- "bin/cache/**"
# the following two are relative to the stocks example and the flutter package respectively
# see https://github.com/dart-lang/sdk/issues/28463
- "lib/i18n/messages_*.dart"
- "lib/src/http/**"

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# navigator.pop inside a closure requires this
unnecessary_lambdas: false
# It's ok
cascade_invocations: false
# Ignored in tests
missing_whitespace_between_adjacent_strings: false
# In the future
type_annotate_public_apis: false
# It's ok
avoid_print: false
# Not including author name in small projects
flutter_style_todos: false
# Sometimes used
avoid_as: false
# Not sure how to address this
use_raw_strings: false
# Need to fix this
comment_references: false
# Ok to use a class
one_member_abstracts: false
# Need to fix this
avoid_annotating_with_dynamic: false
# Disabled for type inference
always_specify_types: false
# non-required Key often precedes required named parameters
always_put_required_named_parameters_first: false
# Catch all often used in project
avoid_catches_without_on_clauses: false
# Ok to be explicit
avoid_redundant_argument_values: false
# Still some instances of this in the project
lines_longer_than_80_chars: false
# Often used in local variables
unnecessary_final: false
# Not always done with factory constructors
sort_constructors_first: false
# Ok to be explicit
omit_local_variable_types: false
# For build methods
prefer_expression_function_bodies: false
# I use double out of habit
prefer_int_literals: false
# sometimes using `with` syntax
prefer_mixin: false
# Codebase uses mostly single quotes
avoid_escaping_inner_quotes: false
prefer_double_quotes: false
# Need to fix this sometime (easier to copy paste files across projects)
prefer_relative_imports: false
# A lot of documentation missing
public_member_api_docs: false
# Not enforced
sort_child_properties_last: false
# Many constructors not declared for widgets that take no arguments
use_key_in_widget_constructors: false
# Disable: DO reference all public properties in debug method implementations.
diagnostic_describe_all_properties: false
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
6 changes: 6 additions & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ gradle-wrapper.jar
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
33 changes: 18 additions & 15 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,38 @@ if (flutterVersionName == null) {
}

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

android {
compileSdkVersion 29
compileSdkVersion localProperties.getProperty('flutter.compileSdkVersion').toInteger()
ndkVersion flutter.ndkVersion

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
disable 'InvalidPackage'
kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.starter_architecture_flutter_firebase"
minSdkVersion 21
targetSdkVersion 29
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()
targetSdkVersion localProperties.getProperty('flutter.targetSdkVersion').toInteger()
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}

buildTypes {
Expand All @@ -62,10 +71,4 @@ flutter {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.android.support:multidex:1.0.3'
}

apply plugin: 'com.google.gms.google-services'
3 changes: 2 additions & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.starter_architecture_flutter_firebase">
<!-- Flutter needs it to communicate with the running application
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
18 changes: 11 additions & 7 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.starter_architecture_flutter_firebase">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
<application
android:label="starter_architecture_flutter_firebase"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
package com.example.starter_architecture_flutter_firebase

import androidx.annotation.NonNull;
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
}
12 changes: 12 additions & 0 deletions android/app/src/main/res/drawable-v21/launch_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
18 changes: 18 additions & 0 deletions android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
14 changes: 12 additions & 2 deletions android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
the Flutter engine draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
3 changes: 2 additions & 1 deletion android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.starter_architecture_flutter_firebase">
<!-- Flutter needs it to communicate with the running application
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
Loading

0 comments on commit 98594f1

Please sign in to comment.