Skip to content

Commit

Permalink
Change in workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sidhdhi-p committed Jan 23, 2024
0 parents commit 827ae8c
Show file tree
Hide file tree
Showing 203 changed files with 9,858 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/Analyze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Analyze

on: push

jobs:
analyze:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
name: Checkout

- uses: subosito/[email protected]
name: Set up Flutter SDK
with:
channel: 'stable'
cache: true

- name: Install dependencies
run: |
cd app
flutter clean
flutter pub get
cd ../data
flutter clean
flutter pub get
cd ../style
flutter clean
flutter pub get
cd ..
- name: Lint test
run: |
cd app
dart analyze --fatal-infos
cd ../data
dart analyze --fatal-infos
cd ../style
dart analyze --fatal-infos
cd ..
57 changes: 57 additions & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build

on: push

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
name: Checkout

- uses: subosito/[email protected]
name: Set up Flutter SDK
with:
channel: 'stable'
cache: true

- name: Install dependencies
run: |
cd app
flutter clean
flutter pub get
cd ../data
flutter clean
flutter pub get
cd ../style
flutter clean
flutter pub get
cd ..
- name: Build android APK
run: |
cd app
file='VERSION'
fileData=$(cat $file)
IFS='.'
read -a versionValue <<< "$fileData"
buildNumber=$(( ${versionValue[0]} * 1000000 + ${versionValue[1]} * 10000 + CI_PIPELINE_IID ))
IFS=''
buildName="${versionValue[0]}.${versionValue[1]}.$CI_PIPELINE_IID"
echo "Generating android build $buildName $buildNumber"
flutter build apk --release --build-number=$buildNumber --build-name=$buildName
mv build/app/outputs/apk/release/*.apk .
cd ..
- name: Archive Artifacts
uses: actions/upload-artifact@v4
with:
name: khelo.apk
path: app/*.apk
if-no-files-found: error
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.swp
.idea/
.DS_Store
23 changes: 23 additions & 0 deletions build_watch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Function to terminate all background processes on exit
function cleanup {
pkill -P $$
}
trap cleanup EXIT

# Function to keep running a command until it succeeds
function keep_running {
while true; do
dart run build_runner watch --delete-conflicting-outputs;
echo "Command failed with no zero exit code. Respawning.."
sleep 1
done
}

# Navigate to each project directory and run the watcher in the background
(cd app && keep_running) &
(cd data && keep_running) &

# Wait for all background processes to finish
wait
12 changes: 12 additions & 0 deletions data/.flutter-plugins
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This is a generated file; do not edit or check into version control.
device_info_plus=/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/device_info_plus-9.1.1/
flutter_timezone=/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/flutter_timezone-1.0.8/
package_info_plus=/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/package_info_plus-5.0.1/
path_provider_linux=/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/
path_provider_windows=/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/
shared_preferences=/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/shared_preferences-2.2.2/
shared_preferences_android=/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/
shared_preferences_foundation=/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/
shared_preferences_linux=/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/
shared_preferences_web=/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/shared_preferences_web-2.2.2/
shared_preferences_windows=/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/
1 change: 1 addition & 0 deletions data/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/device_info_plus-9.1.1/","native_build":true,"dependencies":[]},{"name":"flutter_timezone","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/flutter_timezone-1.0.8/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/package_info_plus-5.0.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"device_info_plus","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/device_info_plus-9.1.1/","native_build":true,"dependencies":[]},{"name":"flutter_timezone","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/flutter_timezone-1.0.8/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/package_info_plus-5.0.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/shared_preferences_android-2.2.1/","native_build":true,"dependencies":[]}],"macos":[{"name":"device_info_plus","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/device_info_plus-9.1.1/","native_build":true,"dependencies":[]},{"name":"flutter_timezone","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/flutter_timezone-1.0.8/","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/package_info_plus-5.0.1/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.3.5/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/device_info_plus-9.1.1/","native_build":false,"dependencies":[]},{"name":"package_info_plus","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/package_info_plus-5.0.1/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/path_provider_linux-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.3.2/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"device_info_plus","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/device_info_plus-9.1.1/","native_build":false,"dependencies":[]},{"name":"package_info_plus","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/package_info_plus-5.0.1/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/path_provider_windows-2.2.1/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.3.2/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"device_info_plus","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/device_info_plus-9.1.1/","dependencies":[]},{"name":"flutter_timezone","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/flutter_timezone-1.0.8/","dependencies":[]},{"name":"package_info_plus","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/package_info_plus-5.0.1/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/sidhdhi.p/.pub-cache/hosted/pub.dev/shared_preferences_web-2.2.2/","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"flutter_timezone","dependencies":[]},{"name":"package_info_plus","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2024-01-23 10:49:28.245095","version":"3.16.8"}
29 changes: 29 additions & 0 deletions data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
build/
10 changes: 10 additions & 0 deletions data/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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.

version:
revision: "b0366e0a3f089e15fd89c97604ab402fe26b724c"
channel: "stable"

project_type: package
3 changes: 3 additions & 0 deletions data/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 0.0.1

* TODO: Describe initial release.
1 change: 1 addition & 0 deletions data/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TODO: Add your license here.
39 changes: 39 additions & 0 deletions data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!--
This README describes the package. If you publish this package to pub.dev,
this README's contents appear on the landing page for your package.
For information about how to write a good package README, see the guide for
[writing package pages](https://dart.dev/guides/libraries/writing-package-pages).
For general information about developing packages, see the Dart guide for
[creating packages](https://dart.dev/guides/libraries/create-library-packages)
and the Flutter guide for
[developing packages and plugins](https://flutter.dev/developing-packages).
-->

TODO: Put a short description of the package here that helps potential users
know whether this package might be useful for them.

## Features

TODO: List what your package can do. Maybe include images, gifs, or videos.

## Getting started

TODO: List prerequisites and provide or point to information on how to
start using the package.

## Usage

TODO: Include short and useful examples for package users. Add longer examples
to `/example` folder.

```dart
const like = 'sample';
```

## Additional information

TODO: Tell users more about the package: where to find more information, how to
contribute to the package, how to file issues, what response they can expect
from the package authors, and more.
4 changes: 4 additions & 0 deletions data/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include: package:flutter_lints/flutter.yaml

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
9 changes: 9 additions & 0 deletions data/lib/api/network/client.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import 'package:dio/dio.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

final rawDioProvider = Provider((ref) {
return Dio()
..options.connectTimeout = const Duration(seconds: 30)
..options.sendTimeout = const Duration(seconds: 30)
..options.receiveTimeout = const Duration(seconds: 30);
});
89 changes: 89 additions & 0 deletions data/lib/api/user/user_models.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// ignore_for_file: non_constant_identifier_names

import 'dart:convert';

import 'package:freezed_annotation/freezed_annotation.dart';

part 'user_models.freezed.dart';

part 'user_models.g.dart';

@freezed
class User with _$User {
const User._();

const factory User({
required int id,
String? name,
String? location,
String? phone,
String? dob,
String? email,
String? profile_img_url,
UserGender? gender,
DateTime? created_at,
DateTime? updated_at,
String? player_role,
String? batting_style,
String? bowling_style,
}) = _User;

factory User.fromJson(Map<String, dynamic> json) =>
_$UserFromJson(json);

String toJsonString() => jsonEncode(toJson());

static User? fromJsonString(String json) =>
User.fromJson(jsonDecode(json));
}

@JsonEnum(valueField: "value")
enum UserGender {
unknown(0),
male(1),
female(2);

final int value;

const UserGender(this.value);
}

@JsonEnum(valueField: "value")
enum PlayerRole {
unknown(0),
topOrderBatter(1),
middleOrderBatter(2),
wickerKeeperBatter(3),
wicketKeeper(4),
bowler(5),
allRounder(6),
lowerOrderBatter(7),
openingBatter(8),
none(9);

final int value;

const PlayerRole(this.value);
}

@JsonEnum(valueField: "value")
enum BattingStyle {
unknown(0),
rightHandBat(1),
leftHandBat(2);

final int value;

const BattingStyle(this.value);
}

@JsonEnum(valueField: "value")
enum BowlingStyle {
unknown(0),
male(1),
female(2);

final int value;

const BowlingStyle(this.value);
}
Loading

0 comments on commit 827ae8c

Please sign in to comment.