Skip to content

Commit b0a3743

Browse files
conf: Set up the project.
conf: Set up the project.
2 parents 4875fc7 + af3c92a commit b0a3743

63 files changed

Lines changed: 1289 additions & 251 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: CI
2+
3+
on: [ push ]
4+
5+
env:
6+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
7+
FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }}
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
# Set up environment
14+
- uses: actions/checkout@v1
15+
- uses: actions/setup-java@v1
16+
with:
17+
java-version: '12.x'
18+
- uses: subosito/flutter-action@v1
19+
with:
20+
channel: "stable"
21+
22+
# Prepare Flutter
23+
- name: Get dependencies
24+
run: flutter pub get
25+
- name: Generate Freezed models
26+
run: flutter pub run build_runner build --delete-conflicting-outputs
27+
28+
# Lint
29+
- name: Check formatting
30+
run: flutter format --set-exit-if-changed .
31+
- name: Analyze code
32+
run: flutter analyze .
33+
34+
test:
35+
runs-on: ubuntu-latest
36+
steps:
37+
# Set up environment
38+
- uses: actions/checkout@v1
39+
- uses: actions/setup-java@v1
40+
with:
41+
java-version: '12.x'
42+
- uses: subosito/flutter-action@v1
43+
with:
44+
channel: "stable"
45+
46+
# Prepare Flutter
47+
- name: Get dependencies
48+
run: flutter pub get
49+
- name: Generate Freezed models
50+
run: flutter pub run build_runner build --delete-conflicting-outputs
51+
52+
# Test
53+
# Temporary disabled due to absence of tests.
54+
# - name: Run tests
55+
# run: flutter test
56+
57+
build:
58+
runs-on: ubuntu-latest
59+
steps:
60+
# Set up environment
61+
- uses: actions/checkout@v1
62+
- uses: actions/setup-java@v1
63+
with:
64+
java-version: '12.x'
65+
- uses: subosito/flutter-action@v1
66+
with:
67+
channel: "stable"
68+
69+
# Prepare Flutter
70+
- name: Get dependencies
71+
run: flutter pub get
72+
- name: Generate Freezed models
73+
run: flutter pub run build_runner build --delete-conflicting-outputs
74+
- name: Provide Firebase config file
75+
run: echo $FIREBASE_CONFIG | base64 --decode > android/app/google-services.json
76+
77+
# Build
78+
- name: Build APK
79+
run: flutter build apk --dart-define=SENTRY_DSN=${SENTRY_DSN}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,10 @@ app.*.map.json
4444
/android/app/debug
4545
/android/app/profile
4646
/android/app/release
47+
48+
# Firebase config
49+
**/android/app/google-services.json
50+
51+
# Generated files
52+
**/*.g.dart
53+
**/*.freezed.dart

README.md

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,55 @@
1-
# codephile
1+
# Codephile
22

3-
A new Flutter project.
3+
Codephile is an application specially made for all the competitive coders out there. With features
4+
like submission feed, contest reminders, user search, and many more, this app is a perfect companion
5+
for stalking your fellow coders and learning from them.
6+
7+
## Screenshots
8+
9+
<img src="https://user-images.githubusercontent.com/60056833/111873783-1ab52900-89b8-11eb-8951-ca6c13249c05.png" width="200" height="400" /> <img src="https://user-images.githubusercontent.com/60056833/111873786-1c7eec80-89b8-11eb-9625-d19a05b15e25.png" width="200" height="400" /> <img src="https://user-images.githubusercontent.com/60056833/111873792-1f79dd00-89b8-11eb-9030-e26c91621304.png" width="200" height="400" /> <img src="https://user-images.githubusercontent.com/60056833/111873795-2143a080-89b8-11eb-9a28-04ea3f216b5b.png" width="200" height="400" />
10+
<img src="https://user-images.githubusercontent.com/60056833/111873771-0ffa9400-89b8-11eb-8be2-2ac328356207.png" width="200" height="400" /> <img src="https://user-images.githubusercontent.com/60056833/111873773-12f58480-89b8-11eb-8d95-7f905b6d8fa5.png" width="200" height="400" /> <img src="https://user-images.githubusercontent.com/60056833/111873778-15f07500-89b8-11eb-8b46-79abab630f0d.png" width="200" height="400" /> <img src="https://user-images.githubusercontent.com/60056833/111873781-1852cf00-89b8-11eb-807e-05bf63a82d9b.png" width="200" height="400" />
411

512
## Getting Started
613

7-
This project is a starting point for a Flutter application.
14+
Project structure:-
15+
16+
```
17+
|-lib
18+
| |-models {contains object models | used for communication with the back-end}
19+
| |-screens {contains code for the UI}
20+
| |-services {contains code for the buisness logic}
21+
| |-resources {common resources like assets addresses}
22+
| |-main.dart {entry point}
23+
|-assets {contains icons, logos...}
24+
|-android
25+
|-ios
26+
|-test
27+
```
28+
29+
## How to Contribute
30+
31+
We'd love to accept your patches and contributions to this project. There are just a few small
32+
guidelines you need to follow.
33+
34+
- When contributing to this repository, please first discuss the change you wish to make via the
35+
issues section before starting any major work.
36+
- Once you have started work on any issue open a WIP pull request addressing that issue so that we
37+
know that someone is working on it.
38+
- While writing any code for this project ensure that it is well formatted and consistent with the
39+
architecture of the rest of the project.
40+
- Please make sure that you use the
41+
standard [dart nomenclature](https://dart.dev/guides/language/effective-dart/style).
42+
- Before committing any change make sure their is no compilation warning or error.
843

9-
A few resources to get you started if this is your first Flutter project:
44+
### For commit messages
1045

11-
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
46+
Please start your commits with these prefixes for better understanding among collaborators, based on
47+
the type of commit:
1348

14-
For help getting started with Flutter, view our
15-
[online documentation](https://flutter.dev/docs), which offers tutorials,
16-
samples, guidance on mobile development, and a full API reference.
49+
feat: (addition of a new feature)
50+
rfac: (refactoring the code: optimization/ different logic of existing code - output doesn't change, just the way of execution changes)
51+
docs: (documenting the code, be it readme, or extra comments)
52+
bfix: (bug fixing)
53+
chor: (chore - beautifying code, indents, spaces, camelcasing, changing variable names to have an appropriate meaning)
54+
ptch: (patches - small changes in code, mainly UI, for example color of a button, incrasing size of tet, etc etc)
55+
conf: (configurational settings - changing directory structure, updating gitignore, add libraries, changing manifest etc)

analysis_options.yaml

Lines changed: 170 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,174 @@
1-
# This file configures the analyzer, which statically analyzes Dart code to
2-
# check for errors, warnings, and lints.
3-
#
4-
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5-
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6-
# invoked from the command line by running `flutter analyze`.
7-
8-
# The following line activates a set of recommended lints for Flutter apps,
9-
# packages, and plugins designed to encourage good coding practices.
101
include: package:flutter_lints/flutter.yaml
112

3+
analyzer:
4+
exclude:
5+
- "**/*.g.dart"
6+
- "**/*.freezed.dart"
7+
errors:
8+
invalid_annotation_target: ignore
9+
1210
linter:
13-
# The lint rules applied to this project can be customized in the
14-
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15-
# included above or to enable additional rules. A list of all available lints
16-
# and their documentation is published at
17-
# https://dart-lang.github.io/linter/lints/index.html.
18-
#
19-
# Instead of disabling a lint rule for the entire project in the
20-
# section below, it can also be suppressed for a single line of code
21-
# or a specific dart file by using the `// ignore: name_of_lint` and
22-
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
23-
# producing the lint.
2411
rules:
25-
# avoid_print: false # Uncomment to disable the `avoid_print` rule
26-
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27-
28-
# Additional information about this file can be found at
29-
# https://dart.dev/guides/language/analysis-options
12+
always_declare_return_types: true
13+
always_put_required_named_parameters_first: true
14+
always_require_non_null_named_parameters: true
15+
annotate_overrides: true
16+
avoid_annotating_with_dynamic: true
17+
avoid_bool_literals_in_conditional_expressions: true
18+
avoid_catches_without_on_clauses: true
19+
avoid_catching_errors: true
20+
avoid_double_and_int_checks: true
21+
avoid_empty_else: true
22+
avoid_equals_and_hash_code_on_mutable_classes: true
23+
avoid_escaping_inner_quotes: true
24+
avoid_field_initializers_in_const_classes: true
25+
avoid_function_literals_in_foreach_calls: true
26+
avoid_implementing_value_types: true
27+
avoid_init_to_null: true
28+
avoid_null_checks_in_equality_operators: true
29+
avoid_print: true
30+
avoid_private_typedef_functions: true
31+
avoid_redundant_argument_values: true
32+
avoid_relative_lib_imports: true
33+
avoid_renaming_method_parameters: true
34+
avoid_return_types_on_setters: true
35+
avoid_returning_null: true
36+
avoid_returning_null_for_future: true
37+
avoid_returning_null_for_void: true
38+
avoid_returning_this: true
39+
avoid_setters_without_getters: true
40+
avoid_shadowing_type_parameters: true
41+
avoid_single_cascade_in_expression_statements: true
42+
avoid_slow_async_io: true
43+
avoid_type_to_string: true
44+
avoid_types_as_parameter_names: true
45+
avoid_unnecessary_containers: true
46+
avoid_unused_constructor_parameters: true
47+
avoid_web_libraries_in_flutter: true
48+
await_only_futures: true
49+
camel_case_extensions: true
50+
camel_case_types: true
51+
cascade_invocations: true
52+
constant_identifier_names: true
53+
control_flow_in_finally: true
54+
close_sinks: true
55+
curly_braces_in_flow_control_structures: true
56+
deprecated_consistency: true
57+
directives_ordering: true
58+
empty_catches: true
59+
empty_constructor_bodies: true
60+
empty_statements: true
61+
eol_at_end_of_file: true
62+
exhaustive_cases: true
63+
file_names: true
64+
flutter_style_todos: true
65+
hash_and_equals: true
66+
implementation_imports: true
67+
invariant_booleans: true
68+
iterable_contains_unrelated_type: true
69+
join_return_with_assignment: true
70+
leading_newlines_in_multiline_strings: true
71+
library_names: true
72+
library_prefixes: true
73+
list_remove_unrelated_type: true
74+
literal_only_boolean_expressions: true
75+
missing_whitespace_between_adjacent_strings: true
76+
no_adjacent_strings_in_list: true
77+
no_duplicate_case_values: true
78+
no_logic_in_create_state: true
79+
no_runtimeType_toString: true
80+
non_constant_identifier_names: true
81+
noop_primitive_operations: true
82+
null_check_on_nullable_type_parameter: true
83+
null_closures: true
84+
omit_local_variable_types: true
85+
one_member_abstracts: true
86+
only_throw_errors: true
87+
overridden_fields: true
88+
package_api_docs: true
89+
package_names: true
90+
package_prefixed_library_names: true
91+
parameter_assignments: true
92+
prefer_adjacent_string_concatenation: true
93+
prefer_asserts_in_initializer_lists: true
94+
prefer_asserts_with_message: true
95+
prefer_collection_literals: true
96+
prefer_conditional_assignment: true
97+
prefer_const_constructors: true
98+
prefer_const_constructors_in_immutables: true
99+
prefer_const_declarations: true
100+
prefer_const_literals_to_create_immutables: true
101+
prefer_constructors_over_static_methods: true
102+
prefer_contains: true
103+
prefer_equal_for_default_values: true
104+
prefer_final_fields: true
105+
prefer_final_in_for_each: true
106+
prefer_final_locals: true
107+
prefer_for_elements_to_map_fromIterable: true
108+
prefer_foreach: true
109+
prefer_function_declarations_over_variables: true
110+
prefer_generic_function_type_aliases: true
111+
prefer_if_elements_to_conditional_expressions: true
112+
prefer_if_null_operators: true
113+
prefer_initializing_formals: true
114+
prefer_inlined_adds: true
115+
prefer_int_literals: true
116+
prefer_interpolation_to_compose_strings: true
117+
prefer_is_empty: true
118+
prefer_is_not_empty: true
119+
prefer_is_not_operator: true
120+
prefer_iterable_whereType: true
121+
prefer_mixin: true
122+
prefer_null_aware_method_calls: true
123+
prefer_null_aware_operators: true
124+
prefer_relative_imports: true
125+
prefer_single_quotes: true
126+
prefer_spread_collections: true
127+
prefer_typing_uninitialized_variables: true
128+
prefer_void_to_null: true
129+
provide_deprecation_message: true
130+
recursive_getters: true
131+
sized_box_for_whitespace: true
132+
slash_for_doc_comments: true
133+
sort_child_properties_last: true
134+
sort_constructors_first: true
135+
sort_pub_dependencies: true
136+
sort_unnamed_constructors_first: true
137+
test_types_in_equals: true
138+
throw_in_finally: true
139+
tighten_type_of_initializing_formals: true
140+
type_annotate_public_apis: true
141+
type_init_formals: true
142+
unawaited_futures: false
143+
unnecessary_await_in_return: true
144+
unnecessary_brace_in_string_interps: true
145+
unnecessary_const: true
146+
unnecessary_constructor_name: true
147+
unnecessary_getters_setters: true
148+
unnecessary_lambdas: true
149+
unnecessary_new: true
150+
unnecessary_null_aware_assignments: true
151+
unnecessary_null_checks: true
152+
unnecessary_null_in_if_null_operators: true
153+
unnecessary_nullable_for_final_variable_declarations: true
154+
unnecessary_overrides: true
155+
unnecessary_parenthesis: true
156+
unnecessary_raw_strings: true
157+
unnecessary_statements: true
158+
unnecessary_string_escapes: true
159+
unnecessary_string_interpolations: true
160+
unnecessary_this: true
161+
unrelated_type_equality_checks: true
162+
unsafe_html: true
163+
use_build_context_synchronously: true
164+
use_full_hex_values_for_flutter_colors: true
165+
use_function_type_syntax_for_parameters: true
166+
use_if_null_to_convert_nulls_to_bools: true
167+
use_is_even_rather_than_modulo: true
168+
use_key_in_widget_constructors: true
169+
use_late_for_private_fields_and_variables: true
170+
use_named_constants: true
171+
use_raw_strings: true
172+
use_rethrow_when_possible: true
173+
valid_regexps: true
174+
void_checks: true

android/app/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ android {
4343

4444
defaultConfig {
4545
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46-
applicationId "com.example.codephile"
47-
minSdkVersion 16
46+
applicationId "in.ac.iitr.mdg.codephile"
47+
minSdkVersion 21
4848
targetSdkVersion 30
4949
versionCode flutterVersionCode.toInteger()
5050
versionName flutterVersionName
@@ -66,3 +66,6 @@ flutter {
6666
dependencies {
6767
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
6868
}
69+
70+
apply plugin: 'com.google.gms.google-services'
71+
apply plugin: 'com.google.firebase.crashlytics'

android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.codephile">
2+
package="in.ac.iitr.mdg.codephile">
33
<!-- Flutter needs it to communicate with the running application
44
to allow setting breakpoints, to provide hot reload, etc.
55
-->

android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.codephile">
2+
package="in.ac.iitr.mdg.codephile">
33
<application
4-
android:label="codephile"
4+
android:label="Codephile"
55
android:icon="@mipmap/ic_launcher">
66
<activity
77
android:name=".MainActivity"

android/app/src/main/kotlin/com/example/codephile/MainActivity.kt renamed to android/app/src/main/kotlin/in/ac/iitr/mdg/codephile/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.example.codephile
1+
package `in`.ac.iitr.mdg.codephile
22

33
import io.flutter.embedding.android.FlutterActivity
44

0 commit comments

Comments
 (0)