패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.0.0+4

flexiflow

귀하의 필요에 쉽게 적응할 수 있도록 설계된 반응형이고 유연한 솔루션으로, 원활하고 개발자 친화적인 경험을 제공합니다.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
7
좋아요
7
Pub 점수
150

패키지 설치

flutter pub add flexiflow

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Flexiflow는 여러 플랫폼에서 적응형 레이아웃을 단순화하는 반응형 UI 패키지입니다. 개발자 경험을 중심으로 설계되어 다양한 화면 크기와 방향에 자동으로 조정되는 유연하고 확장 가능한 인터페이스를 만들 수 있는 직관적인 도구를 제공합니다. Flutter 전용으로 제작되었으며 Android, iOS, Web, macOS, Windows, Linux를 지원하여 기기 간 일관된 동작을 보장합니다. 최소한의 설정과 깔끔한 문법을 통해 복잡한 대안 없이 정교하고 반응형 디자인을 빠르게 구현할 수 있습니다.

사용 사례

  • 크로스 플랫폼 반응형 대시보드 구축
  • 적응형 양식 및 레이아웃 만들기
  • 동적 콘텐츠 그리드 설계
  • 다양한 화면 크기에 맞는 유동적인 UI 구현
  • 다기기 앱에서 레이아웃 개발 간소화

주요 기능

  • 자동 반응 행동
  • 크로스 플랫폼 호환성
  • 간단하고 선언적인 API
  • 내장형 레이아웃 적응성
  • 가볍고 빠른 렌더링
  • 개발자 친화적인 구문

적합한 대상

  • 반응형 레이아웃을 찾는 Flutter 개발자
  • 다중 플랫폼 앱을 개발하는 팀
  • 동적 UI 적응이 필요한 프로젝트
  • 프론트엔드 중심의 플러터 팀
  • 다양한 디바이스 화면을 대상으로 하는 앱

고려 사항

  • 초보자에게는 학습 곡선이 필요할 수 있습니다
  • 기본 예제 외에는 문서가 제한적입니다
  • UI 중심 애플리케이션에 가장 적합
  • 높은 사용자 정의 또는 비표준 레이아웃에는 적합하지 않습니다
  • Flutter의 렌더링 파이프라인에 의존합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Flexiflow Package

Pub.dev Badge GitHub Build Badge Effective Dart Badge MIT License Badge Flutter Platform Badge

Web Badge Android Badge iOS Badge MacOS Badge Windows Badge Linux Badge

Available Languages

English Version Versão em Português


Flexiflow is a library that enables the creation of responsive flows in your application, providing adaptable variations for various types of devices and screens.

About

Flexiflow is based on the idea of employing a foundational design as a reference point for creating responsive flows. From this fundamental design, the library enables the generation of adaptable variations for different devices such as mobile phones, tablets, and desktops. Additionally, Flexiflow adjusts the size of widgets according to various screen sizes, maintaining a constant proportion to the original design.

With Flexiflow, you gain the ability to easily develop a responsive flow for your application, eliminating the need for complex calculations and enhancing code readability. The flexibility of the library allows you to create specific variations for each type of device, resulting in a responsive flow that efficiently adapts to a variety of screen sizes. This contributes to a unique user experience, optimally tailored for each device.

Installation

To install Flexiflow, add the following dependency to your pubspec.yaml file:

dependencies:
  flexiflow: ^VERSION

Replace the VERSION tag with the latest version of the package. You can find the most recent version of Flexiflow on the package page on Pub.dev.

After that, run the flutter pub get command to download the project dependencies.

Now, simply import Flexiflow into your project and start enjoying the benefits of simple and fast responsiveness:

import 'package:flexiflow/flexiflow.dart';

Usage

Flexiflow is divided into two distinct parts: "Flexi" and "Flow". The term "Flexi" comes from flexibility, and it is responsible for providing responsiveness to your widgets. Meanwhile, the "Flow" portion, derived from the word flow, takes on the responsibility of creating variations tailored to various types of devices.

Responsiveness

To make your widgets responsive, the first step is to incorporate the Flexiflow widget into your application. The Flexiflow plays a crucial role in establishing the foundational design for your application, serving as a reference point for creating responsive flows. For this initial setup, simply provide the dimensions of the foundational design through the designSize parameter:

void main() {
  runApp(
    FlexiFlow(
      designSize: Size(1920, 1080),
      child: const MyApp(),
    ),
  );
}

After this step, you can make your widgets responsive using the extensions provided by the package. To do this, simply use the variable corresponding to the desired type of responsiveness, assigning a numeric value to it:

final double width = 100.w;
final double height = 100.h;
final double fontSize = 100.sp;

Flexiflow offers seven distinct types of responsiveness, each adjusting in a specific way:

  • w or width: Responsive to the width of the foundational design.
  • h or height: Responsive to the height of the foundational design.
  • sp: Responsive to the font size of the foundational design.
  • dp: Responsive to the device's pixel density.
  • wPerc or widthPercentage: Responsive to the percentage of the foundational design's width.
  • hPerc or heightPercentage: Responsive to the percentage of the foundational design's height.
  • sqr or squared: Responsive to the smaller dimension of the foundational design, often used to create square widgets.

Additionally, Flexiflow provides the flexibility to set minimum and maximum limits for responsiveness through the min and max parameters:

final double width = 100.limW(min: 50, max: 200);
final double height = 100.limH(min: 50, max: 200);
final double fontSize = 100.limSp(min: 50, max: 200);

This is especially useful to prevent responsiveness values from becoming excessively small or large, thus providing a better user experience.

The optional min and max parameters can be applied to the following extensions:

  • limW or limitedWidth: Limits responsiveness in relation to the width of the foundational design.
  • limH or limitedHeight: Establishes limits for responsiveness in relation to the height of the foundational design.
  • limSp or limitedSp: Sets limits for responsiveness in relation to the font size of the foundational design.
  • limDp or limitedDp: Controls responsiveness in relation to the device's pixel density.
  • limWPerc or limitedWidthPercentage: Imposes limits on responsiveness in relation to the percentage of the foundational design's width.
  • limHPerc or limitedHeightPercentage: Regulates responsiveness in relation to the percentage of the foundational design's height.
  • limSqr or limitedSquared: Applies limits to responsiveness in relation to the smaller dimension of the foundational design, often used to maintain widgets in a square format.
Flow

To create variations tailored to different types of devices, the FlowScreen widget is the ideal tool. This widget takes on the responsibility of generating specific variants for mobile phones, tablets, and desktops, providing an optimized experience on each platform.

FlowScreen(
    mobileChild: const MobileScreen(),
    tabletChild: const TabletScreen(),
    desktopChild: const DesktopScreen(),
),

If you want to create custom variations beyond those offered by FlowScreen, the IFlow interface provides the necessary flexibility. To implement your own flow, simply create a class that extends the IFlow interface and override the getCurrentFlow and getCurrentType methods.

class CustomFlow extends IFlow<DevicesTypes> {

  CustomFlow({
    required BuildContext context,
    required Widget mobileChild,
    required Widget tabletChild,
    required Widget desktopChild,
  })
      : _context = context,
        _mobileChild = mobileChild,
        _tabletChild = tabletChild,
        _desktopChild = desktopChild;

  final BuildContext _context;
  final Widget _mobileChild;
  final Widget _tabletChild;
  final Widget _desktopChild;

  @override
  Widget getCurrentFlow(DevicesTypes type) {
    return switch (type) {
      DevicesTypes.mobile => _mobileChild,
      DevicesTypes.tablet => _tabletChild,
      DevicesTypes.desktop => _desktopChild
    };
  }

  @override
  DevicesTypes getCurrentType() {
    final size = MediaQuery.sizeOf(_context);
    if (size.width < 600) {
      return DevicesTypes.mobile;
    } else if (size.width < 1024) {
      return DevicesTypes.tablet;
    } else {
      return DevicesTypes.desktop;
    }
  }

After creating your custom class that extends the IFlow interface, it's easy to integrate it into the FlowBuilder. Simply pass an instance of this class as an argument to the flow parameter of the FlowBuilder:

FlowBuilder(
    flow: CustomFlow(
        context: context,
        mobileChild: const MobileScreen(),
        tabletChild: const TabletScreen(),
        desktopChild: const DesktopScreen(),
    ),
),

Remember that customizing your flow can be done in a very flexible manner, allowing even the user to make their own customizations.

Examples

To view practical examples of Flexiflow usage, visit our Flow Lab.

Contributing

Contributions are always welcome! If you'd like to contribute to Flexiflow, feel free to visit our GitHub repository.

Bugs and Suggestions

You can report bugs and suggest new features in our issues.

License

Flexiflow is licensed under the MIT License. See the LICENSE file for more details.

Acknowledgements

We thank Arthur Goelzer for the artistic contributions used in the project's README.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.