GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - smartbackme/KgDensity: KgDensity is flutter screen adaption

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
art
art
 
 
lib
lib
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.metadata
.metadata
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README-jp.md
README-jp.md
 
 
README-zh.md
README-zh.md
 
 
README.md
README.md
 
 
analysis_options.yaml
analysis_options.yaml
 
 
pubspec.yaml
pubspec.yaml
 
 

Repository files navigation

kg_density

Is a minimalist screen adaptation scheme, which can quickly help the developed project to adapt the screen

Getting started

dependencies:
  kg_density: ^0.0.1

The following models are from the iPhone 5S

Before login adaptation

After login adaptation

Before chart page adaptation

After chart page adaptation

Before other pages fit

After other pages are adapted

Usage

  1. Create flutterbinding
class MyFlutterBinding extends WidgetsFlutterBinding with KgFlutterBinding {

  static WidgetsBinding ensureInitialized() {
    if (WidgetsBinding.instance == null) MyFlutterBinding();
    return WidgetsBinding.instance!;
  }
}
  1. MaterialApp configuration
MaterialApp(
              theme: ThemeData(),
              builder: KgDensity.initSize(),

            );
  1. Configuration before startup
    void main() {
      ///初始化
      KgDensity.initKgDensity(375);
      MyFlutterBinding.ensureInitialized();
      ///运行
      runApp(App());
    }

Note:

  1. KgDensity.initSize(builder: ??)

In order to facilitate the configuration of other builders, other builders are specially added to the code

usage method

    builder: KgDensity.initSize(builder: EasyLoading.init()),
  1. KgDensity.initKgDensity(375)

Digital configuration is configured according to the narrowest side of the design manuscript

If you do not use kgdensity for adaptation, do not use init

  1. Get size correctly
    MediaQuery.of(context).size

Please do not use window physicalSize,MediaQueryData. fromWindow(window)

Additional information

This code base is reconstructed with reference to its principle and part of the code. Thank you https://github.com/niezhiyang/flutter_autosize_screen

About

KgDensity is flutter screen adaption

Resources

Readme
MIT license
Activity

Stars

55 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.