-
Notifications
You must be signed in to change notification settings - Fork 0
Build/update deps #2
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a8b7797
chore(.gitignore): update ignored files and remove outdated comments
fulleni c482588
build(.flutter-plugins-dependencies): update path_provider_android ve…
fulleni c932f7a
chore: remove .packages from .gitignore
fulleni 9dba4e0
chore(pub): add pubspec.lock file and update dependencies
fulleni a201c16
chore: remove coverage/lcov.info
fulleni c7c53c3
docs(README): redesign and update documentation for clarity and impact
fulleni a7a9b2c
chore: remove .flutter-plugins-dependencies file
fulleni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,5 @@ | ||
| # See https://www.dartlang.org/guides/libraries/private-files | ||
|
|
||
| # Files and directories created by pub | ||
| .dart_tool/ | ||
| .packages | ||
| build/ | ||
| pubspec.lock | ||
| coverage/ | ||
| .flutter-plugins | ||
| .flutter-plugins-dependencies | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,99 +1,44 @@ | ||
| # ui_kit | ||
| <div align="center"> | ||
| <img src="https://avatars.githubusercontent.com/u/202675624?s=400&u=dc72a2b53e8158956a3b672f8e52e39394b6b610&v=4" alt="Flutter News App Toolkit Logo" width="220"> | ||
| <h1>UI Kit</h1> | ||
| <p><strong>A shared Flutter UI kit providing a consistent set of widgets, themes, constants, and utilities for the Flutter News App Toolkit.</strong></p> | ||
| </div> | ||
|
|
||
|  | ||
| [](https://pub.dev/packages/very_good_analysis) | ||
| [](https://polyformproject.org/licenses/free-trial/1.0.0) | ||
| <p align="center"> | ||
| <img src="https://img.shields.io/badge/coverage-24%25-green?style=for-the-badge" alt="coverage"> | ||
fulleni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <a href="https://flutter-news-app-full-source-code.github.io/docs/"><img src="https://img.shields.io/badge/LIVE_DOCS-VIEW-slategray?style=for-the-badge" alt="Live Docs: View"></a> | ||
| <a href="https://github.com/flutter-news-app-full-source-code"><img src="https://img.shields.io/badge/MAIN_PROJECT-BROWSE-purple?style=for-the-badge" alt="Main Project: Browse"></a> | ||
| </p> | ||
|
|
||
| A shared Flutter UI kit package providing a consistent set of widgets, themes, constants, and utilities for building applications. This package ensures a cohesive look and feel across different parts of the system. | ||
| This `ui_kit` package serves as a shared Flutter UI kit within the [**Flutter News App Full Source Code Toolkit**](https://github.com/flutter-news-app-full-source-code). It provides a consistent set of widgets, themes, constants, and utilities designed to ensure a cohesive look and feel across the Flutter mobile app and web dashboard. By centralizing UI components and styling, this package aims to accelerate development and enhance maintainability. | ||
|
|
||
fulleni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## Getting Started | ||
| ## ⭐ Feature Showcase: Consistent & Dynamic User Interfaces | ||
|
|
||
| Add this package to your `pubspec.yaml`: | ||
| This package offers a comprehensive set of features for building modern Flutter UIs. | ||
|
|
||
| ```yaml | ||
| dependencies: | ||
| ui_kit: | ||
| git: | ||
| url: https://github.com/flutter-news-app-full-source-code/ui-kit.git | ||
| ``` | ||
| <details> | ||
| <summary><strong>🧱 Core Functionality</strong></summary> | ||
|
|
||
| ## Features | ||
| ### 🚀 State Widgets | ||
| - **`InitialStateWidget`:** A pre-built widget for displaying initial states, typically before user interaction or data loading. | ||
| - **`LoadingStateWidget`:** A widget for indicating progress during data fetching or other asynchronous operations. | ||
| - **`FailureStateWidget`:** A robust widget for showing user-friendly, localized error messages with an optional retry mechanism, leveraging `HttpException` extensions from `core`. | ||
|
|
||
| * **State Widgets:** A collection of pre-built widgets for common UI states: | ||
| * `InitialStateWidget`: For screens before user interaction. | ||
| * `LoadingStateWidget`: For displaying progress during data fetching. | ||
| * `FailureStateWidget`: For showing user-friendly error messages with a retry option. | ||
| * **Dynamic Theming:** Built with `flex_color_scheme`, allowing for dynamic, customizable, and consistent light/dark themes across the app based on user settings. | ||
| * **Localization Helpers:** | ||
| * An extension on `HttpException` to provide user-friendly, localized error messages. | ||
| * Custom `timeago` messages for concise relative time formatting. | ||
| * **Shared Constants:** Centralized constants for spacing (`AppSpacing`) to ensure consistent layouts. | ||
| * **Utilities:** Helper classes like `DateFormatter` for common date and time formatting tasks. | ||
| ### 🎨 Dynamic Theming | ||
| - **`lightTheme` & `darkTheme` Functions:** Built with `flex_color_scheme`, these functions provide dynamic, customizable, and consistent light/dark themes across the app based on user settings (e.g., `AppBaseTheme`, `AppAccentTheme`, `AppTextScaleFactor`, `AppFontWeight`). | ||
| - **`AppSpacing` Constants:** Centralized constants for spacing to ensure consistent layouts and visual hierarchy. | ||
|
|
||
| ## Usage | ||
| ### 🌐 Localization Helpers | ||
| - **`HttpException` Extension:** An extension on `HttpException` (from `core`) to provide user-friendly, localized error messages, simplifying error presentation. | ||
| - **`timeago` Integration:** Custom `timeago` messages for concise relative time formatting, enhancing readability of timestamps. | ||
|
|
||
| ### Displaying an Error | ||
| ### 🛠️ Utilities | ||
| - **`DateFormatter`:** Helper class for common date and time formatting tasks, ensuring consistent date representations throughout the application. | ||
|
|
||
| Use the `FailureStateWidget` to easily display a localized error message from a shared exception. The widget automatically handles localization. | ||
|
|
||
| ```dart | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:core/core.dart'; | ||
| import 'package:ui_kit/ui_kit.dart'; | ||
| class MyFeatureView extends StatelessWidget { | ||
| const MyFeatureView({super.key}); | ||
| @override | ||
| Widget build(BuildContext context) { | ||
| return FailureStateWidget( | ||
| exception: NetworkException(), | ||
| onRetry: () { | ||
| // Logic to retry the failed operation | ||
| print('Retrying...'); | ||
| }, | ||
| ); | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Theming | ||
|
|
||
| This package provides `lightTheme` and `darkTheme` functions that can be dynamically configured. To use them, pass them to your `MaterialApp`'s theme properties. | ||
|
|
||
| ```dart | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:ui_kit/ui_kit.dart'; | ||
| import 'package:core/core.dart'; | ||
| import 'package:flex_color_scheme/flex_color_scheme.dart'; | ||
| void main() => runApp(const MyApp()); | ||
| class MyApp extends StatelessWidget { | ||
| const MyApp({super.key}); | ||
| @override | ||
| Widget build(BuildContext context) { | ||
| // These values would typically come from a state management solution | ||
| const activeScheme = FlexScheme.mandyRed; | ||
| const textScaleFactor = AppTextScaleFactor.medium; | ||
| const fontWeight = AppFontWeight.regular; | ||
| return MaterialApp( | ||
| theme: lightTheme( | ||
| scheme: activeScheme, | ||
| appTextScaleFactor: textScaleFactor, | ||
| appFontWeight: fontWeight, | ||
| ), | ||
| // ... other properties | ||
| ); | ||
| } | ||
| } | ||
| ``` | ||
| > **💡 Your Advantage:** This UI kit simplifies Flutter development by providing visual consistency, dynamic theming, and robust error presentation. It centralizes UI components, contributing to faster development and improved maintainability. | ||
| </details> | ||
fulleni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## 🔑 Licensing | ||
|
|
||
| This package is source-available and licensed under the [PolyForm Free Trial 1.0.0](LICENSE). Please review the terms before use. | ||
|
|
||
| For commercial licensing options that grant the right to build and distribute unlimited applications, please visit the main [**Flutter News App - Full Source Code Toolkit**](https://github.com/flutter-news-app-full-source-code) organization. | ||
| This `ui_kit` package is an integral part of the [**Flutter News App Full Source Code Toolkit**](https://github.com/flutter-news-app-full-source-code). For comprehensive details regarding licensing, including trial and commercial options for the entire toolkit, please refer to the main toolkit organization page. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.