Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b9f5f1b

Browse files
authored
Merge pull request #33 from flutter-news-app-full-source-code/refactor-change-the-package-name
Refactor change the package name
2 parents 96c3f6d + b8a5dbb commit b9f5f1b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+793
-1085
lines changed

‎.github/dependabot.yaml‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,16 @@ updates:
1010
schedule:
1111
interval: "weekly"
1212
ignore:
13-
- dependency-name: "ht_*"
13+
- dependency-name: "auth_api"
14+
- dependency-name: "auth_client"
15+
- dependency-name: "auth_inmemory"
16+
- dependency-name: "auth_repository"
17+
- dependency-name: "core"
18+
- dependency-name: "data_api"
19+
- dependency-name: "data_client"
20+
- dependency-name: "data_inmemory"
21+
- dependency-name: "data_repository"
22+
- dependency-name: "http_client"
23+
- dependency-name: "kv_storage_service"
24+
- dependency-name: "kv_storage_shared_preferences"
25+
- dependency-name: "ui_kit"

‎.github/workflows/deploy.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: deploy
1+
name: cd
22

33
# Run this workflow when a new release is published
44
on:
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
# 1. Checkout the repository code
1313
- name: Checkout
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515

1616
# 2. Setup Flutter SDK
1717
- name: Setup Flutter
@@ -26,11 +26,11 @@ jobs:
2626

2727
# 4. Build the Flutter web app
2828
- name: Build Web App
29-
run: flutter build web --release --base-href /ht-dashboard/
29+
run: flutter build web --release --base-href /flutter-news-app-web-dashboard-full-source-code/
3030

3131
# 5. Deploy the built app to GitHub Pages
3232
- name: Deploy
33-
uses: peaceiris/actions-gh-pages@v3
33+
uses: peaceiris/actions-gh-pages@v4
3434
with:
3535
github_token: ${{ secrets.GITHUB_TOKEN }}
3636
publish_dir: ./build/web

‎README.md‎

Lines changed: 68 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,108 @@
1-
# 📊✨ ht_dashboard
1+
<div align="center">
2+
<img src="https://avatars.githubusercontent.com/u/202675624?s=400&u=2daf23e8872a3b666bcd4f792a21fe2633097e79&v=4" alt="Flutter News App Dashboard Logo" width="220">
23

3-
![coverage: percentage](https://img.shields.io/badge/coverage-XX-green)
4-
[![Demo: Live](https://img.shields.io/badge/Demo-Live-orange)](https://headlines-toolkit.github.io/ht-dashboard/)
5-
[![style: very good analysis](https://img.shields.io/badge/style-very_good_analysis-B22C89.svg)](https://pub.dev/packages/very_good_analysis)
6-
[![License: PolyForm Free Trial](https://img.shields.io/badge/License-PolyForm%20Free%20Trial-blue)](https://polyformproject.org/licenses/free-trial/1.0.0)
4+
# Flutter News App - Web Dashboard Full Source Code
75

8-
`ht_dashboard` is a Flutter web application designed as a comprehensive content management and administration interface for the [Headlines Toolkit](https://github.com/headlines-toolkit) ecosystem. It provides a powerful, intuitive platform for managing news content, application configurations, and user-related settings, complementing the [mobile app](https://github.com/headlines-toolkit/ht-main) and the [backend service](https://github.com/headlines-toolkit/ht-api).
6+
<p>
7+
<img src="https://img.shields.io/badge/coverage-XX-green?style=for-the-badge" alt="coverage: percentage">
8+
<a href="https://flutter-news-app-full-source-code.github.io/flutter-news-app-web-dashboard-full-source-code/"><img src="https://img.shields.io/badge/Demo-Live-orange?style=for-the-badge" alt="Demo: Live"></a>
9+
<a href="https://github.com/sponsors/flutter-news-app-full-source-code"><img src="https://img.shields.io/badge/DOCS-READ-purple?style=for-the-badge" alt="DOCS READ"></a>
10+
<a href="https://github.com/sponsors/flutter-news-app-full-source-code"><img src="https://img.shields.io/badge/LICENSE-BUY-pink?style=for-the-badge" alt="License: Buy"></a>
11+
</p>
12+
</div>
913

10-
## ⭐ Features & Capabilities
14+
This is a complete and fully-functional Flutter web application for comprehensive content management and administration. It is a key component of the [**flutter news app full source code toolkit**](https://github.com/flutter-news-app-full-source-code), an ecosystem that also includes a dart frog [backend API](https://github.com/flutter-news-app-full-source-code/flutter-news-app-api-server-full-source-code) and a [mobile client](https://github.com/flutter-news-app-full-source-code/flutter-news-app-mobile-client-full-source-code).
1115

12-
`ht_dashboard` offers a robust set of tools for efficient administration:
16+
## ⭐ Everything You Get, Ready to Go
17+
18+
This dashboard comes packed with all the features you need to manage a professional news application.
1319

1420
#### 📰 **Comprehensive Content Management**
15-
Effortlessly manage all aspects of your news content, including:
16-
* **Headlines:** Create, edit, and delete news articles.
17-
* **Categories:** Organize and define news categories.
21+
Effortlessly manage all aspects of your news content with full CRUD (Create, Read, Update, Delete) capabilities:
22+
* **Headlines:** Create, edit, and publish news articles.
23+
* **Topics:** Organize and define news topics.
1824
* **Sources:** Maintain and update news sources.
19-
***Benefit for you:** Centralized control over your content, ensuring accuracy and consistency across your news platform. ✍️
25+
> **Your Advantage:** You get a powerful, centralized system to control your content, ensuring accuracy and consistency across your news platform. ✍️
2026
2127
#### ⚙️ **Dynamic Application Configuration**
22-
Control the behavior and appearance of the `ht_main`mobile application remotely:
23-
* **User Preference Limits:** Set limits for followed items and saved headlines
24-
based on user roles (Guest, Authenticated, Premium).
25-
* **Ad Settings:** Configure ad frequency and placement intervals for
26-
different user tiers.
27-
***In-App Prompts:** Manage the display frequency of account-related
28-
calls-to-action.
29-
***Operational Status (Kill Switch):** Remotely enable maintenance mode or
30-
disable the app.
31-
* **Force Update:** Mandate or suggest app updates to users.
32-
***Benefit for you:** Granular control over app features and monetization
33-
strategies without requiring app store updates. 🚀
34-
35-
#### 📊 **Intuitive User Interface**
36-
Built with Flutter, the dashboard provides a responsive and user-friendly
37-
experience across various web browsers and screen sizes.
38-
***User-Friendly Error Handling:** Displays clear, localized error messages for a smooth and understandable user experience when issues arise.
39-
***Benefit for you:** A modern, maintainable, and visually appealing
40-
interface for your administrative tasks. ✨
28+
Control the behavior and appearance of the mobile application remotely:
29+
* **User Preference Limits:** Set limits for followed items and saved headlines based on user roles (Guest, Authenticated, Premium).
30+
* **Ad Settings:** Configure ad frequency and placement intervals for different user tiers.
31+
* **In-App Prompts:** Manage the display frequency of account-related calls-to-action.
32+
* **Operational Status:** Remotely enable maintenance mode or suggest app updates to users.
33+
> **Your Advantage:** Granular control over app features and monetization strategies without requiring app store updates. 🚀
34+
35+
#### 📊 **Dashboard Analytics**
36+
Get a quick overview of your content ecosystem with key statistics:
37+
* **Content Counts:** View the total number of headlines, topics, and sources at a glance.
38+
> **Your Advantage:** Instantly understand the scale of your content operation. 📈
39+
40+
#### 🔐 **Robust User Authentication**
41+
Secure and flexible authentication flows are built-in for administrators and publishers using Email + Code (Passwordless) Sign-In.
42+
> **Your Advantage:** All the complex security and user management for your administrative team is already done for you. ✅
43+
44+
#### 🖥️ **Responsive Web UI**
45+
Built with `flutter_adaptive_scaffold`, the dashboard offers a clean, responsive interface that looks great on any screen size.
46+
> **Your Advantage:** Deliver a consistent and optimized administrative experience on desktops, tablets, and even mobile browsers. ↔️
4147
4248
#### 🏗️ **Clean & Modern Architecture**
4349
Developed with best practices for a maintainable and scalable codebase:
4450
* **Flutter & Dart:** Cutting-edge web development.
4551
* **BLoC Pattern:** Predictable and robust state management.
4652
* **GoRouter:** Well-structured and powerful navigation.
47-
* **Adaptive UI:** Responsive layouts using `flutter_adaptive_scaffold` for
48-
optimal experience on different screen sizes.
49-
* **Benefit for you:** An easy-to-understand, extendable, and testable
50-
foundation for your project. 📈
53+
> **Your Advantage:** The dashboard is built on a clean, modern architecture that's easy to understand and maintain. It's solid and built to last. 📈
54+
55+
#### ⚙️ **Flexible Environment Configuration**
56+
Easily switch between development (in-memory data or local API) and production environments with a simple code change. This empowers rapid prototyping, robust testing, and seamless deployment.
57+
> **Your Advantage:** A flexible setup that speeds up your development cycle and makes deployment simple. 🚀
5158
5259
#### 🌍 **Localization Ready**
53-
Fully internationalized with working English and Arabic localizations (`.arb` files).
54-
***Benefit for you:** Easily adapt your dashboard for a global team. 🌐
60+
Fully internationalized with working English and Arabic localizations (`.arb` files). Adding more languages is straightforward.
61+
> **Your Advantage:** Easily adapt your dashboard for a global team. 🌐
5562
5663
---
5764

58-
## 🔑 Access and Licensing
65+
## 🔑 License: Source-Available with a Free Trial
5966

60-
`ht_dashboard` is source-available as part of the Headlines Toolkit ecosystem.
67+
Get started for free and purchase when you're ready to launch!
6168

62-
To acquire a commercial license for building unlimited news applications, please visit
63-
the [Headlines Toolkit GitHub organization page](https://github.com/headlines-toolkit)
64-
for more details.
69+
***TRY IT:** Download and explore the full source code under the polyForm free trial [license](LICENSE). Perfect for evaluation.
70+
***BUY IT:** Get an unlimited commercial lifetime license with a **one-time payment**. No subscriptions!
71+
***GET YOURS:**[**Purchase via GitHub Sponsors**](https://github.com/sponsors/flutter-news-app-full-source-code).
6572

73+
> *<p style="color:grey">Note: The single purchase provides a comprehensive commercial license covering every repository within the [Flutter News App - Full Source Code Toolkit](https://github.com/flutter-news-app-full-source-code) organization. No separate purchases are needed for the API or mobile client.</p>*
6674
---
6775

68-
## 🚀 Getting Started
76+
## 🚀 Getting Started & Running Locally
6977

7078
1. **Ensure Flutter is installed.** (See [Flutter documentation](https://flutter.dev/docs/get-started/install))
7179
2. **Clone the repository:**
7280
```bash
73-
git clone https://github.com/headlines-toolkit/ht-dashboard.git
74-
cd ht-dashboard
81+
git clone https://github.com/flutter-news-app-full-source-code/flutter-news-app-web-dashboard-full-source-code.git
82+
cd flutter-news-app-web-dashboard-full-source-code
7583
```
7684
3. **Get dependencies:**
7785
```bash
7886
flutter pub get
7987
```
80-
4. **Run the app for web:**
88+
4. **Run the app:**
89+
90+
To run the app, first select your desired environment in `lib/main.dart`:
91+
92+
```dart
93+
// lib/main.dart
94+
95+
// Use `AppEnvironment.demo` to run with in-memory data (no API needed).
96+
// Use `AppEnvironment.development` to connect to a local backend API.
97+
// Use `AppEnvironment.production` to connect to a live backend API.
98+
const appEnvironment = AppEnvironment.demo;
99+
```
100+
101+
Then, run the app from your terminal:
81102
```bash
82103
flutter run -d chrome
83-
# Or to run on a web server (e.g., for CORS testing with ht_api)
84-
# flutter run -d web-server --web-hostname 0.0.0.0 --web-port 3000
85104
```
86-
*(Note: For full functionality, ensure the `ht_api` backend service is running and accessible. If running `ht_api` locally, ensure its `CORS_ALLOWED_ORIGIN` environment variable is configured to allow requests from the dashboard's origin, e.g., `http://localhost:3000` if using the web-server option.)*
105+
*(Note: For `development/production` environment, ensure the [backend service](https://github.com/flutter-news-app-full-source-code/flutter-news-app-api-server-full-source-code) is running.)*
87106

88107
---
89108

@@ -94,5 +113,3 @@ This project aims for high test coverage to ensure quality and reliability.
94113
* Run tests with:
95114
```bash
96115
flutter test
97-
```
98-
*(Note: Ensure `very_good_cli` is activated: `dart pub global activate very_good_cli`)*

‎lib/app/bloc/app_bloc.dart‎

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,30 @@
22

33
import 'dart:async';
44

5+
import 'package:auth_repository/auth_repository.dart';
56
import 'package:bloc/bloc.dart';
7+
import 'package:core/core.dart';
8+
import 'package:data_repository/data_repository.dart';
69
import 'package:equatable/equatable.dart';
7-
import 'package:ht_auth_repository/ht_auth_repository.dart';
8-
import 'package:ht_dashboard/app/config/config.dart' as local_config;
9-
import 'package:ht_data_repository/ht_data_repository.dart';
10-
import 'package:ht_shared/ht_shared.dart';
10+
import 'package:flutter_news_app_web_dashboard_full_source_code/app/config/config.dart'
11+
as local_config;
1112
import 'package:logging/logging.dart';
1213

1314
part 'app_event.dart';
1415
part 'app_state.dart';
1516

1617
class AppBloc extends Bloc<AppEvent, AppState> {
1718
AppBloc({
18-
required HtAuthRepository authenticationRepository,
19-
required HtDataRepository<UserAppSettings> userAppSettingsRepository,
20-
required HtDataRepository<RemoteConfig> appConfigRepository,
19+
required AuthRepository authenticationRepository,
20+
required DataRepository<UserAppSettings> userAppSettingsRepository,
21+
required DataRepository<RemoteConfig> appConfigRepository,
2122
required local_config.AppEnvironment environment,
2223
Logger? logger,
2324
}) : _authenticationRepository = authenticationRepository,
2425
_userAppSettingsRepository = userAppSettingsRepository,
2526
_appConfigRepository = appConfigRepository,
2627
_logger = logger ?? Logger('AppBloc'),
27-
super(
28-
AppState(environment: environment),
29-
) {
28+
super(AppState(environment: environment)) {
3029
on<AppUserChanged>(_onAppUserChanged);
3130
on<AppLogoutRequested>(_onLogoutRequested);
3231
on<AppUserAppSettingsChanged>(_onAppUserAppSettingsChanged);
@@ -36,9 +35,9 @@ class AppBloc extends Bloc<AppEvent, AppState> {
3635
);
3736
}
3837

39-
final HtAuthRepository _authenticationRepository;
40-
final HtDataRepository<UserAppSettings> _userAppSettingsRepository;
41-
final HtDataRepository<RemoteConfig> _appConfigRepository;
38+
final AuthRepository _authenticationRepository;
39+
final DataRepository<UserAppSettings> _userAppSettingsRepository;
40+
final DataRepository<RemoteConfig> _appConfigRepository;
4241
final Logger _logger;
4342
late final StreamSubscription<User?> _userSubscription;
4443

@@ -97,7 +96,7 @@ class AppBloc extends Bloc<AppEvent, AppState> {
9796
);
9897
await _userAppSettingsRepository.create(item: defaultSettings);
9998
emit(state.copyWith(userAppSettings: defaultSettings));
100-
} on HtHttpException catch (e, s) {
99+
} on HttpException catch (e, s) {
101100
// Handle HTTP exceptions during settings load
102101
_logger.severe(
103102
'Error loading user app settings for user ${user.id}: ${e.message}',

‎lib/app/config/app_config.dart‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
import 'package:ht_dashboard/app/config/app_environment.dart';
1+
import 'package:flutter_news_app_web_dashboard_full_source_code/app/config/app_environment.dart';
22

33
class AppConfig {
4-
const AppConfig({
5-
required this.environment,
6-
required this.baseUrl,
7-
});
4+
const AppConfig({required this.environment, required this.baseUrl});
85

96
factory AppConfig.production() => const AppConfig(
107
environment: AppEnvironment.production,
118
baseUrl: 'http://api.yourproductiondomain.com',
129
);
1310

14-
factory AppConfig.demo() => const AppConfig(
15-
environment: AppEnvironment.demo,
16-
baseUrl: '',
17-
);
11+
factory AppConfig.demo() =>
12+
const AppConfig(environment: AppEnvironment.demo, baseUrl: '');
1813

1914
factory AppConfig.development() => const AppConfig(
2015
environment: AppEnvironment.development,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /