Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "pub"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
40 changes: 40 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: pull_request_template.md
about: Template for pull requests
title: '[FEATURE] '
labels: ''
assignees: ''

---

## Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

- [ ] Test A
- [ ] Test B

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
37 changes: 37 additions & 0 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Code Quality

on:
pull_request:
branches:
- main
- develop

jobs:
code_quality:
name: Code Quality Checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.35.4'
channel: 'stable'
cache: true

- name: Get dependencies
run: flutter pub get

- name: Check Dart code formatting
run: dart format --output=none --set-exit-if-changed .

- name: Analyze project
run: flutter analyze

- name: Run tests with coverage
run: flutter test --coverage

- name: Check for build warnings
run: flutter build apk --debug --quiet
126 changes: 126 additions & 0 deletions .github/workflows/flutter_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Flutter CI

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
flutter_test:
name: Flutter Test and Analyze
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.35.4'
channel: 'stable'
cache: true

- name: Get dependencies
run: flutter pub get

- name: Check format
run: dart format --output=none --set-exit-if-changed .

- name: Analyze
run: flutter analyze

- name: Run tests
run: flutter test --coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage/lcov.info

build_android:
name: Build Android App
runs-on: ubuntu-latest
needs: flutter_test
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.35.4'
channel: 'stable'
cache: true

- name: Get dependencies
run: flutter pub get

- name: Build APK
run: flutter build apk --release

- name: Build App Bundle
run: flutter build appbundle --release

- name: Upload APK as artifact
uses: actions/upload-artifact@v4
with:
name: release-apk
path: build/app/outputs/flutter-apk/app-release.apk

- name: Upload App Bundle as artifact
uses: actions/upload-artifact@v4
with:
name: release-appbundle
path: build/app/outputs/bundle/release/app-release.aab

build_ios:
name: Build iOS App
runs-on: macos-latest
needs: flutter_test
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.35.4'
channel: 'stable'
cache: true

- name: Get dependencies
run: flutter pub get

- name: Build iOS
run: flutter build ios --release --no-codesign

- name: Create IPA
run: |
cd build/ios/iphoneos
mkdir Payload
cp -r Runner.app Payload/
zip -r app-release.ipa Payload/

- name: Upload IPA as artifact
uses: actions/upload-artifact@v4
with:
name: release-ipa
path: build/ios/iphoneos/app-release.ipa
73 changes: 73 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

build_and_upload_assets:
name: Build and Upload Release Assets
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.35.4'
channel: 'stable'
cache: true

- name: Get dependencies
run: flutter pub get

- name: Build APK
run: flutter build apk --release

- name: Build App Bundle
run: flutter build appbundle --release

- name: Upload APK to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/app/outputs/flutter-apk/app-release.apk
asset_name: app-release.apk
asset_content_type: application/vnd.android.package-archive

- name: Upload App Bundle to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/app/outputs/bundle/release/app-release.aab
asset_name: app-release.aab
asset_content_type: application/x-authorware-bin
4 changes: 4 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,9 @@ linter:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

analyzer:
errors:
invalid_annotation_target: ignore

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
6 changes: 3 additions & 3 deletions lib/core/config/app_constant.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const BASE_URL= "https://api.themoviedb.org/3/";
const API_KEY ="59cd6896d8432f9c69aed9b86b9c2931";
const IMAGE_URL = "https://image.tmdb.org/t/p/w342/";
const baseUrl = "https://api.themoviedb.org/3/";
const apiKey = "59cd6896d8432f9c69aed9b86b9c2931";
const imageUrl = "https://image.tmdb.org/t/p/w342/";
2 changes: 1 addition & 1 deletion lib/core/hive/favorite_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ class Favorite extends HiveObject {
this.overview,
this.releaseDate,
});
}
}
7 changes: 3 additions & 4 deletions lib/core/hive/hive_helper.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:flutter/foundation.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:flutter_movie_clean_architecture/core/hive/favorite_model.dart';

Expand All @@ -9,10 +8,10 @@ class HiveHelper {
static Future<void> init() async {
// Initialize Hive
await Hive.initFlutter();

// Register adapter
Hive.registerAdapter(FavoriteAdapter());

// Open box
_box = await Hive.openBox<Favorite>(_boxName);
}
Expand Down Expand Up @@ -58,4 +57,4 @@ class HiveHelper {
static Future<void> close() async {
await _box?.close();
}
}
}
29 changes: 14 additions & 15 deletions lib/core/network/dio_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:pretty_dio_logger/pretty_dio_logger.dart';

final dioProvider = Provider<Dio>((ref) {
final dio = Dio(BaseOptions(
baseUrl: BASE_URL,
queryParameters: {
'api_key': API_KEY,
},
));
dio.interceptors.add(PrettyDioLogger(
requestHeader: true,
requestBody: true,
responseBody: true,
responseHeader: false,
error: true,
compact: true,
maxWidth: 90,
));
final dio = Dio(
BaseOptions(baseUrl: baseUrl, queryParameters: {'api_key': apiKey}),
);
dio.interceptors.add(
PrettyDioLogger(
requestHeader: true,
requestBody: true,
responseBody: true,
responseHeader: false,
error: true,
compact: true,
maxWidth: 90,
),
);
return dio;
});
2 changes: 1 addition & 1 deletion lib/core/utils/pagination_consumer_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,4 @@ abstract class PaginationConsumerState<T, W extends ConsumerStatefulWidget>
],
);
}
}
}
Loading
Loading