Skip to content

Revive project #60

@Laurie-Lin

Description

@Laurie-Lin

Refactor Plan

Background

This project has been unmaintained for a long time. In its current state, the project is barely buildable, and core functionality no longer works properly.

Motivation

Reasons for restarting the project:

  • There is still strong demand for cross-platform local file sharing
  • Similar projects such as LocalSend are still actively maintained and widely used, but many of SuXiang's design philosophies differ from LocalSend
  • The original idea is still valid, but the implementation approach has become outdated

Current Issues

  • The project cannot currently build on the latest Flutter versions
  • Core functionality (file transfer, device discovery, etc.) no longer works correctly
  • Dependencies are outdated
  • The architecture still reflects design decisions from around four years ago
  • The UI/UX is outdated and no longer matches current expectations
  • Lack of documentation and maintainability
  • A website is required

v2.4 TODO

Technically, this refactor is large enough to be considered v3.0, but to avoid a major version jump too early, it will temporarily be labeled as v2.4.

Tasks

  • UI/UX Refactor

    • The current UI/UX design is more than four years old
    • The new direction focuses on simplifying the interface as much as possible
    • There is currently no extra time for detailed UI mockups, so development will proceed directly based on implementation ideas
  • Project Architecture Refactor

    • The goal is not to create a perfect architecture
    • The priority is making the codebase cleaner, more maintainable, and easier to extend in the future
  • Remove Redundant Logic

    • The file sending feature and chat window contain overlapping functionality
    • A unified solution needs to be designed
  • shelf_static Modifications

    • The mime package used by shelf_static does not include the .gz MIME type

    • As a result, Content-Encoding cannot be handled correctly

    • Browsers will display compressed files directly as garbled text instead of processing them properly

    • Fix by passing a custom resolver when creating createStaticHandler

      var resolver = MimeTypeResolver();
      resolver.addExtension('gz', 'application/gzip');
    • SuXiang uses shelf_static to deploy static resources from a specified directory

    • Currently, browsers can directly access and download arbitrary files from the deployed directory

    • Content-Disposition support is required

    • Previously this was implemented by modifying shelf_static directly

  • State Management

    • Continue using GetX
    • Although its examples are poorly designed, it is still usable
    • Currently discovered issues:
      • It affects route transition animations
      • Even Navigator.of(context) cannot fully bypass the issue
  • Remove FileManager Dependency

  • Remove Privacy Policy

    • The open-source version does not require a privacy policy
    • Historical files and Git cache related to it should be removed

Refactor Log

2026.0427

  • Adopted a new screen adaptation solution and modified code to fix build errors
  • Migrated to a new internationalization solution

2026.0428

  • Removed GetX Bindings

    • SuXiang is not a highly modular project
    • Reduce reliance on GetX route management features as much as possible
  • Redesigned the file deployment logic during file transfers

    • Changed from utility-based implementation to a global singleton service
    • Avoid starting a new server for every transfer
  • Designed a new icon using Pixso and GPT

    • The result still feels fairly generic
  • FileManager

    • Optimized file deployment logic
    • Optimized middleware and CORS handling
    • Added custom web pages to support downloading arbitrary files
    • Tips:
      • Previously, this functionality relied on a heavily modified version of shelf_static, When a browser accesses an image, it determines how to handle the file based on the server's Content-Type, If the response type is an image, the browser displays it directly instead of downloading it, This prevented arbitrary file downloads

2026.0429

  • Redesigned the application icon

2026.0430

  • Removed the forked version of shelf

2026.0506

  • Removed the Global god singleton
  • Split functionality into multiple services
  • Refactored project directory structure

2026.0509

Refactor & Optimization

  • Remove custom header widgets
  • Use ColorScheme instead of Theme.of(context).textTheme
  • Improved future dark mode compatibility through ColorScheme
  • Added enums for all supported platforms
  • Replaced drag-and-drop library with super_drag_and_drop
  • Currently only retain Chat and Settings pages
  • Redesigned DrawerItem to support generics and improve reusability

Unified Icons

2026.0511

Do overall optimization of project structure

  • Remove unused utils
  • Optimize file structure
  • Rename extension name

2026.0513

  • Removed handleTokenCheck
  • Changed /chenk_token to /ping
  • Replaced file_selector with file_picker for now, because file_selector causes OOM when selecting large files on Android: [file_selector] Selecting very large files on Android causes OOM crash flutter/flutter#141002. The issue has not been fixed by the Flutter team yet.
  • Renamed the previous ChatServer back to ChatService
  • FileService no longer needs to accept a port parameter; port handling is now managed internally
  • Fixed device connection handling and JoinMessage sending logic
  • Added support for mouse right-click and side-button page navigation
  • Android now temporarily requests full file management permission
  • Split ChatController into smaller components to reduce responsibilities and significantly decrease code size
  • Renamed functions to improve readability

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions