Skip to content

chore: update project #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 29, 2024
Merged
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
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.4.2" apply false
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
id "com.google.gms.google-services" version "4.4.0" apply false
}
Expand Down
1 change: 1 addition & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"flutter":{"platforms":{"android":{"default":{"projectId":"fireship-lessons","appId":"1:758773997881:android:743b0bba6de867fcd1c8e8","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"fireship-lessons","configurations":{"android":"1:758773997881:android:743b0bba6de867fcd1c8e8","ios":"1:758773997881:ios:82656735bc074188d1c8e8"}}}}}}
74 changes: 74 additions & 0 deletions lib/firebase_options.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// File generated by FlutterFire CLI.
// ignore_for_file: type=lint
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;

/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for web - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}

static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyBCCNqoW8gtIn2DYeqlC-dWP8SmiOvRD8Y',
appId: '1:758773997881:android:743b0bba6de867fcd1c8e8',
messagingSenderId: '758773997881',
projectId: 'fireship-lessons',
databaseURL: 'https://fireship-lessons.firebaseio.com',
storageBucket: 'fireship-lessons.appspot.com',
);

static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyCHpFJY54w_YiXjCOfbVbsefn91FFUJ9PE',
appId: '1:758773997881:ios:82656735bc074188d1c8e8',
messagingSenderId: '758773997881',
projectId: 'fireship-lessons',
databaseURL: 'https://fireship-lessons.firebaseio.com',
storageBucket: 'fireship-lessons.appspot.com',
androidClientId:
'758773997881-b4g2gerk1isv5ehq4h9s63hgnn433rjc.apps.googleusercontent.com',
iosClientId:
'758773997881-sk4tfalbk1oqh5f2vv4gbcjqdlm7lq5f.apps.googleusercontent.com',
iosBundleId: 'io.fireship.quizapp',
);
}
2 changes: 1 addition & 1 deletion lib/login/view/login_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class SignInButton extends StatelessWidget {
style: style,
icon: Icon(icon),
onPressed: onPressed,
label: Expanded(child: child),
label: child,
);
}
return TextButton(
Expand Down
4 changes: 3 additions & 1 deletion lib/main_development.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import 'package:api_client/api_client.dart';
import 'package:quizapp/app/app.dart';
import 'package:quizapp/firebase_options.dart';
import 'package:user_repository/user_repository.dart';

Future<void> main() async {
await bootstrap(
init: Firebase.initializeApp,
init: () =>
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform),
builder: () async {
// ? initialize development dependencies
final userRepository = UserRepository();
Expand Down
4 changes: 3 additions & 1 deletion lib/main_production.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import 'package:api_client/api_client.dart';
import 'package:quizapp/app/app.dart';
import 'package:quizapp/firebase_options.dart';
import 'package:user_repository/user_repository.dart';

Future<void> main() async {
await bootstrap(
init: Firebase.initializeApp,
init: () =>
Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform),
builder: () async {
// ? initialize production dependencies
final userRepository = UserRepository();
Expand Down
6 changes: 5 additions & 1 deletion lib/quiz/view/quiz_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ class _QuizBodyState extends State<QuizBody> {
child: const QuizAnswerDetails(),
);
},
).whenComplete(() => context.read<QuizCubit>().unselectOption());
).whenComplete(() {
if (context.mounted) {
context.read<QuizCubit>().unselectOption();
}
});
} else {
context.popUntil((route) => route.settings.name == QuizPage.name);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/topics/view/topic_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class TopicPage extends StatelessWidget {
Widget build(BuildContext context) {
return PopScope(
canPop: false,
onPopInvoked: (didPop) {
if (!didPop) {
onPopInvokedWithResult: (canPop, __) {
if (!canPop) {
context.flow<TopicsFlowState>().deselectTopic();
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/api_client/lib/api_client.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// API Client
library api_client;
library;

export 'package:cloud_firestore/cloud_firestore.dart';
export 'package:firebase_auth/firebase_auth.dart';
Expand Down
12 changes: 6 additions & 6 deletions packages/api_client/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ environment:
dependencies:
app_core:
path: ../app_core
cloud_firestore: ^4.15.10
firebase_auth: ^4.18.0
firebase_core: ^2.27.2
cloud_firestore: ^5.6.0
firebase_auth: ^5.3.4
firebase_core: ^3.9.0
flutter:
sdk: flutter
google_sign_in: ^6.2.1
sign_in_with_apple: ^6.0.0
google_sign_in: ^6.2.2
sign_in_with_apple: ^6.1.4

dev_dependencies:
very_good_analysis: ^5.1.0
very_good_analysis: ^7.0.0

2 changes: 1 addition & 1 deletion packages/app_core/lib/app_core.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// App core
library app_core;
library;

export 'dart:async';

Expand Down
12 changes: 6 additions & 6 deletions packages/app_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: app_core
description: App core package.
version: 1.0.0
version: 1.0.0+1
publish_to: none

environment:
sdk: '>=3.0.0 <4.0.0'

dependencies:
bloc: ^8.1.4
crypto: ^3.0.3
equatable: ^2.0.5
crypto: ^3.0.6
equatable: ^2.0.7
flutter:
sdk: flutter
json_annotation: ^4.8.1
json_annotation: ^4.9.0
provider: ^6.1.2
rxdart: ^0.27.7
rxdart: ^0.28.0

dev_dependencies:
very_good_analysis: ^5.1.0
very_good_analysis: ^7.0.0
2 changes: 1 addition & 1 deletion packages/app_ui/lib/app_ui.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// App UI
library app_ui;
library;

export 'package:flutter_spinkit/flutter_spinkit.dart';
export 'package:font_awesome_flutter/font_awesome_flutter.dart';
Expand Down
4 changes: 2 additions & 2 deletions packages/app_ui/lib/src/widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class AnimatedProgressBar extends StatelessWidget {
Container(
height: height,
decoration: BoxDecoration(
color: context.theme.colorScheme.background,
color: context.theme.colorScheme.surface,
borderRadius: BorderRadius.all(
Radius.circular(height),
),
Expand Down Expand Up @@ -154,7 +154,7 @@ class ActionButton extends StatelessWidget {
minimumSize: Size.zero,
padding: const EdgeInsets.all(10),
);
return ButtonBar(
return OverflowBar(
alignment: MainAxisAlignment.center,
children: [
if (_icon != null)
Expand Down
6 changes: 3 additions & 3 deletions packages/app_ui/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: app_ui
description: App UI package.
version: 1.0.0
version: 1.0.0+1
publish_to: none

environment:
Expand All @@ -10,9 +10,9 @@ dependencies:
flutter:
sdk: flutter
flutter_spinkit: ^5.2.1
font_awesome_flutter: ^10.7.0
font_awesome_flutter: ^10.8.0
google_fonts: ^6.2.1
transparent_image: ^2.0.1

dev_dependencies:
very_good_analysis: ^5.1.0
very_good_analysis: ^7.0.0
2 changes: 1 addition & 1 deletion packages/quizzes_repository/lib/quizzes_repository.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Quizzes repository
library quizzes_repository;
library;

export 'src/failures.dart';
export 'src/models/models.dart';
Expand Down
16 changes: 7 additions & 9 deletions packages/quizzes_repository/lib/src/models/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import 'package:app_core/app_core.dart';

part 'models.g.dart';

// ignore_for_file: sort_constructors_first

@JsonSerializable(createToJson: false)
class Option extends Equatable {
const Option({
Expand All @@ -12,6 +10,8 @@ class Option extends Equatable {
required this.correct,
});

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

final String value;
@JsonKey(defaultValue: '')
final String detail;
Expand All @@ -21,8 +21,6 @@ class Option extends Equatable {

@override
List<Object?> get props => [value, detail, correct];

factory Option.fromJson(Map<String, dynamic> json) => _$OptionFromJson(json);
}

extension OptionExtensions on Option {
Expand All @@ -36,6 +34,9 @@ class Question extends Equatable {
required this.options,
});

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

final String text;
@JsonKey(defaultValue: <Option>[])
final List<Option> options;
Expand All @@ -44,9 +45,6 @@ class Question extends Equatable {

@override
List<Object?> get props => [text, options];

factory Question.fromJson(Map<String, dynamic> json) =>
_$QuestionFromJson(json);
}

@JsonSerializable(createToJson: false)
Expand All @@ -60,6 +58,8 @@ class Quiz extends Equatable {
required this.questions,
});

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

final String id;
final String title;
final String description;
Expand Down Expand Up @@ -87,8 +87,6 @@ class Quiz extends Equatable {
video,
questions,
];

factory Quiz.fromJson(Map<String, dynamic> json) => _$QuizFromJson(json);
}

extension QuizExtensions on Quiz {
Expand Down
6 changes: 3 additions & 3 deletions packages/quizzes_repository/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ dependencies:
sdk: flutter

dev_dependencies:
build_runner: ^2.4.9
json_serializable: ^6.7.1
very_good_analysis: ^5.1.0
build_runner: ^2.4.14
json_serializable: ^6.9.2
very_good_analysis: ^7.0.0
10 changes: 4 additions & 6 deletions packages/topics_repository/lib/src/models/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import 'package:app_core/app_core.dart';

part 'models.g.dart';

// ignore_for_file: sort_constructors_first

@JsonSerializable(createToJson: false)
class Quiz extends Equatable {
const Quiz({
Expand All @@ -12,6 +10,8 @@ class Quiz extends Equatable {
required this.description,
});

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

final String id;
final String title;
final String description;
Expand All @@ -24,8 +24,6 @@ class Quiz extends Equatable {

@override
List<Object?> get props => [id, title, description];

factory Quiz.fromJson(Map<String, dynamic> json) => _$QuizFromJson(json);
}

@JsonSerializable(createToJson: false)
Expand All @@ -38,6 +36,8 @@ class Topic extends Equatable {
required this.quizzes,
});

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

final String id;
final String title;
@JsonKey(defaultValue: '')
Expand All @@ -56,8 +56,6 @@ class Topic extends Equatable {

@override
List<Object?> get props => [id, title, description, imageName, quizzes];

factory Topic.fromJson(Map<String, dynamic> json) => _$TopicFromJson(json);
}

extension TopicExtensions on Topic {
Expand Down
2 changes: 1 addition & 1 deletion packages/topics_repository/lib/topics_repository.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// Topics repository
library topics_repository;
library;

export 'src/failures.dart';
export 'src/models/models.dart';
Expand Down
6 changes: 3 additions & 3 deletions packages/topics_repository/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ dependencies:
sdk: flutter

dev_dependencies:
build_runner: ^2.4.9
json_serializable: ^6.7.1
very_good_analysis: ^5.1.0
build_runner: ^2.4.14
json_serializable: ^6.9.2
very_good_analysis: ^7.0.0
Loading
Loading