Flutter Custom Video Player Builds on top Of The Official Video_player

Custom Video Player

This package wraps the official video_player package by flutter and extends it with a fully customisable control bar, a fullscreen mode and adjustable video settings. For every control in this video player you can decide if you want to show it and if so how it should look.


 

Top Features

  • Fullscreen Mode
  • Native controls and fullscreen for web apps
  • Change Video Quality
  • Thumbnail / Poster
  • Adjust Playback Speed
  • Fully Customizable Controls
  • Fluid Progress Bar
  • Prevent Seeking in Progress Bar
  • Prevent video from being played more than once


 

Preview

Fullscreen


 

Getting started

  • To get started just create a VideoPlayerController as you would for the normal video_player and define a source to use.
  • Secondly create a CustomVideoPlayerController to access the fullscreen and control bar visibility switches by yourself. Pass the controllers to a CustomVideoPlayer widget to use all its functionality and customisation oppurtunities.
  • Secondly create a CustomVideoPlayerController and pass it the created VideoPlayerController as well as your custom settings or additional video sources
  • On the examples tab is a selection of parameters you can customize to your needs. There you can also see how the additional video sources are added in case you want the user to be able to switch between video qualities


 

Usage

class _MyHomePageState extends State<MyHomePage> {
  late VideoPlayerController videoPlayerController;
  late CustomVideoPlayerController _customVideoPlayerController;

  String videoUrl =
      "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";

  @override
  void initState() {
    super.initState();
    videoPlayerController = VideoPlayerController.network(videoUrl)
      ..initialize().then((value) => setState(() {}));
    _customVideoPlayerController = CustomVideoPlayerController(
      context: context,
      videoPlayerController: videoPlayerController,
    );
  }

  @override
  void dispose() {
    _customVideoPlayerController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return CupertinoPageScaffold(
      navigationBar: CupertinoNavigationBar(
        middle: Text(widget.title),
      ),
      child: SafeArea(
        child: CustomVideoPlayer(
          customVideoPlayerController: _customVideoPlayerController
        ),
      ),
    );
  }
}

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add appinio_video_player

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  appinio_video_player: ^1.2.1

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:appinio_video_player/appinio_video_player.dart';

example/lib/main.dart

import 'package:appinio_video_player/appinio_video_player.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return const CupertinoApp(
      debugShowCheckedModeBanner: false,
      theme: CupertinoThemeData(
        brightness: Brightness.light,
      ),
      title: 'Appinio Video Player Demo',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  late VideoPlayerController _videoPlayerController,
      _videoPlayerController2,
      _videoPlayerController3;

  late CustomVideoPlayerController _customVideoPlayerController;
  late CustomVideoPlayerWebController _customVideoPlayerWebController;

  final CustomVideoPlayerSettings _customVideoPlayerSettings =
      const CustomVideoPlayerSettings();

  final CustomVideoPlayerWebSettings _customVideoPlayerWebSettings =
      CustomVideoPlayerWebSettings(
    src: longVideo,
  );

  @override
  void initState() {
    super.initState();

    _videoPlayerController = VideoPlayerController.network(
      longVideo,
    )..initialize().then((value) => setState(() {}));
    _videoPlayerController2 = VideoPlayerController.network(video240);
    _videoPlayerController3 = VideoPlayerController.network(video480);
    _customVideoPlayerController = CustomVideoPlayerController(
      context: context,
      videoPlayerController: _videoPlayerController,
      customVideoPlayerSettings: _customVideoPlayerSettings,
      additionalVideoSources: {
        "240p": _videoPlayerController2,
        "480p": _videoPlayerController3,
        "720p": _videoPlayerController,
      },
    );

    _customVideoPlayerWebController = CustomVideoPlayerWebController(
      webVideoPlayerSettings: _customVideoPlayerWebSettings,
    );
  }

  @override
  void dispose() {
    _customVideoPlayerController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return CupertinoPageScaffold(
      navigationBar: const CupertinoNavigationBar(
        middle: Text("Appinio Video Player"),
      ),
      child: SafeArea(
        child: ListView(
          children: [
            kIsWeb
                ? Expanded(
                    child: CustomVideoPlayerWeb(
                      customVideoPlayerWebController:
                          _customVideoPlayerWebController,
                    ),
                  )
                : CustomVideoPlayer(
                    customVideoPlayerController: _customVideoPlayerController,
                  ),
            CupertinoButton(
              child: const Text("Play Fullscreen"),
              onPressed: () {
                if (kIsWeb) {
                  _customVideoPlayerWebController.setFullscreen(true);
                  _customVideoPlayerWebController.play();
                } else {
                  _customVideoPlayerController.setFullscreen(true);
                  _customVideoPlayerController.videoPlayerController.play();
                }
              },
            ),
          ],
        ),
      ),
    );
  }
}

String videoUrlLandscape =
    "https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4";
String videoUrlPortrait =
    'https://assets.mixkit.co/videos/preview/mixkit-a-girl-blowing-a-bubble-gum-at-an-amusement-park-1226-large.mp4';
String longVideo =
    "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";

String video720 =
    "https://www.sample-videos.com/video123/mp4/720/big_buck_bunny_720p_10mb.mp4";

String video480 =
    "https://www.sample-videos.com/video123/mp4/480/big_buck_bunny_480p_10mb.mp4";

String video240 =
    "https://www.sample-videos.com/video123/mp4/240/big_buck_bunny_240p_10mb.mp4";

Download details:

Author: appinio.app

Source:  https://github.com/appinioGmbH/flutter_packages

#flutter #android #web-development #web #video #custom 

Flutter Custom Video Player Builds on top Of The Official Video_player

Validate Sign in User-entered Password with Your Rules In Flutter

Flutter Password Validator 


 

Flutter Password Validator package helps you to validate sign-in user-entered passwords with your rules.

How to use

1- Depend on it

Add it to your package's pubspec.yaml file:

dependencies:
  flutter_pw_validator: <latest>

2- Install it

Install packages from the command line:

flutter pub get

3- Usage

First You have to import the file:

import 'package:flutter_pw_validator/flutter_pw_validator.dart';

And then just put it right under your password TextField and pass the controller to that:

new TextField(
    controller: _passwordController
),
new FlutterPwValidator(
    controller: _passwordController,
    minLength: 6,
    uppercaseCharCount: 2,
    lowercaseCharCount: 2,
    numericCharCount: 3,
    specialCharCount: 1,
    width: 400,
    height: 150,
    onSuccess: yourCallbackFunction,
    onFail: yourCallbackFunction
)

Properties

PropertyDescriptionDefault ValueRequired
controllerTakes your password TextField controllernullYes
minLengthTakes total minimum length of passwordnullYes
uppercaseCharCountTakes minimum uppercase character count that has to include in the password0No
lowercaseCharCountTakes minimum lowercase character count that has to include in the password0No
numericCharCountTakes minimum numeric character count that has to include in the password0No
specialCharCountTakes minimum special character count that has to include in the password0No
widthTakes the widget widthnullYes
heightTakes the widget heightnullYes
onSuccessA void callback function that runs when the password is matched with the condition(s)nullYes
onFailA void callback that gets called everytime the password doesn't match with the condition(s)nullNo
defaultColorTakes default state color of the widgetColor(0xFFd3d3d3)No
successColorTakes success state color of the widgetColor(0xFF2ee292)No
failureColorTakes failure state color of the widgetColor(0xFFf9433e)No
stringsA class implementing the default FlutterPwValidatorStringsEnglish FlutterPwValidatorStringsNo
keyKey to access the widget state and its functions GlobalKey<FlutterPwValidatorState>()nullNo


 

i18n

If you want to translate this plugin simply implements the FlutterPwValidatorStrings class and pass it to the widget.

class FrenchStrings implements FlutterPwValidatorStrings {
  @override
  final String atLeast = 'Au moins - caractères';
  @override
  final String uppercaseLetters = '- Lettres majuscules';
  @override
  final String numericCharacters = '- Chiffres';
  @override
  final String specialCharacters = '- Caractères spéciaux';
}

FlutterPwValidator(
    // ...
    // your config above
    strings: FrenchStrings()
)

Example Project

You can use this example project to see how it works.

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add flutter_pw_validator

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  flutter_pw_validator: ^1.6.0

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:flutter_pw_validator/flutter_pw_validator.dart';

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_pw_validator/flutter_pw_validator.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        debugShowCheckedModeBanner: false,
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
          visualDensity: VisualDensity.adaptivePlatformDensity,
        ),
        home: new Scaffold(
            appBar: new AppBar(
              title: new Text("Flutter Pw Validator"),
            ),
            body: new AppHome()));
  }
}

class AppHome extends StatelessWidget {
  final TextEditingController controller = new TextEditingController();

  ///Passing a key to access the validate function
  final GlobalKey<FlutterPwValidatorState> validatorKey = GlobalKey<FlutterPwValidatorState>();

  @override
  Widget build(BuildContext context) {
    return new Stack(children: [
      Padding(
        padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 12.5),
        child: Column(
          children: [
            new Flexible(flex: 5, child: new FlutterLogo(size: 200)),
            Flexible(
              flex: 7,
              child: SingleChildScrollView(
                child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Padding(
                    padding: const EdgeInsets.symmetric(horizontal: 2.0),
                    child: new TextField(
                        controller: controller,
                        decoration: new InputDecoration(
                            hintText: "Password",
                            border: new OutlineInputBorder(
                                borderSide: BorderSide()))),
                  ),
                  new SizedBox(
                    height: 5,
                  ),
                  new FlutterPwValidator(
                    key: validatorKey,
                    controller: controller,
                    minLength: 8,
                    uppercaseCharCount: 2,
                    lowercaseCharCount: 3,
                    numericCharCount: 3,
                    specialCharCount: 1,
                    normalCharCount: 3,
                    width: 400,
                    height: 200,
                    onSuccess: () {
                      print("MATCHED");
                      ScaffoldMessenger.of(context).showSnackBar(new SnackBar(
                          content: new Text("Password is matched")));
                    },
                    onFail: () {
                      print("NOT MATCHED");
                    },
                  ),
                ],
              ),
              )
            )
          ],
        ),
      ),
    ]);
  }
}

Download details:

Author: ArefMozafari

Source: https://github.com/ArefMozafari/flutter_pw_validator

#flutter #passwords #signs #custom 

Validate Sign in User-entered Password with Your Rules In Flutter

A Theme Controller Across The Widget Tree for Flutter

Easy to use, customizable Theme Provider. This provides app color schemes throughout the app and automatically rebuilds the UI dynamically. You can also persist your color theme as well. Easily store and retrieve user preference without hassle. This package also provides you with several widgets that can help you to easily add theme switching abilities. Additionally you can pass option classes to store and provide data which should be associated with the current theme.

▶️ Basic Demonstration

Web demo is available in https://kdsuneraavinash.github.io/theme_provider

Basic UsageDialog Box
RecordRecord

💻 Include in your project

dependencies:
  theme_provider: <latest version>

run packages get and import it

import 'package:theme_provider/theme_provider.dart';

👨‍💻 Usage

Basic Usage

Wrap your material app like this to use dark theme and light theme out of the box.

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ThemeProvider(
      child: ThemeConsumer(
        child: Builder(
          builder: (themeContext) => MaterialApp(
            theme: ThemeProvider.themeOf(themeContext).data,
            title: 'Material App',
            home: HomePage(),
          ),
        ),
      ),
    );
  }
}

Provide additional themes

You may also provide additional themes using the themes parameter. Here you have to provide a theme id string and theme data value. (Make sure to provide unique theme ids)

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ThemeProvider(
      themes: [
        AppTheme.light(), // This is standard light theme (id is default_light_theme)
        AppTheme.dark(), // This is standard dark theme (id is default_dark_theme)
        AppTheme(
          id: "custom_theme", // Id(or name) of the theme(Has to be unique)
          description: "My Custom Theme", // Description of theme
          data: ThemeData(  // Real theme data
            primaryColor: Colors.black,
            accentColor: Colors.red,
          ),
        ),
      ],
      child: ThemeConsumer(
        child: Builder(
          builder: (themeContext) => MaterialApp(
            theme: ThemeProvider.themeOf(themeContext).data,
            title: 'Material App',
            home: HomePage(),
          ),
        ),
      ),
    );
  }
}

Changing and accessing the current theme

You can use the theme id strings to change the current theme of the app.

 ThemeProvider.controllerOf(context).nextTheme();
 // Or
 ThemeProvider.controllerOf(context).setTheme(THEME_ID);

Access current AppTheme

 ThemeProvider.themeOf(context)

Access theme data:

 ThemeProvider.themeOf(context).data
 // or
 Theme.of(context)

Apps with routing

Wrapping material app with ThemeProvider

If you provide the theme consumer on MaterialApp then you don't have to provide ThemeConsumer on routes. However that would disable the ability to use multiple theme controllers. Also a visible flickr may occur at the start of app when the saved theme is loaded.

This approach is much easier to integrate and works well with all other material components such as SearchDelegates and DialogBoxes without wrapping with ThemeConsumers.

Wrapping each route independently with ThemeProvider

However you could also wrap each route and dialog in ThemeConsumer instead of wrapping the whole material app. This will give a more granular control and will not cause a visual flikr. However, some integrations(eg: SearchDelegates) might not be trivial.

MaterialPageRoute(
  builder: (_) => ThemeConsumer(child: SecondPage()),
),

Provide callbacks for theme changing event

If you want to change the StatusBarColor when the theme changes, you can provide a onThemeChanged callback to the ThemeProvider.

Passing Additional Options

This can also be used to pass additional data associated with the theme. Use options to pass additional data that should be associated with the theme. eg: If font color on a specific button changes according to the current theme, create a class to encapsulate the value.

Options classes must implement or extend AppThemeOptions.

  class MyThemeOptions implements AppThemeOptions{
    final Color specificButtonColor;
    MyThemeOptions(this.specificButtonColor);
  }

Then provide the options with the theme.

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ThemeProvider(
      themes: [
        AppTheme(
          id: "light_theme",
          description: "Light Theme",
          data: ThemeData.light(),
          options: MyThemeOptions(Colors.blue),
        ),
        AppTheme(
          id: "light_theme",
          description: "Light Theme 2",
          data: ThemeData.dark(),
          options: MyThemeOptions(Colors.red),
        ),
      ],
      // ....
    );
  }
}

Then the option can be retrieved as,

ThemeProvider.optionsOf<MyThemeOptions>(context).specificButtonColor

💾 Persisting theme

Saving theme

To persist themes, simply pass saveThemesOnChange as true. This will ensure that the theme is saved to the disk.

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ThemeProvider(
      saveThemesOnChange: true,
      // ...
    );
  }
}

Or manually save the current theme by just using,

ThemeProvider.controllerOf(context).saveThemeToDisk();

Loading saved theme

defaultThemeId will always be used to determine the initial theme. (If not provided the first theme you specify will be the default app theme.) But you can manually load the previous(saved) theme by using:

 ThemeProvider.controllerOf(context).loadThemeFromDisk();

To load a previously saved theme pass loadThemeOnInit as true:

ThemeProvider(
  saveThemesOnChange: true,
  loadThemeOnInit: true,
  // ...
)

Or to load a theme/do some task at theme controller initialization use onInitCallback. This will get called on the start.

For example, snippet below will load the previously saved theme from the disk. (if previosuly saved.)

ThemeProvider(
  defaultThemeId: "theme_1",
  themes: [
    AppTheme.light(id: "theme_1"),
    AppTheme.light(id: "theme_2"),
    AppTheme.light(id: "theme_3"),
  ],
  saveThemesOnChange: true,
  onInitCallback: (controller, previouslySavedThemeFuture) async {
    // Do some other task here if you need to
    String savedTheme = await previouslySavedThemeFuture;
    if (savedTheme != null) {
      controller.setTheme(savedTheme);
    }
  },
  // ...
)

⚡ Dynamically Adding/Removing Themes

Themes can be dynamically added/removed via addTheme and removeTheme. Whether a theme id exists or not can be checked via hasTheme. A theme can only be added if it is not added previously. Similarly, a theme can only be removed if it is previously added. So the membership must be checked before adding/removing themes. (Whether a theme exists or not is decided via its theme id) Note that the active theme cannot be removed.

// Add theme
if (ThemeController.of(context).hasTheme('new_theme')){
  ThemeController.of(context).addTheme(newAppTheme);
}

// Remove theme
if (ThemeController.of(context).hasTheme('new_theme')){
  if (ThemeController.of(context).theme.id != 'new_theme'){
    ThemeController.of(context).removeTheme('new_theme')
  }
}

🔌 Checking system theme when loading initial theme

You can do this by simply checking for the system theme in onInitCallback callback. Following is an example usage. In the following snippet, the theme will be set to the previously saved theme. If there is no previously saved theme, it is set to light/dark depending on system theme.

You can use any kind of logic here to change the initialization callback.

Dynamically listening to theme changes is not yet available. The theme check is only possible on app start.

import 'package:flutter/scheduler.dart';


ThemeProvider(
  saveThemesOnChange: true, // Auto save any theme change we do
  loadThemeOnInit: false, // Do not load the saved theme(use onInitCallback callback)
  onInitCallback: (controller, previouslySavedThemeFuture) async {
    String savedTheme = await previouslySavedThemeFuture;

    if (savedTheme != null) {
      // If previous theme saved, use saved theme
      controller.setTheme(savedTheme);
    } else {
      // If previous theme not found, use platform default
      Brightness platformBrightness =
          SchedulerBinding.instance.window.platformBrightness;
      if (platformBrightness == Brightness.dark) {
        controller.setTheme('dark');
      } else {
        controller.setTheme('light');
      }
      // Forget the saved theme(which were saved just now by previous lines)
      controller.forgetSavedTheme();
    }
  },
  themes: <AppTheme>[
    AppTheme.light(id: 'light'),
    AppTheme.dark(id: 'dark'),
  ],
  child: ThemeConsumer(
    child: Builder(
      builder: (themeContext) => MaterialApp(
        theme: ThemeProvider.themeOf(themeContext).data,
        title: 'Material App',
        home: HomePage(),
      ),
    ),
  ),
);

🎁 Additional Widgets

Theme Cycle Widget

IconButton to be added to AppBar to cycle to next theme.

Scaffold(
  appBar: AppBar(
    title: Text("Example App"),
    actions: [CycleThemeIconButton()]
  ),
),

Theme Selecting Dialog

SimpleDialog to let the user select the theme. Many elements in this dialog is customizable. Remember to wrap dialog is a ThemeConsumer.

showDialog(context: context, builder: (_) => ThemeConsumer(child: ThemeDialog()))

☑️ TODO

  • Add next theme command
  • Add theme cycling widget
  • Add theme selection by theme id
  • Add theme select and preview widget
  • Persist current selected theme
  • Add unit tests and example
  • Remove provider dependency
  • Ids for theme_providers to allow multiple theme providers
  • Add example to demostrate persistence

🐞 Bugs/Requests

If you encounter any problems feel free to open an issue. Pull request are also welcome.

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add theme_provider

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dependencies:
  theme_provider: ^0.6.0

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:theme_provider/theme_provider.dart';

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:theme_provider/theme_provider.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return ThemeProvider(
      saveThemesOnChange: true,
      loadThemeOnInit: false,
      onInitCallback: (controller, previouslySavedThemeFuture) async {
        final view = View.of(context);
        String? savedTheme = await previouslySavedThemeFuture;
        if (savedTheme != null) {
          controller.setTheme(savedTheme);
        } else {
          Brightness platformBrightness =
              // ignore: use_build_context_synchronously
              view.platformDispatcher.platformBrightness;
          if (platformBrightness == Brightness.dark) {
            controller.setTheme('dark');
          } else {
            controller.setTheme('light');
          }
          controller.forgetSavedTheme();
        }
      },
      themes: <AppTheme>[
        AppTheme.light(id: 'light'),
        AppTheme.dark(id: 'dark'),
      ],
      child: ThemeConsumer(
        child: Builder(
          builder: (themeContext) => MaterialApp(
            theme: ThemeProvider.themeOf(themeContext).data,
            title: 'Material App',
            home: const HomePage(),
          ),
        ),
      ),
    );
  }
}

class HomePage extends StatelessWidget {
  static const String customAppThemeId = 'custom_theme';

  const HomePage({super.key});

  AppTheme customAppTheme() {
    return AppTheme(
      id: customAppThemeId,
      description: "Custom Color Scheme",
      data: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.red),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    var controller = ThemeProvider.controllerOf(context);

    return Scaffold(
      appBar: AppBar(title: const Text("Example App")),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            _buildButton(
              text: "Next Theme",
              onPressed: controller.nextTheme,
            ),
            _buildButton(
              text: "Theme Dialog",
              onPressed: () {
                showDialog(context: context, builder: (_) => ThemeDialog());
              },
            ),
            _buildButton(
              text: "Second Screen",
              onPressed: () {
                Navigator.push(context,
                    MaterialPageRoute(builder: (_) => const SecondPage()));
              },
            ),
            const Divider(),
            _buildButton(
              text: "Add Custom Theme",
              onPressed: controller.hasTheme(customAppThemeId)
                  ? null
                  : () => controller.addTheme(customAppTheme()),
            ),
            _buildButton(
              text: "Remove Custom Theme",
              onPressed: controller.hasTheme(customAppThemeId)
                  ? controller.theme.id != customAppThemeId
                      ? () => controller.removeTheme(customAppThemeId)
                      : null
                  : null,
            ),
            const Divider(),
            controller.hasTheme(customAppThemeId)
                ? const Text('Custom theme added')
                : Container(),
            Text('Current theme: ${controller.theme.id}'),
          ],
        ),
      ),
    );
  }

  Widget _buildButton({required String text, VoidCallback? onPressed}) {
    return Padding(
      padding: const EdgeInsets.all(4.0),
      child: ElevatedButton(
        onPressed: onPressed,
        child: Text(text),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Second Screen"),
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: ThemeProvider.controllerOf(context).nextTheme,
          child: const Text("Next Theme"),
        ),
      ),
    );
  }
}

Download details:

Author: kdsuneraavinash

Source: https://www.github.com/kdsuneraavinash/theme_provider

#flutter #android #ios #web-development #custom 

A Theme Controller Across The Widget Tree for Flutter
Aman Mehra

Aman Mehra

1628334503

Laravel Unique Validation Rules Examples » Your Blog Coach

In this tutorial we will learn the unique validation feature in laravel and how you can implement it in laravel 6, laravel 7, and laravel 8.

There are two ways to add unique validation on email, username, or any other fields. First, we will with the database migration and second with form request. So let’s jump to define the validation while migration.

  • Unique Validation with Database Migration
  • Form Request Unique Validation

Checkout tutorial for details

#laravel #regex #custom #coding #web-development 

 

 

Laravel Unique Validation Rules Examples » Your Blog Coach

How to Build React Custom Hooks with Axios

Build React custom hooks with Axios in this React tutorial for beginners. We'll construct our own useFetch hook that applies Axios instead of the Fetch API. We'll also get started with a simple custom hook called useWindowSize.

🔗 Project Source Code: https://github.com/gitdagray/react_custom_hooks

React Custom Hooks

(00:00) Intro
(00:05) Welcome 
(00:19) Quick Set Up
(00:43) Rules of Hooks
(01:45) React Custom Hooks are like recipes
(02:41) Creating the useWindowSize custom hook
(08:46) Reviewing the useWindowSize custom hook
(09:25) Applying useWindowSize to the React App
(15:01) Remember the useEffect clean up function
(17:20) Creating the useAxiosFetch custom hook
(25:34) Reviewing the useAxiosFetch custom hook
(27:16) Applying useAxiosFetch to the React App
(35:19) Final clean up

🔗 Rules of Hooks:
https://reactjs.org/docs/hooks-rules.html

🔗 Collections of Hooks:
https://nikgraf.github.io/react-hooks/
https://www.npmjs.com/package/react-use

🔗 Axios:
https://www.npmjs.com/package/axios

🔗 React Router:
https://reactrouter.com

🔗 JSON-Server:
https://www.npmjs.com/package/json-server

#react #custom #hooks

How to Build React Custom Hooks with Axios
Marisol  Kuhic

Marisol Kuhic

1627599600

Flutter: Added Subtitles | Source Code in Description

#Appbar customization’s in flutter is explained in this part of the tutorial where you can added icon buttons or drop down list.

Source Code : http://www.androidcoding.in/2021/01/26/flutter-appbar/

#flutter #subtitle #code #custom

Flutter: Added Subtitles  | Source Code in Description

15 - Custom normalizers in Symfony 4 REST

This video will show you how you can create you can create a custom normalizer in Symfony 4to make changes to your data before serializing it, let me know if you have any question or if you encounter any problems

Git repository : https://github.com/konshensx16/symfony-todo-backend

#symfony 4 rest #custom #normalizers

15 - Custom normalizers in Symfony 4 REST
Lawson  Wehner

Lawson Wehner

1626142862

Custom Chat Bubble In Flutter

Learn How To Make A Custom Chat Bubble In Your Flutter Apps.

Conversation chat applications show messages in chat rises with strong shading backgrounds. Modern chat applications show chat bubbles with slopes that depend on the bubbles’ situation on the screen. There are times when we need to utilize a chat bubble in our flutter application. Yet, utilizing a library for a particularly inconsequential errand isn’t great.

In this blog, we will explore the Custom Chat Bubble In Flutter. We will see how to implement a demo program of the custom chat bubble and how to make a custom chat bubble most simply without using any third-party libraries in your flutter applications.

Table Of Contents ::

Flutter

Implementation

Code Implement

Code File

Conclusion

Flutter:

“ Flutter is Google’s UI toolkit that helps you build beautiful and natively combined applications for mobile, web, and desktop in a single codebase in record time ”

It is free and open-source. It was at first evolved from Google and presently overseen by an ECMA standard. Flutter applications utilize the Dart programming language for making an application. The dart programming shares a few same highlights as other programming dialects, like Kotlin and Swift, and can be trans-arranged into JavaScript code.

If you want to explore more about Flutter, please visit Flutter’s official website to get more information.

Flutter Is Proudly Entrusted By These Organizations For their Products : — Flutter Showcase

#custom #flutter #dart

Custom Chat Bubble In Flutter

Amit Singh

1625460641

Stages Of Blockchain Project Development

Blockchain Technology

A blockchain is typically called a bunch of blocks that are absolute to one another by using cryptography. Those blocks work on a peer to peer network, these networks are mostly decentralized.
As it is Decentralization minimizes the one-point failure of the system.
It is transparent as it gives access to information to each member of the network at an identical time.
As the records of transactions can’t be changed it gives more security.

Step Of Development:

Defining the purpose

Blockchain can be a revolutionary technology, it can be very expensive to use it where it is not needed. So deciding its purpose in the project is necessary.

Finding out the Consensus Mechanism

There are several consensus mechanisms available, such as:

  • Proof of Work
  • Proof of stake
  • Delegated proof of stake
  • Proof of Burn
  • Practical Byzantine fault-tolerant Mechanism
  • Proof of Identity
  • Proof of Time
  • Proof of Importance

Identify the foremost important platform / network

Blockchain technology covers various platforms / networks such as Bitcoin, Ethereum, and so on. At present, many blockchain consulting companies are actively using ETH platforms.

Designing the architecture

There is multiple hardware and software configurations Selection, such as:

  1. Disk size
  2. Processor
  3. Memory
    It should be selected according to your requirements.

API Development

A list of some things that are required by the API:
Key Generation and addresses
Functions to perform the audit
Use digital signatures and hashes to verify data
Storage & retrieve data

Admin and UI Design

Various front-end tools can be used, such as Angular.js, HTML5, CSS, etc.
The external database can be MySQL, MongoDB or. The server can be selected as an FTP server, Web server, mail server, or more.

Identifying problems

It is recommended to use enough test solutions. This will help you identify crashes, delays, performance issues, and memory interruptions.

Blockchain Development Company

#blockchain #custom #it #development

Stages Of Blockchain Project Development
Ruthie  Bugala

Ruthie Bugala

1624400760

Extending Azure Functions with custom handlers

Much of the value in the public cloud, especially the hyperscale providers like Azure, is economic. You’re taking advantage of their ability to buy power, network, and hardware at a scale that would have been unimaginable a few years ago.

Another benefit of the hyperscale clouds is their operational expertise and their infrastructure design. They can spin up a new server instance in seconds, providing compute on demand. And with container technologies, they’re able to quickly switch in new isolated environments and scale them up as necessary.

That’s where serverless technologies come in, building on those skills and the processes to rapidly launch small, stateless processes as necessary. Like much cloud-native development, these serverless processes are event driven, responding to messages, processing their contents, and passing the results on to the next element of a distributed application. As they’re launched on demand, they can scale rapidly, and as they’re billed per second of CPU time, they’re also relatively cheap when compared to a full-time virtual infrastructure.

The evolution of Azure Functions

Azure’s serverless elements are its Functions, easy-to-construct blocks of code that can be assembled into more complex platforms. They’re designed to work in conjunction with Azure’s messaging infrastructure, from its IoT (Internet of Things) services to its scalable publish-and-subscribe Grid. There are direct bindings to key Azure services, simplifying building a Functions-based PaaS application or using a Function to control and trigger other Azure-hosted applications.

Microsoft has continued to evolve Functions, and it’s now on the third release of its runtime. With that comes support for C## and F## based on .NET Core 3.1; JavaScript running on node.js 10, 12, and 14 (along with a TypeScript transpiler for more complex applications); Java 8 and 11; PowerShell 7 and Core 6; and Python 3.6, 3.7, 3.8, and 3.9. It’s a long list of languages, covering much of the enterprise development space, but it’s not everything out there. You can use earlier versions, but Version 3 is the default for new Functions.

Volume 0%

Limited language support isn’t surprising; even with its size, Microsoft doesn’t have the scale to produce Functions runtimes for every language. However, there is an option that lets you continue to use your choice of languages. For example, you can work in Rust or Go while still looking like a Functions end point to the rest of your application.

#azure #extending #custom #functions

Extending Azure Functions with custom handlers

Chengbo Ruan

1621922734

Battle Ready Japanese Samurai Swords | Custom Swords of Lyuesword

Lyuesword Co., Ltd. was established in 2010. It is an online sales company specializing in the production of handmade swords. We have been offering high quality custom swords, Katana, Tachi, Wakizashi, Tanto, Movie swords and Chinese swords.
https://www.lyuesword.com

#katana #custom #swords

Custom Shapes Cubic Loader in Flutter

Made by Learn Flutter With Smrity

Tool
Custom paint to make the custom shapes and alse used bezier paint. In that we addded awesome animation that make the loader great looks.

Author: Smrity

View explanation in Youtube
1st Part for making Custom Shape :https://www.youtube.com/watch?v=4qhZmz4f2fw
2nd part for ading animation : https://www.youtube.com/watch?v=Nx-sG_P4cKU

Subscribe to get more : https://www.youtube.com/channel/UCxcvg9qQNzy7jfdON6AwYOg

#flutter #dart #programing #animation #custom #shapes

Custom Shapes Cubic Loader in Flutter

How To Create Custom Middleware In Laravel

In this tutorial I will give you information about middleware and I will show you how to create custom middleware in laravel.

Laravel includes a middleware that verifies the user of your application is authenticated. If the user is not authenticated, the middleware will redirect the user to the login screen.If in your project’s have multiple user then we need to use middleware to provide diffrent access or login to diffrent users.

How To Create Custom Middleware In Laravel

https://websolutionstuff.com/post/how-to-create-custom-middleware-in-laravel

#laravel #create #custom #middleware #beginners #web-development

How To Create Custom Middleware In Laravel
Reid  Rohan

Reid Rohan

1617284940

Building Custom Typescript Decorators for Angular

As frontend developers we love beautiful UI. In the same vein, we really should strive to have clean reusable code. Modern tools and techniques provide us with many ways to achieve that. In this article, we will look at typescript decorators, and how they can help us add abstraction and reusability to our code.

We will do that by creating a custom decorator to launch a  Sweetalert.

But first of all let us look at what decorators are.

When I was first introduced to decorators, I wondered why we needed them at all. I mean sure, Angular uses that @Whatever symbols everywhere but how did they actually work? Ultimately they looked like black boxes. And surely, one can build apps in TS / Angular without understanding them. But once we dig a little deeper we can understand what they are, as well as the benefits of using them.

What are decorators?

At its core, a decorator is just a JavaScript function. Ok i know this sounds like a joke but really! A decorator is just a function that allows us to “extend” our code to do more. Yes it’s very abstract for now but we’ll get to clarify that soon.

Let’s look at the different types of decorators available in typescript.

There are four main types:

  • Class decorators, which are used to add functionality to a class e.g. @Component and @NgModule
  • Property decorators for adding functionality to properties inside classes, e.g. @Input and @Output
  • Method decorators for methods inside classes, e.g. @HostListener
  • Parameter decorators for parameters inside class constructors, e.g. @Inject

Each decorator has a unique role. For examples of the different decorator types and their application in angular, please check  Decorators used in Angular.

Those are the basics you should know before we can jump into the fun part, actual code :) As mentioned earlier, we will be creating a method decorator that will show a sweetalert confirmation box before a method is executed.

#custom #confirmable #angular #decorators #typescript

Building Custom Typescript Decorators for Angular

Nicky Mose

1617177607

The Carton Packaging Is The Winner – Here Is Why!

This is image title

Tap into the fridge or check out the pantry, and you will find something similar; what’s that? Yes, we are talking about the carton boxes. These not-so-humble carton boxes have penetrated the houses and offices alike. Ranging from cosmetics to milk, cereal to the toy boxes, and electronic boxes, there is one or another way of custom display boxes and carton boxes making way into space. 

For the most part, the cartoons have been around for centuries, and they are here to stay. It wouldn’t be wrong to say that carton’s demand keeps spiking up. For instance, one report suggests that the carton packaging market will worth around $171.35 billion by 2025, but this number isn’t limited to the US only. Accrediting to the growing economy, Asia Pacific will make around $80 billion by 2025. 

On the other hand, the companies have understood the importance, functionality, aesthetics, and affordability associated with carton boxes and retail display boxes. It’s evident that cartoon boxes are hard to beat. These boxes are not only cost-effective but are extremely easy to use and have the capacity to attract the users’ eye. Well, that’s pretty impressive for one box! 

What Is A Carton Box?

For the most part, it’s a box but not every box is a carton (confusing, right?). There are variating definitions of cartons out there, and that’s the prime reason that corrugated boxes and rigid boxes aren’t necessarily cartons. Even more, the boxes made out of wood aren’t called cartons. Sorry to make it more confusing, but there are different names for cartons out there. 

Ranging from folding carton boxes to chipboard boxes and paperboard boxes, there are different terms out there. Irrespective of what you call them, these can be found anywhere. To illustrate, a carton is defined as a folding box made from paperboard. The paperboard undergoes cutting, lamination, folding, and printing before it’s pushed to the ultimate usage. 

Using Carton Boxes For Packaging – The Benefits

The carton boxes are extremely beautiful, practical, and eco-friendly, which makes them great for packaging purposes. The carton boxes are famous for ensuring efficient utilization of the space since they are lightweight and can be folded flat. That being said, it’s extremely easy to stack them, hence saving space in the warehouse. 

The cartons are designed with a folding design which means quick and convenient reclosing and opening. The best thing about carton boxes is that they are perfect for automatic packaging, which leads to easy filling and sealing (even with the automatic machinery). The carton boxes are made from reasonably-priced raw material, hence the low-price factor. 

What we love most about carton packaging is that it’s extremely flexible and versatile since it can store any product you want. Also, there are never any compromises on durability and strength, so the products remain safe. 

Easy Customization 

Long gone the times when companies were okay with simple brown boxes and customers didn’t mind either because now, the companies, as well as customers, are extremely particular about how the boxes look. That being said, the carton boxes can be customized just as you like (no more boring boxes). The carton boxes can take on personality and creativity. 

With the implication of the right design, the carton boxes will be transformed into eye-catching boxes. It wouldn’t be wrong to say that these boxes are often the first impression of your brand in front of the customers, so you’ve to make it big. According to research, the first impression is created within 17 milliseconds (that’s fast, right?), so you have to make a quick impression. 

The carton boxes are designed to be conducive to the packaging design, and they will improve the wow factor in no time. The carton boxes are made from paperboard, and this material is extremely customization and printing-friendly. Ranging from two-sided prints to high-end graphics, the carton boxes can be customized as you like. 

The carton boxes are equally practical since the companies can include whichever information they want (the product description). In particular, this is an important consideration for food companies since companies can print down elaborated nutritional information on the box. On top of everything, the carton boxes can be designed into different sizes and shapes. 

Eco-Friendliness 

It’s hard to find companies and customers that don’t care about eco-friendliness anymore. This is because everyone has become too aware of how different materials and products are harming the environment. For this reason, the demand for eco-friendly packaging is increasing, and carton boxes are one of the most eco-friendly options available out there. 

In addition, the paperboard can be recycled and reused since it’s non-toxic. The most intriguing factor is that the carton boxes easily break down, which actually work as motivation for recycling the materials. Lastly, the carton boxes can be made from non-wood or recycled paper pulp, hence no excessive tree cutting either!

#display #boxes #custom