Skip to content
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

[#73] 버전 정보 가져오기 #75

Merged
merged 7 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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 .github/workflows/flutter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
JAVA_VERSION: "21.x"
FLUTTER_VERSION: "3.19.3"
FLUTTER_VERSION: "3.24.3"

jobs:
analyze:
Expand Down
8 changes: 4 additions & 4 deletions lib/features/contest/screen/contest_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,10 @@ class _ContestViewState extends State<ContestView> {
backgroundColor: state
.isOnNotificationUpcomingContests[
index]
? MaterialStateProperty.all(
? WidgetStateProperty.all(
MySolvedColor
.secondaryButtonBackground)
: MaterialStateProperty.all(
: WidgetStateProperty.all(
MySolvedColor.main),
),
icon: Icon(
Expand All @@ -197,10 +197,10 @@ class _ContestViewState extends State<ContestView> {
backgroundColor: state
.isOnCalendarUpcomingContests[
index]
? MaterialStateProperty.all(
? WidgetStateProperty.all(
MySolvedColor
.secondaryButtonBackground)
: MaterialStateProperty.all(
: WidgetStateProperty.all(
MySolvedColor.main),
),
icon: Icon(
Expand Down
7 changes: 7 additions & 0 deletions lib/features/root/bloc/root_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:equatable/equatable.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:meta/meta.dart';
import 'package:package_info_plus/package_info_plus.dart';

part 'root_event.dart';
part 'root_state.dart';
Expand All @@ -9,6 +10,12 @@ class RootBloc extends Bloc<RootEvent, RootState> {
final String handle;

RootBloc({required this.handle}) : super(RootState(handle: handle)) {
on<VersionInfoInit>(
(event, emit) async {
final packageInfo = await PackageInfo.fromPlatform();
emit(state.copyWith(version: packageInfo.version));
},
);
on<NavigationBarItemTapped>(
(event, emit) => emit(state.copyWith(tabIndex: event.tabIndex)),
);
Expand Down
7 changes: 3 additions & 4 deletions lib/features/root/bloc/root_event.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
part of 'root_bloc.dart';

@immutable
abstract class RootEvent extends Equatable {}
abstract class RootEvent {}

class VersionInfoInit extends RootEvent {}

class NavigationBarItemTapped extends RootEvent {
final int tabIndex;

NavigationBarItemTapped({required this.tabIndex});

@override
List<Object?> get props => [tabIndex];
}
11 changes: 9 additions & 2 deletions lib/features/root/bloc/root_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@ part of 'root_bloc.dart';
class RootState extends Equatable {
final String handle;
final int tabIndex;
final String version;

const RootState({required this.handle, this.tabIndex = 0});
const RootState({
required this.handle,
this.tabIndex = 0,
this.version = "",
});

RootState copyWith({
String? handle,
int? tabIndex,
String? version,
}) {
return RootState(
handle: handle ?? this.handle,
tabIndex: tabIndex ?? this.tabIndex,
version: version ?? this.version,
);
}

@override
List<Object?> get props => [handle, tabIndex];
List<Object?> get props => [handle, tabIndex, version];
}
8 changes: 4 additions & 4 deletions lib/features/search_filter/screen/search_filter_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ class _SearchFilterViewState extends State<SearchFilterView> {
inactiveThumbColor: MySolvedColor.background,
inactiveTrackColor:
MySolvedColor.disabledButtonBackground,
trackOutlineColor: MaterialStateProperty.resolveWith(
trackOutlineColor: WidgetStateProperty.resolveWith(
(states) {
if (states.contains(MaterialState.selected)) {
if (states.contains(WidgetState.selected)) {
return null;
}
return MySolvedColor.disabledButtonBackground;
Expand Down Expand Up @@ -174,9 +174,9 @@ class _SearchFilterViewState extends State<SearchFilterView> {
inactiveThumbColor: MySolvedColor.background,
inactiveTrackColor:
MySolvedColor.disabledButtonBackground,
trackOutlineColor: MaterialStateProperty.resolveWith(
trackOutlineColor: WidgetStateProperty.resolveWith(
(states) {
if (states.contains(MaterialState.selected)) {
if (states.contains(WidgetState.selected)) {
return null;
}
return MySolvedColor.disabledButtonBackground;
Expand Down
4 changes: 2 additions & 2 deletions lib/features/setting/screen/setting_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ class _SettingViewState extends State<SettingView> {
inactiveThumbColor: MySolvedColor.background,
inactiveTrackColor:
MySolvedColor.disabledButtonBackground,
trackOutlineColor: MaterialStateProperty.resolveWith(
trackOutlineColor: WidgetStateProperty.resolveWith(
(states) {
if (states.contains(MaterialState.selected)) {
if (states.contains(WidgetState.selected)) {
return null;
}
return MySolvedColor.disabledButtonBackground;
Expand Down
7 changes: 4 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
flutter:
sdk: flutter

add_2_calendar: ^3.0.1
cupertino_icons: ^1.0.5
equatable: ^2.0.5
extended_image: ^8.1.0
Expand All @@ -20,20 +21,20 @@ dependencies:
flutter_local_notifications: ^17.2.3
flutter_native_timezone: ^2.0.0
flutter_radar_chart: ^0.2.1
pie_chart: ^5.4.0
flutter_staggered_grid_view: ^0.7.0
flutter_svg: ^2.0.7
flutter_widget_from_html_core: ^0.14.11
html: ^0.15.2
http: ^1.1.0
intl: ^0.18.0
meta: ^1.9.1
package_info_plus: ^8.0.2
permission_handler: ^11.3.1
pie_chart: ^5.4.0
provider: ^6.0.5
shared_preferences: ^2.0.18
timezone: ^0.9.1
url_launcher: ^6.1.10
permission_handler: ^11.3.1
add_2_calendar: ^3.0.1

boj_api:
path: packages/apis/boj_api
Expand Down