Giter VIP home page Giter VIP logo

flutter_screwdriver's Introduction

Banner

Flutter Screwdriver

A flutter package aiming to provide useful extensions and helper functions to ease and speed up development.

Tests Code Quality

  • ๐Ÿ“‹ Well Documented
  • ๐Ÿงช Well Tested
  • ๐Ÿ‘Œ Follows Code Quality Guidelines
  • ๐Ÿฆพ Production Ready
  • ๐Ÿ›น Easy to Use
  • ๐Ÿ›ก Sound Null Safety ๏ธ

To checkout all the available extensions, helper functions & classes, see documentation.

Stats

Extensions:                    44
Helper Classes:                13
Helper Functions & Getters:    2
Typedefs:                      4
Mixins:                        3

Last Updated: Tue, Mar 12, 2024 - 11:10 AM

*Stats auto generated using Github Workflow.

Installation

  1. Add as a dependency in your project's pub spec.yaml
dependencies:
  flutter_screwdriver: <latest_version>
  1. Import library into your code.
import 'package:flutter_screwdriver/flutter_screwdriver.dart';

A Glimpse of Flutter Screwdriver

'#FF4433'.toColor(); // returns Color object
context.theme; // short for Theme.of(context)
myConfirmationView.showAsDialog(context);
homeRoute.push(context); // short for Navigation.of(context).push(homeRoute);
closeApp(); // closes the app

Colors.red.hexString; // converts to hex string
Color(0xFF4433).toMaterialColor(); // converts given color to material color with standard shades
Color(0xFF4433).shade(300); // creates white based shades of given color
Colors.red.tweenTo(Colors.blue); // creates ColorTween

State and Context Extensions

Access common inherited widgets directly from state.

theme; // Short for Theme.of(context)
mediaQuery; // Short for MediaQuery.of(context)
focusScope; // Short for FocusScope.of(context)
navigator; // Short for Navigator.of(context)
hideKeyboard(); // hides soft input keyboard

context.theme;
context.mediaQuery;
context.focusScope;
context.navigator;
context.hideKeyboard();

TextEditingController

emailController.trimmed;
emailController.isBlank;
emailController.onChanged((value) => print(value));
emailController.onSelectionChanged((selection) => print(selection));
emailController.textChanges(); // Returns a Stream<String>
emailController.selectionChanges(); // Returns a Stream<TextSelection>

Routes

FadeScalePageRoute();
FadeThroughPageRoute();
SharedAxisPageRoute();
Hiding keyboard when clicked outside tap-able views
import 'package:flutter_screwdriver/flutter_screwdriver.dart';


HideKeyboard(
  MaterialApp(
    theme: ThemeData.light(),
    debugShowCheckedModeBanner: false,
    home: Scaffold(
      body: MyWidget(),
    ),
  ),
);
Clearing focus when navigation happens (mainly to close keyboard if visible)
import 'package:flutter_screwdriver/flutter_screwdriver.dart';

MaterialApp(
  theme: ThemeData.light(),
  debugShowCheckedModeBanner: false,
  navigatorObservers: [
    ClearFocusNavigatorObserver(),
  ],
  home: Scaffold(
    body: MyWidget(),
  ),
);

Checkout documentation

Features and bugs

Please file feature requests and bugs at the issue tracker.

Liked Flutter Screwdriver?

Show some love and support by starring the repository.

Or You can

Buy Me A Coffee

License

Copyright (c) 2020, Birju Vachhani
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

flutter_screwdriver's People

Contributors

birjuvachhani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

beobeodev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.