Skip to content

WIndFate/FlutterTest

Repository files navigation

pub.dev Package Browser

中文 | 日本語

A Flutter app for browsing packages on pub.dev — the official package repository for Dart and Flutter.

Features

  • Browse the full pub.dev package catalog
  • Infinite scroll to explore all available packages
  • Pull-to-refresh to see the latest additions
  • View detailed package information including description and publisher
  • Browse complete version history for any package
  • Open package homepage or repository in your browser
  • Dark mode with system / light / dark theme switching
  • Loading indicators for a smooth experience
  • Error handling with one-tap retry

Architecture

The app follows a layered architecture built on Material Design 3:

Models → Services → Providers → Pages
Layer Responsibility Technology
Models Immutable data classes with JSON serialization Freezed + json_serializable
Services HTTP communication with the pub.dev API http
Providers Reactive state management and caching Riverpod
Pages UI screens composed of reusable widgets Flutter + Material 3
Router Declarative navigation GoRouter

Project Structure

lib/
├── main.dart                 # Entry point
├── app.dart                  # MaterialApp with router & theme
├── models/                   # Freezed data models
│   ├── package.dart
│   ├── package_details.dart
│   ├── package_publisher.dart
│   ├── package_pubspec.dart
│   ├── package_version.dart
│   └── packages_response.dart
├── services/                 # API layer
│   ├── pub_dev_api.dart
│   ├── api_config.dart
│   ├── api_config_native.dart
│   └── api_config_web.dart
├── providers/                # Riverpod providers
│   ├── packages_provider.dart
│   ├── package_detail_provider.dart
│   └── theme_provider.dart
├── router/                   # GoRouter configuration
│   └── app_router.dart
└── pages/                    # UI screens & widgets
    ├── home/
    │   ├── home_page.dart
    │   └── widgets/
    │       └── package_list_tile.dart
    └── details/
        ├── details_page.dart
        └── widgets/
            ├── overview_section.dart
            └── versions_section.dart

Supported Platforms

  • iOS
  • Android
  • macOS
  • Web
  • Linux
  • Windows

Getting Started

git clone <repository-url>
cd FlutterTest
flutter run

Testing

The project includes three types of tests:

  • Unit Tests — model serialization, API mock responses
  • Widget Tests — page interactions, state management
  • Golden Tests — visual regression for key components
flutter test                                    # Run all tests
flutter test --update-goldens test/goldens/     # Update golden baselines

About

A flutter simple demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors