All Projects → fluttercommunity → breakpoint

fluttercommunity / breakpoint

Licence: MIT license
Breakpoint - A Flutter plugin to calculate the material design breakpoints. Maintainer: @rodydavis

Programming Languages

dart
5743 projects
HTML
75241 projects
swift
15916 projects
kotlin
9241 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to breakpoint

Sscss
Light Sass lib for managing your font-size, margin, padding, and position values across breakpoints.
Stars: ✭ 119 (+12.26%)
Mutual labels:  breakpoint
Styled Components Breakpoint
Utility function for using breakpoints with styled-components 💅.
Stars: ✭ 231 (+117.92%)
Mutual labels:  breakpoint
breaking-point
BREAKING-POINT lets you quickly define and subscribe to screen (i.e. window) breakpoints in your re-frame application
Stars: ✭ 36 (-66.04%)
Mutual labels:  breakpoint
Mq Scss
Extremely powerful Sass media query mixin. Allows you to create almost any media query you can imagine.
Stars: ✭ 122 (+15.09%)
Mutual labels:  breakpoint
Gridtab
GridTab is a lightweight jQuery plugin to create grid based responsive tabs https://gopalraju.github.io/gridtab
Stars: ✭ 210 (+98.11%)
Mutual labels:  breakpoint
styled-media-helper
💅 Helps manage media queries with styled components
Stars: ✭ 76 (-28.3%)
Mutual labels:  breakpoint
Match Media
Universal polyfill for match media API using Expo APIs on mobile
Stars: ✭ 95 (-10.38%)
Mutual labels:  breakpoint
react-matchmedia-connect
Higher order components for matchMedia
Stars: ✭ 49 (-53.77%)
Mutual labels:  breakpoint
Flexi
Just a layout framework. Design for cross-platform with ease.
Stars: ✭ 220 (+107.55%)
Mutual labels:  breakpoint
asm2cfg
Python command-line tool and GDB extension to view and save x86, ARM and objdump assembly files as control-flow graph (CFG) pdf files
Stars: ✭ 42 (-60.38%)
Mutual labels:  breakpoint
Fgdownloader
用于断点下载、任务队列、上传进度、下载进度
Stars: ✭ 143 (+34.91%)
Mutual labels:  breakpoint
Include Media
📐 Simple, elegant and maintainable media queries in Sass
Stars: ✭ 2,362 (+2128.3%)
Mutual labels:  breakpoint
react-page-maker
A drag-drop featured lib which will help you to build the layout and generate the markup or JSON out of it
Stars: ✭ 59 (-44.34%)
Mutual labels:  layout-builder
React Flexa
Responsive React Flexbox (CSS Flexible Box Layout Module) grid system based heavily on the standard CSS API.
Stars: ✭ 120 (+13.21%)
Mutual labels:  breakpoint
breakpoints-json
JSON formatted breakpoints
Stars: ✭ 15 (-85.85%)
Mutual labels:  breakpoint
Filedownloader
Multitask、MultiThread(MultiConnection)、Breakpoint-resume、High-concurrency、Simple to use、Single/NotSingle-process
Stars: ✭ 10,408 (+9718.87%)
Mutual labels:  breakpoint
media-blender
Easy and predictable SASS/SCSS media queries
Stars: ✭ 26 (-75.47%)
Mutual labels:  breakpoint
Decore
🔥Customizable layout generator built for developers
Stars: ✭ 41 (-61.32%)
Mutual labels:  layout-builder
atom-bugs
[MOVED] Atom Bugs has been moved to:
Stars: ✭ 34 (-67.92%)
Mutual labels:  breakpoint
redux-usage-report
A Redux Devtools monitor to audit your app's usage of the store
Stars: ✭ 41 (-61.32%)
Mutual labels:  breakpoint

Flutter Community: breakpoint

Buy Me A Coffee Donate github pages GitHub stars breakpoint

breakpoint

View the online demo here!

Overview

Follows Material Design Docs.

breakpoint

Usage

When you are wanting to calculate the breakpoint of a widget that may not take up the full screen. This needs BoxConstraints but can be provided by the layout builder.

final _breakpoint = Breakpoint.fromConstraints(constraints);

When a widget always takes up thye full screen.

final _breakpoint = Breakpoint.fromMediaQuery(context);

Use BreakpointBuilder if you want the layout builder wrapped for you.

return BreakpointBuilder(
    builder: (context, breakpoint) {
    print('Breakpoint: $breakpoint');
    return Container();
  },
);

Example

import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:breakpoint/breakpoint.dart';

/// main is entry point of Flutter application
void main() {
  // Desktop platforms aren't a valid platform.
  _setTargetPlatformForDesktop();

  return runApp(MyApp());
}

/// If the current platform is desktop, override the default platform to
/// a supported platform (iOS for macOS, Android for Linux and Windows).
/// Otherwise, do nothing.
void _setTargetPlatformForDesktop() {
  TargetPlatform targetPlatform;
  if (Platform.isMacOS) {
    targetPlatform = TargetPlatform.iOS;
  } else if (Platform.isLinux || Platform.isWindows) {
    targetPlatform = TargetPlatform.android;
  }
  if (targetPlatform != null) {
    debugDefaultTargetPlatformOverride = targetPlatform;
  }
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return LayoutBuilder(builder: (_, constraints) {
      final _breakpoint = Breakpoint.fromConstraints(constraints);
      return Scaffold(
        appBar: AppBar(
          title: Text('Breakpoint Example: ${_breakpoint.toString()}'),
        ),
        body: Container(
          padding: EdgeInsets.all(_breakpoint.gutters),
          child: GridView.builder(
            gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
              crossAxisCount: _breakpoint.columns,
              crossAxisSpacing: _breakpoint.gutters,
              mainAxisSpacing: _breakpoint.gutters,
            ),
            itemCount: 200,
            itemBuilder: (_, index) {
              return Container(
                child: Card(
                  child: Text(
                    index.toString(),
                  ),
                ),
              );
            },
          ),
        ),
      );
    });
  }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].