The easiest way to use navigation, context less and useful methods.

Overview

Starlight Utils

The easiest way to use navigation, context less and useful methods.

Features

Name Status
Context Less Navigation Service
Context Less Dialog
Context Less Bottom Sheet
Context Less Snackbar
Context Less DatePicker
Context Less TimePicker
Time Difference In String
Currency Format
Password Validate
Email Validate
White Space Remove
To Validate
MediaQuery
Theme

ScreenShots

                       

Installation

Add starlight_utils as dependency to your pubspec file.

   starlight_utils: 
    git:
      url: https://github.com/YeMyoAung/starlight_utils.git

Setup

No additional integration steps are required for Android and Ios.

Usage

First of all you need to import our package.

import 'package:starlight_utils/starlight_utils.dart';

And then you can use easily.

Note

If you want to use context less navigation service you need to set navigation key. If you want to use context less dialog,bottomsheet,... you need to inovke StarlightUtils

Context Less Navigation

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
  
    StarlightUtils.push(MyHome());///`Navigation.pushNamed()` shortcut.
  
    StarlightUtils.pushNamed('home');///`Navigation.pushNamed()` shortcut.
  	
    StarlightUtils.pushNamedAndRemoveUntil('home');///`Navigation.pushNamedAndRemoveUntil()` shortcut.
    
    StarlightUtils.pushAndRemoveUntil(MyHome());///`Navigation.pushAndRemoveUntil()` shortcut.
    
    StarlightUtils.pushReplacement(MyHome());///`Navigation.pushReplacement()` shortcut.
    
    StarlightUtils.pushReplacement('home');///`Navigation.popAndPushNamed()` shortcut.
    
    StarlightUtils.popAndPushNamed('home');///`Navigation.pop()` shortcut.
    
    StarlightUtils.conPop();///`Navigation.pop()` shortcut.
  
    return MaterialApp(
        navigatorKey: StarlightUtils.navigatorKey,///important
    );
  }
}

About Dialog

class MyApp xtends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    StarlightUtils.of(context);///important
    return SizedBox(
      width: context.width - 20,
      height: 45,
      child: ElevatedButton(
        onPressed: StarlightUtils.aboutDialog,
        child: const Text(
          "aboutDialog",
        ),
      ),
    );
  }
}

Dialog

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    StarlightUtils.of(context);///important
    return SizedBox(
      width: context.width - 20,
      height: 45,
      child: ElevatedButton(
        onPressed: () {
          StarlightUtils.dialog(AlertDialog(
            title: Text("hello"),
          ));
        },
        child: const Text(
          "dialog",
        ),
      ),
    );
  }
}

Bottomsheet

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    StarlightUtils.of(context);///important
    return SizedBox(
      width: context.width - 20,
      height: 45,
      child: ElevatedButton(
        onPressed: () {
          StarlightUtils.bottomSheet(Container(
            width: context.width,
            height: 100,
            child: Text("bottom sheet"),
          ));
        },
        child: const Text(
          "bottomSheet",
        ),
      ),
    );
  }
}

Snackbar

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    StarlightUtils.of(context);///important
    return SizedBox(
      width: context.width - 20,
      height: 45,
      child: ElevatedButton(
        onPressed: () {
          StarlightUtils.snackbar(SnackBar(content: Text('hello')));
        },
        child: const Text(
          "snackbar",
        ),
      ),
    );
  }
}

Date Picker

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    StarlightUtils.of(context);///important
    return SizedBox(
      width: context.width - 20,
      height: 45,
      child: ElevatedButton(
        onPressed: () {
          StarlightUtils.datePicker(
            initialDate: DateTime.now(),
            firstDate: DateTime(2000),
            lastDate: DateTime(2100),
          );
        },
        child: const Text(
          "datePicker",
        ),
      ),
    );
  }
}

TimePicker

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    StarlightUtils.of(context);///important
    return SizedBox(
      width: context.width - 20,
      height: 45,
      child: ElevatedButton(
        onPressed: () {
          StarlightUtils.timePicker(
            initialTime: TimeOfDay.fromDateTime(
              DateTime.now(),
            ),
          );
        },
        child: const Text(
          "timePicker",
        ),
      ),
    );
  }
}

dateRangePicker

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    StarlightUtils.of(context);///important
    return SizedBox(
      width: context.width - 20,
      height: 45,
      child: ElevatedButton(
        onPressed: () {
          StarlightUtils.dateRangePicker(
      		firstDate: DateTime(2000),
      		lastDate: DateTime(2100),
  	 );
        },
        child: const Text(
          "dateRangePicker",
        ),
      ),
    );
  }
}

Menu

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    StarlightUtils.of(context);///important
    return Scaffold(
          appBar: AppBar(
            actions: [
              IconButton(
                onPressed: () {
                  StarlightUtils.menu(
                    position: RelativeRect.fromLTRB(10, 0, 0, 0),
                        items: [
                            PopupMenuItem(child: Text('item 1')),
                            PopupMenuItem(child: Text('item 2')),
                            PopupMenuItem(child: Text('item 3')),
                        ],
                    );
                },
                icon: Icon(Icons.more_vert),
              )
            ],
          ),
         
        );
  }
}

Useful

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    print(DateTime.now().differenceTimeInString(DateTime(2021, 12, 12)));///4w
    print(12850.6);///12,850.6
    print("password".isStrongPassword);///false
    print("a@".isEmail);///false
    print("a b c".withoutWhiteSpace);///abc
    print("Hello World".toValidate);
    
    return Container();
  }
}

MediaQuery

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    context.with;///device width
    context.height;///device height
    context.devicePixelRatio;///device pixel ratio
    context.textScaleFactor;///text scale factor
    context.topSafe;///Appbar height
    context.bottomSafe;///bottom navigationbar height
    context.orientation;///Device orientation
    context.invertColors;///is inverting Colors or not
    context.highContrast;///is highContrast or not
    context.gestureSettings;///gesture settings
    context.boldText;///is bold text or not
    context.alwaysUse24HourFormat;///is using 24 hour format or not
    context.accessibleNavigation;///is accessible navigation or not
    return Container();
  }
}

Theme

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    context.theme;///ThemeData
    return Container();
  }
}

Contact Us

Starlight Studio

You might also like...

This package allows you to scroll/select the value directly from the dropdown with less effort and time.

Direct Select This package allows you to scroll/select the value directly from the dropdown with less effort and time. Inspired by Virgil Pana shot Sa

Nov 25, 2022

Learn how to use Dart List Utility Methods in Flutter

Learn how to use Dart List Utility Methods in Flutter

Flutter Tutorial - List Utility Methods Learn how to use Dart List Utility Metho

Dec 29, 2021

Dart and Flutter sealed class generator and annotations, with match methods and other utilities. There is also super_enum compatible API.

Dart Sealed Class Generator Generate sealed class hierarchy for Dart and Flutter. Features Generate sealed class with abstract super type and data sub

Jan 2, 2023

Ruqe brings the convenient types and methods found in Rust into Dart, such as the Result, Option, pattern-matching, etc.

ruqe Ruqe brings the convenient types and methods found in Rust into Dart, such as the Result, Option, pattern-matching, etc. Additionally, the librar

Dec 28, 2022

A TabBarController that is easy to use for flutter developers. 🥰 It supports various styles of page navigation, and you can also use it to customize your favorite styles. 🍻🍻

A TabBarController that is easy to use for flutter developers. 🥰 It supports various styles of page navigation, and you can also use it to customize your favorite styles. 🍻🍻

easy_tab_controller A user-friendly TabBarController widget for flutter developer. Getting Started This project is a starting point for a Flutter plug

May 26, 2022

JSON formatted API Get, Patch, Put, Post, Delete methods implemented as a dummy.

json_api_handle A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Nov 13, 2022

A dart package for many helper methods fitting common situations

Basic Utils A dart package for many helper methods fitting different situations. Table of Contents Basic Utils Table of Contents Preamble Install pubs

Jan 5, 2023

The Integration Test Helper has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage.

The Integration Test Helper has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage.

The Integration Test Helper has pre-configured methods that allow for faster test deployment for end to end (e2e) test coverage (using Android and iOS

Apr 7, 2022

Hive Wait provide a Hive repository to calling methods in the box as async.

Hive Wait provide a Hive repository to calling methods in the box as async.

May 10, 2022
Owner
Ye Myo Aung
Programming is my passion.
Ye Myo Aung
The easiest way to create your animated splash screen in a fully customizable way.

Animated Splash Screen Check it out at Pub.Dev Do it your way Assets image Custom Widget Url image IconData Or just change PageTransition and/or Splas

Clean Code 104 Nov 10, 2022
Flutter-context-menus - A flutter package to show context menus on right-click or long-press

context_menus A package to show context menus on right-click or long-press. ?? I

null 0 Jan 18, 2022
Superpowers for Dart. Collection of useful static extension methods.

If you miss an extension, please open an issue or pull request Resources: Documentation Pub Package GitHub Repository On this page you can find some o

Simon Leier 955 Jan 8, 2023
Use the easiest way to create a dotted line view 👀!

fdottedline Use the easiest way to create a dotted line view ?? ! [FDottedLine] provides developers with the ability to create dashed lines. It also s

Fliggy Mobile 122 Jul 17, 2022
Flutter ui boilerplate is easiest way to create new flutter project with clean code and well organized file folder.

Flutter UI Boilerplate "Sharing for fun" Flutter ui boilerplate is easiest way to create new flutter project with clean code and well organized file f

Dimas Ibnu Malik 122 Dec 1, 2022
Easiest way to add support for light and dark theme in your flutter app.

Adaptive Theme Easiest way to add support for light and dark theme in your Flutter app. It allows to manually set light or dark theme and also lets yo

Birju Vachhani 287 Dec 27, 2022
This library provides the optimized and easiest way to authenticate with Mastodon's OAuth 2.0 in your Flutter app 🎯

The Optimized and Easiest Way to Integrate OAuth 2.0 with Mastodon API in Flutter ?? 1. Guide ?? 1.1. Getting Started ⚡ 1.1.1. Install Library 1.1.2.

Mastodon.dart 11 Jul 7, 2023
The easiest way to style custom text snippets in flutter

Super Rich Text Check it out at Pub.Dev The easiest way to style custom text snippets Help Maintenance I've been maintaining quite many repos these da

Woton Sampaio 14 Nov 4, 2022
This library provides the easiest way to integrate Twitter Cards in Flutter web apps 🐦

The Easiest Way to Integrate Twitter Cards into Your Flutter Web App ?? 1. Guide ?? 1.1. Features ?? 1.2. Getting Started ⚡ 1.2.1. Install Library 1.2

Twitter.dart 3 Aug 7, 2022
App HTTP Client is a wrapper around the HTTP library Dio to make network requests and error handling simpler, more predictable, and less verbose.

App HTTP Client App HTTP Client is a wrapper around the HTTP library Dio to make network requests and error handling simpler, more predictable, and le

Joanna May 44 Nov 1, 2022