Skip to content

Commit

Permalink
country setting and refresh home implt
Browse files Browse the repository at this point in the history
  • Loading branch information
HemantKArya committed Apr 26, 2024
1 parent 1fbdbce commit 30d42c8
Show file tree
Hide file tree
Showing 8 changed files with 375 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ jobs:
run: jarsigner --verify --verbose build/app/outputs/flutter-apk/app-release.apk

- name: Rename APK file
run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/bloomee_tunes_v2.7.9+${{github.run_number}}.apk
run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/bloomee_tunes_v2.7.10+${{github.run_number}}.apk

- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Release
path: |
build/app/outputs/flutter-apk/bloomee_tunes_v2.7.9+${{github.run_number}}.apk
build/app/outputs/flutter-apk/bloomee_tunes_v2.7.10+${{github.run_number}}.apk
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/flutter-apk/bloomee_tunes_v2.7.9+${{github.run_number}}.apk"
tag: v2.7.9+${{github.run_number}}
artifacts: "build/app/outputs/flutter-apk/bloomee_tunes_v2.7.10+${{github.run_number}}.apk"
tag: v2.7.10+${{github.run_number}}
token: ${{secrets.SECRET_KEY}}
21 changes: 20 additions & 1 deletion lib/blocs/settings_cubit/cubit/settings_cubit.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:developer';
import 'package:Bloomee/routes_and_consts/global_str_consts.dart';
import 'package:Bloomee/services/db/bloomee_db_service.dart';
import 'package:bloc/bloc.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:path_provider/path_provider.dart';
part 'settings_state.dart';

Expand Down Expand Up @@ -82,6 +82,15 @@ class SettingsCubit extends Cubit<SettingsState> {
BloomeeDBService.getSettingBool(GlobalStrConsts.autoBackup).then((value) {
emit(state.copyWith(autoBackup: value ?? false));
});

BloomeeDBService.getSettingBool(GlobalStrConsts.autoGetCountry)
.then((value) {
emit(state.copyWith(autoGetCountry: value ?? false));
});

BloomeeDBService.getSettingStr(GlobalStrConsts.countryCode).then((value) {
emit(state.copyWith(countryCode: value ?? "IN"));
});
}

void autoUpdate() {
Expand All @@ -92,6 +101,16 @@ class SettingsCubit extends Cubit<SettingsState> {
});
}

void setCountryCode(String value) {
BloomeeDBService.putSettingStr(GlobalStrConsts.countryCode, value);
emit(state.copyWith(countryCode: value));
}

void setAutoGetCountry(bool value) {
BloomeeDBService.putSettingBool(GlobalStrConsts.autoGetCountry, value);
emit(state.copyWith(autoGetCountry: value));
}

void setAutoUpdateNotify(bool value) {
BloomeeDBService.putSettingBool(GlobalStrConsts.autoUpdateNotify, value);
emit(state.copyWith(autoUpdateNotify: value));
Expand Down
10 changes: 10 additions & 0 deletions lib/blocs/settings_cubit/cubit/settings_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class SettingsState {
String backupPath;
bool autoBackup;
String historyClearTime;
bool autoGetCountry;
String countryCode;
SettingsState({
required this.autoUpdateNotify,
required this.autoSlideCharts,
Expand All @@ -23,6 +25,8 @@ class SettingsState {
required this.backupPath,
required this.autoBackup,
required this.historyClearTime,
required this.autoGetCountry,
required this.countryCode,
});

SettingsState copyWith({
Expand All @@ -36,6 +40,8 @@ class SettingsState {
String? backupPath,
bool? autoBackup,
String? historyClearTime,
bool? autoGetCountry,
String? countryCode,
}) {
return SettingsState(
autoUpdateNotify: autoUpdateNotify ?? this.autoUpdateNotify,
Expand All @@ -48,6 +54,8 @@ class SettingsState {
backupPath: backupPath ?? this.backupPath,
autoBackup: autoBackup ?? this.autoBackup,
historyClearTime: historyClearTime ?? this.historyClearTime,
autoGetCountry: autoGetCountry ?? this.autoGetCountry,
countryCode: countryCode ?? this.countryCode,
);
}
}
Expand All @@ -65,5 +73,7 @@ final class SettingsInitial extends SettingsState {
backupPath: "",
autoBackup: true,
historyClearTime: "30",
autoGetCountry: true,
countryCode: "IN",
);
}
2 changes: 2 additions & 0 deletions lib/routes_and_consts/global_str_consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ class GlobalStrConsts {
static const String backupPath = "backupPath";
static const String autoBackup = "autoBackup";
static const String historyClearTime = "autoHistoryCleanupTime";
static const String autoGetCountry = "autoGetCountry";
static const String countryCode = "countryCode";
}
13 changes: 13 additions & 0 deletions lib/screens/screen/home_views/setting_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import 'package:Bloomee/screens/screen/home_views/setting_views/about.dart';
import 'package:Bloomee/screens/screen/home_views/setting_views/appui_setting.dart';
import 'package:Bloomee/screens/screen/home_views/setting_views/backup_setting.dart';
import 'package:Bloomee/screens/screen/home_views/setting_views/country_setting.dart';
import 'package:Bloomee/screens/screen/home_views/setting_views/download_setting.dart';
import 'package:Bloomee/screens/screen/home_views/setting_views/stream_setting.dart';
import 'package:Bloomee/screens/screen/home_views/setting_views/updates_setting.dart';
Expand Down Expand Up @@ -92,6 +93,18 @@ class SettingsView extends StatelessWidget {
),
);
}),
settingListTile(
title: "Language & Country",
subtitle: "Select your language and country.",
icon: MingCute.globe_fill,
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const CountrySettings(),
),
);
}),
settingListTile(
title: "About",
subtitle: "About the app, version, developer, etc.",
Expand Down
Loading

0 comments on commit 30d42c8

Please sign in to comment.