flutter_screwdriver 1.0.0 copy "flutter_screwdriver: ^1.0.0" to clipboard
flutter_screwdriver: ^1.0.0 copied to clipboard

outdated

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

example/example.md

📝 Examples #

import 'package:flutter_screwdriver/flutter_screwdriver.dart';
'#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][docs]

16
likes
40
points
498
downloads

Publisher

verified publisherbirju.dev

Weekly Downloads

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

Repository (GitHub)
View/report issues
Contributing

License

BSD-3-Clause (license)

Dependencies

animations, flutter

More

Packages that depend on flutter_screwdriver