FLUTTER ECOSYSTEM

nijatumuyev/flexify

這個 Flutter 套件讓您的應用程式輕鬆適應不同的螢幕尺寸。使用簡單,它為開發者提供根據裝置尺寸自動調整介面的能力。使用此套件,您的應用程式在從小型手機到大型平板電腦的各種設備上都能呈現出眾的外觀。

flexify 專案封面
Stars
6
Forks
0
最近推送(UTC)
2024年6月16日
專案狀態
未封存
Nijat Umuyev GitHub avatar
GITHUB User

Nijat Umuyev ↗

語言Dart

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 3 項
  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^4.0.0

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

Flexify

Flexify is a comprehensive Flutter package that simplifies the creation of responsive user interfaces and enhances navigation with customizable animations. It allows you to easily adapt your app's layout to various screen sizes while providing a smooth and visually appealing navigation experience. With Flexify, scaling widgets proportionally and implementing advanced navigation transitions become effortless, making it an indispensable tool for Flutter developers.

Features

  • Responsive Design: Scale your UI elements based on the design dimensions you specify.
  • Customizable Navigation: Navigate between screens with various animation options.
  • Cross-Platform Support: Works seamlessly with both MaterialApp and CupertinoApp.

Installation

Add the following line to your pubspec.yaml file:

dependencies:
  flexify: ^2.1.1

Usage

  • Initialize :
import 'package:flutter/material.dart';
import 'package:flexify/flexify.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    //Wrap your app with Flexify for initialize
    return Flexify(
      designWidth: 375,
      designHeight: 812,
      app: MaterialApp(
        home: ExampleScreen(),
      ),
    );
  }
}
  • Responsive designing :
class FlexifyResponsiveWidget extends StatelessWidget {
  const ExampleScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(
              width: 250.rw, //responsive width
              height: 250.rh, //responsive height
              decoration: BoxDecoration(
                color: Colors.blue,
                borderRadius: BorderRadius.circular(25.rs), // responsive size
              ),
              child: Center(
                child: Text(
                  'This is a Responsive Text',
                  style: TextStyle(
                    fontSize: 22.rt, // responsive font-size
                    fontWeight: FontWeight.w700,
                  ),
                ),
              ),
            ),
            20.verticalSpace, // SizedBox(height:20.rh) responsive vertical space
            20.horizontalSpace, // SizedBox(width: 20.rw) responsive horizontal space
          ],
        ),
      ),
    );
  }
}
  • Easy navigations with animations :
Flexify.go(
  NewScreen(),
  animation: FlexifyRouteAnimations.fade,
  duration: Duration(milliseconds: 500),
);

Flexify.goRemove(
  NewScreen(),
  animation: FlexifyRouteAnimations.slide,
  duration: Duration(milliseconds: 500),
);

Flexify.goRemoveAll(
  NewScreen(),
  animation: FlexifyRouteAnimations.scale,
  duration: Duration(milliseconds: 500),
);

Flexify.back();
  • Available Animations :
FlexifyRouteAnimations.fade
FlexifyRouteAnimations.slide
FlexifyRouteAnimations.scale
FlexifyRouteAnimations.rotate
FlexifyRouteAnimations.zoom
FlexifyRouteAnimations.size
FlexifyRouteAnimations.elastic
FlexifyRouteAnimations.flip
FlexifyRouteAnimations.slideFromBottom,
FlexifyRouteAnimations.customFadeScale,
FlexifyRouteAnimations.blur,
FlexifyRouteAnimations.slideAndFade,
FlexifyRouteAnimations.rotateAndScale,
FlexifyRouteAnimations.flipAndFade,