Rupert  Beatty

Rupert Beatty

1668098126

PandoraPlayer: A lightweight music player for iOS, based on AudioKit

Purpose

PandoraPlayer is a lightweight music player for iOS, based on AudioKit and completely written in Swift, constructed to be fast, light and have a nice design.

Features

  •  Plays iPod music / bundle music
  •  Real-time two-channel visual equalizer
  •  Standard controls
  •  Simple API
  •  Simple & intuitive design

Supported OS & SDK Versions

  • Supported build target - iOS 9.0

Installation

CocoaPods

Add the following line in your Podfile.

pod 'PandoraPlayer'

Usage

import PandoraPlayer

let playerVC = PandoraPlayer.configure(withMPMediaItems: mediaItems)
navigationController?.present(playerVC, animated: true, completion: nil)

Demo

example-plain

Release Notes

Version 1.0

  • Release version.

Version 1.1

  • Added Xcode 9 and Swift 4 support

Contact Us

You can always contact us via github@applikey.biz We are open for any inquiries regarding our libraries and controls, new open-source projects and other ways of contributing to the community. If you have used our component in your project we would be extremely happy if you write us your feedback and let us know about it!

Download Details:

Author: ApplikeySolutions
Source Code: https://github.com/ApplikeySolutions/PandoraPlayer 
License: MIT license

#swift #audio #radio #music #ios 

PandoraPlayer: A lightweight music player for iOS, based on AudioKit

Flutter Cupertino Radio Choice

Flutter Cupertino Radio Choice

Cupertino buttons which are used as radio buttons in order to select one value.

Tutorial

A complete tutorial how to use CupertinoRadioChoice can be found here: Tutorial

Quick Usage

Just fill the required parameters of CupertinoRadioChoice and you're ready to go, e.g.:

CupertinoRadioChoice(
    choices: {'male' : 'Male', 'female' : 'Female', 'other': 'Other'},
    onChange: (selectedGender) {},
    initialKeyValue: 'male')

Please refer to the example for usage: Quick-Link

Example

Bugs/Requests

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on Github and I'll look into it. Pull Request are also welcome.

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add cupertino_radio_choice

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

dependencies:
  cupertino_radio_choice: ^1.0.2

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:cupertino_radio_choice/cupertino_radio_choice.dart'; 

example/lib/main.dart

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

import 'package:flutter/cupertino.dart';

void main() => runApp(ExampleApp());

class ExampleApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: MyHome(),
    );
  }
}

class MyHome extends StatefulWidget {
  @override
  _MyHomeState createState() => new _MyHomeState();
}

class _MyHomeState extends State<MyHome> {
  static final Map<String, String> genderMap = {
    'male': 'Male',
    'female': 'Female',
    'other': 'Other',
  };

  String _selectedGender = genderMap.keys.first;

  @override
  Widget build(BuildContext context) {
    final genderSelectionTile = new Material(
      color: Colors.transparent,
      child: new Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          const Text('Select Gender',
              style: TextStyle(
                color: CupertinoColors.systemBlue,
                fontSize: 15.0,
              )),
          const Padding(
            padding: EdgeInsets.only(bottom: 5.0),
          ),
          CupertinoRadioChoice(
              choices: genderMap,
              onChange: onGenderSelected,
              initialKeyValue: _selectedGender)
        ],
      ),
    );

    return new Scaffold(
      body: Padding(
          padding: const EdgeInsets.fromLTRB(20, 100, 20, 50),
          child: Column(children: <Widget>[genderSelectionTile])),
    );
  }

  void onGenderSelected(String genderKey) {
    setState(() {
      _selectedGender = genderKey;
    });
  }
} 

Download Details:

Author: Rodiii

Source Code: https://github.com/Rodiii/flutter_cupertino_radio_choice

#flutter #radio #android 

Flutter Cupertino Radio Choice
Rupert  Beatty

Rupert Beatty

1666591500

Swift-Radio-Pro: Professional Radio Station App for iOS!

Swift Radio

Swift Radio is an open source radio station app with robust and professional features. This is a fully realized Radio App built entirely in Swift. master is now the Xcode 11.4 / Swift 5 branch.

There are over 80 different apps accepted to the app store using this code!

Swift Radio

Video

View this GETTING STARTED VIDEO. It's short & sweet to give you a quick overview.
Give it a quick watch.

Features

  • Ability to update Stations from server or locally. (Update stations anytime without resubmitting to app store!)
  • Displays Artist, Track & Album Art on Lock Screen
  • Custom views optimized for SE, 6 and 6+ for backwards compatibility
  • Compiles with Xcode 10.2 & Swift 5
  • Parses JSON using Swift Codable protocol
  • Background audio performance
  • Search Bar that can be turned on or off to search stations
  • Supports local or hosted station images
  • "About" screen with ability to send email & visit website
  • Pull to Refresh stations
  • Uses the AVPlayer wrapper library FRadioPlayer:
    • Automatically download Album Art from iTunes API
    • Parses metadata from streams (Track & Artist information)
  • Uses Spring library:
    • Animate UI components
    • Download and cache images using ImageLoader class

Important Notes

  • 4.10.19: master/carplay/dev branches migrated to Xcode 11.4/Swift 5 by @fethica.
  • 8.20.19: Add watermarked image for share activity by @CamMcLeod.
  • 5.18.19: master branch migrated to Xcode 10.2/Swift 5 by @fethica.
  • 9.4.19: Add AirPlay support by @geraldnolan.
  • 2.10.19: Add CarPlay support by @fethica -- Announcement. Branch here: carplay branch.
  • 1.30.19: Add iPad support by @misteral.
  • 1.9.19: master branch migrated to Xcode 10/Swift 4.2 by @fethica.
  • 1.21.18 Update: Swift Radio App gets a major update with Version 2 by @fethica -- Release Note.
  • 10.6.17 Update: The AVPlayer branch migrated to Xcode 9/Swift 4 by @joemcmahon. Branch here: AVPlayer Branch
  • 10.1.17 Update: Master branch migrated to Xcode 9/Swift 4 by @fethica.
  • 12.26.16 Update: The AVPlayer branch has been updated to Swift 3 by @giacmarangoni. Branch here: Xcode8/AVPlayer Branch
  • 9.20.16 Update: Master branch migrated to Xcode 8/Swift 3 by @fethica. Big thanks to him!
  • 7.26.16 Update: AVPlayer development branch added, thanks @kusikusa. Plus, this branch includes the Spotify API for downloading artwork: AVPlayer/Spotify Branch
  • 6.5.16 Update: Bluetooth streaming added, thanks @fethica
  • 3.27.16 Update: Google handoff added, thanks @GraemeHarrison
  • 2.24.16 Update: Share icon added, thanks @SuperChloe.
  • 12.30.15 Update: UISearchBar added, thanks @fethica. Turn it on/off in the "SwiftRadio-Settings" file.
  • 12.14.15 Update: LastFM has reopened their API signups. Get one at last.fm/api.
  • 10.21.15 Update: Added option to use iTunes API to download album art. (See FAQ below). iTunes art is 100px x 100px. i.e. It is smaller than LastFM artwork. So, if you use this API instead, you will want to adjust the UI of your app.
  • Volume slider works great in devices, not simulator. This is an Xcode simulator issue.
  • Radio stations in demo are for demonstration purposes only.
  • For a production product, you may want to swap out the MPMoviePlayerController for a more robust streaming library/SDK (with stream stitching, interruption handling, etc).
  • Uses Meng To's Spring library for animation, making it easy experiment with different UI/UX animations
  • SwiftyJSON & Spring are included in the repo to get you up & running quickly. It's on the roadmap to utilize CocoaPods in the future.

Credits

Requirements

  • Xcode 10.2
  • Know a little bit of how to program in Swift with the iOS SDK

Please note: I am unable to offer any free support or modifications. Thanks!

Creating an App

If you create an app with the code, or interesting project inspired by the code, shoot me an email. I love hearing about your projects!

This is just a basic template. You may use it as a clean starting point to add other features.

Some of the things I've built into this Radio code for clients include: Facebook login, Profiles, Saving Favorite Tracks, Playlists, Genres, Spotify integration, Enhanced Streaming, Tempo Analyzing, etc. There's almost unlimited things you can use this code as a starting place for. I keep this repo lightweight. That way you can customize it easily.

Setup

The "SwiftRadio-Settings.swift" file contains some project settings to get you started. Watch this Getting Started Video to get up & running quickly.

Integration

Includes full Xcode Project to jumpstart development.

Stations

Includes an example "stations.json" file. You may upload the JSON file to a server, so that you can update the stations in the app without resubmitting to the app store. The following fields are supported in the app:

name: The name of the station as you want it displayed (e.g. "Sub Pop Radio")

streamURL: The url of the actual stream

imageURL: Station image url. Station images in demo are 350x206. Image can be local or hosted. Leave out the "http" to use a local image (You can use either: "station-subpop" or "http://myurl.com/images/station-subpop.jpg")

desc: Short 2 or 3 word description of the station as you want it displayed (e.g. "Outlaw Country")

longDesc: Long description of the station to be used on the "info screen". This is optional.

Contributions

Contributions are very welcome. Please check out the dev branch, create a separate branch (e.g. features/3dtouch). Please do not commit on master.

FAQ

Q: Do I have to pay you anything if I make an app with this code?
A: Nope. This is completely open source, you can do whatever you want with it. It's usually cool to thank the project if you use the code. Go build stuff. Enjoy.

Q: How do I make my app support ipv6 networks?
A: For an app to be accepted by Apple to the app store as of June 1, 2016, you CAN NOT use number IP addresses. i.e. You must use something like "http://mystream.com/rock" instead of "http://44.120.33.55/" for your station stream URLs.

Q: Is there an example of using this with the Spotify API?
A: Yes, there is a branch here that uses it here (⚠️ deprecated).

Q: Is there another API to get album/track information besides LastFM, Spotify, and iTunes?
A: Rovi has a pretty sweet music API. The Echo Nest has all kinds of APIs that are fun to play with.

Q: I updated the album art size in the Storyboard, and now the sizing is acting funny?
A: There is an albumArt constraint modified in the code. See the "optimizeForDeviceSize()" method in the NowPlayingVC.

Q: My radio station isn't playing?
A: Paste your stream URL into a browser to see if it will play there. The stream may be offline or have a weak connection.

Q: Can you help me add a feature? Can you help me understand the code? Can you help with a problem I'm having?
A: While I have a full-time job and other project obligations, I'd highly recommend you find a developer or mentor in your area to help. The code is well-documented and most developers should be able to help you rather quickly. While I am sometimes available for paid freelance work, see below in the readme, I am not able to provide any free support or modifications. Thank you for understanding!

Q: The song names aren't appearing for my station?
A: Check with your stream provider to make sure they are sending Metadata properly. If a station sends data in a unique way, you can modify the way the app parses the metadata, in the RadioPlayer class implement FRadioPlayerDelegate method: radioPlayer(_ player: FRadioPlayer, metadataDidChange rawValue: String?).

Get Single Station Code

If you'd like to support this project, co-organizer Fethi has created a well-architected single station version of this code. It's a super great bargain: The developers behind this project typically charge up to $200/hr for freelance work, but this fully working code is only $50. No extra fees.

You can PayPal: fethica@me.com or use this link: Paypal Me We will send you the code after 24 hours with setup instructions. All funds go to support the project.

Need something more advanced? We have recent experience building iOS apps for high-profile brands. Send a friendly email to Matthew or Fethi.

RadioKit SDK Example

  • You can use this Swift code as a front-end for a more robust streaming backend.
  • Brian Stormont, creator of RadioKit, has created a branch with the professional RadioKit SDK already integrated. Plus, his branch adds rewind & fast forward stream playback. This is an excellent learning tool for those who are interested in seeing how a streaming library integrates with Swift Radio Pro. View the branch here.

Download Details:

Author: Analogcode
Source Code: https://github.com/analogcode/Swift-Radio-Pro 
License: MIT license

#swift #audio #radio #music 

Swift-Radio-Pro: Professional Radio Station App for iOS!

Radio.jl: A Native Julia Digital Communications Package

Radio.jl

A digital communications package for the Julia language.

Installation

Radio is not yet registered with the Julia package manager, so it needs to cloned:

julia> Pkg.clone("https://github.com/JayKickliter/Radio.jl.git")

Status

Radio is in its infancy. Right now (April 2014) I'm mostly working on support functions (filtering, resampling, noise), and have only implemeted PSK modulation. That said, if you have requests or suggestions, please submit them.

Jul 2014 Updtae: This package has definitely not been abaadonded. I've just been creating core Julia DSP code outside of it, which is why there haven't been any commits lately. I also didn't want to burdened down the line with poor design choices, so I've been getting a little more versed in Julia the last couple months.

Proposed Structure

This is a growing list of proposed functionality and package strcture.

Modulation

  • PSK: Phase Shift Keying modulation/demodulation
  • APSK: Amplitude Phase Shift Keying modulation/demodulation
  • QAM: Quadrature Amplitude Modulation/demodulation

Random

  • WGN: White Gaussian Noise

Math

  • CZT: Chirp-z Transform
  • FFT: ?. Need a non-GPL FFT. Possibly a native Julia implemantation or an interface to FFTS

Filtering

  • FIR: Fir filter design and execution
  • Polyphase: Polyphase filter and execution
  • Resampling: Decimation, interpolation, and rational resampling. Maybe cubic interpolation.

Support

  • Types: IQ
  • Graphics: Filter response, constellation plotting, eye diagram

Examples

QPSK Modulation

See Examples/QPSK.jl

using Radio, Winston

# generate 10,000 random QPSK symbols
symbols = pskmod( 10000, 4 )
# create some gaussian noise and add it to the symbols
noise  = wgn( length( symbols ), 10, "dBm", 1.0, true )
signal = symbols .+ noise

constellation = plot_constellation( signal )
setattr( constellation, title = "QPSK Modulation" )

display( constellation )

8-PSK Modulation

See Examples/8-PSK.jl

using Radio, Winston

# generate random 3 bit data modulate
data = rand( 0:7, 10000 )

# generate 10,000 random QPSK symbols
symbols = pskmod( data, 8 )
# create some gaussian noise and add it to the symbols
noise  = wgn( length( symbols ), 10, "dBm", 1.0, true )
signal = symbols .+ noise

constellation = plot_constellation( signal )
setattr( constellation, title = "8-PSK Modulation" )

display( constellation )

FIR Filter Design With a Kaiser Window

See Examples/Kaiser.jl

using Radio, Winston

( M, Beta ) = kaiserord( 0.001, 0.2*π )
window = kaiser( M, Beta )
impulse = firdes( 0.5, window )
p = plot_response( impulseResponse )

display( p )

Download Details:

Author: JayKickliter
Source Code: https://github.com/JayKickliter/Radio.jl 
License: MIT license

#julia #radio #digital 

Radio.jl: A Native Julia Digital Communications Package
Hunter  Krajcik

Hunter Krajcik

1661262300

A Widget That Groups Radio Buttons So They Can Work together

Radio Group

A widget that groups radio buttons so they can work together to give the user a pleasant experience when making selections within the app.

A gif demonstrating the radio group in action.

Installation

In the pubspec.yaml of your flutter project, add the following dependency:

 radio_group_v2: ^1.0.2

Import it to each file you use it in:

 import 'package:radio_group_v2/radio_group_v2.dart';

Usage

Example 1

This example is a very basic, vertical radio group.

RadioGroupController myController = RadioGroupController();

RadioGroup(
  controller: myController,
  values: ["Choice1", "Choice2", "Choice3"],
)

Example 2

This example is a horizontal radio group with some decoration, and it starts with the first button selected.

RadioGroupController myController = RadioGroupController();

RadioGroup(
  controller: myController,
  values: ["Choice1", "Choice2", "Choice3"],
  indexOfDefault: 0,
  orientation: RadioGroupOrientation.Horizontal,
  decoration: RadioGroupDecoration(
    spacing: 10.0,
    labelStyle: TextStyle(
      color: Colors.blue,
    ),
    activeColor: Colors.amber,
  ),
)

Example 3

This example shows how to programmatically select an item using two different methods.

RadioGroupController myController = RadioGroupController();

List<String> items = ["Choice1", "Choice2", "Choice3"];

RadioGroup(
  controller: myController,
  values: items,
)

// Method 1 - Selects a specific item from the list.
myController.value = items[1];

// Method 2 - Selects whatever item is at the given
//            index in the list.
myController.selectAt(2);

Example 4

This example shows how to retrieve the selected value.

RadioGroupController myController = RadioGroupController();

RadioGroup(
  controller: myController,
  values: ["Choice1", "Choice2", "Choice3"],
)

String selected = myController.value.toString();

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add radio_group_v2

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

dependencies:
  radio_group_v2: ^1.0.2

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:radio_group_v2/radio_group_v2.dart';

example/lib/main.dart

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

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

/// This is how this example code will know if we are talking about the vertical
/// radio group example or the horizontal radio group example.
enum RadioGroupId {
  /// The vertical radio group example.
  Vertical,

  /// The horizontal radio group example.
  Horizontal,
}

class App extends StatefulWidget {
  @override
  _AppState createState() => _AppState();
}

class _AppState extends State<App> {
  /// The currently selected value of the vertical radio group.
  ///
  /// This one is obtained automatically, thanks to the onChange() method.
  String verticalValAutomatic = "";

  /// The currently selected value of the vertical radio group.
  ///
  /// This one is obtained by clicking the "Fetch Selected" button under the
  /// vertical radio group.
  String verticalValRequested = "";

  /// The currently selected value of the horizontal radio group.
  ///
  /// This one is obtained automatically, thanks to the onChange() method.
  String horizontalValAutomatic = "";

  /// The currently selected value of the horizontal radio group.
  ///
  /// This one is obtained by clicking the "Fetch Selected" button under the
  /// horizontal radio group.
  String horizontalValRequested = "";

  /// The controller for the vertical radio group.
  RadioGroupController verticalGroupController = RadioGroupController();

  /// The controller for the horizontal radio group.
  RadioGroupController horizontalGroupController = RadioGroupController();

  /// The values for the vertical radio group.
  final List<String> verticalValues = [
    "String 1",
    "String 2",
    "String 3",
    "String 4",
    "String 5",
  ];

  /// The values for the horizontal radio group.
  final List<Text> horizontalValues = [
    Text("Widget 1"),
    Text("Widget 2"),
    Text("Widget 3"),
    Text("Widget 4"),
    Text("Widget 5"),
  ];

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text("Radio Group"),
        ),
        body: SafeArea(
          child: SingleChildScrollView(
            child: Padding(
              padding: const EdgeInsets.all(25.0),
              child: Column(
                children: [
                  selectedValBoard(verticalValAutomatic, verticalValRequested),
                  IntrinsicWidth(
                    child: RadioGroup(
                      controller: verticalGroupController,
                      values: verticalValues,
                      onChanged: (newValue) => setState(() {
                        verticalValAutomatic = newValue.toString();
                      }),
                      decoration: RadioGroupDecoration(
                        labelStyle: TextStyle(
                          color: Colors.blue,
                          fontWeight: FontWeight.w800,
                        ),
                      ),
                    ),
                  ),
                  actionButtons(RadioGroupId.Vertical),
                  Divider(
                    height: 50.0,
                  ),
                  selectedValBoard(
                      horizontalValAutomatic, horizontalValRequested),
                  RadioGroup(
                    controller: horizontalGroupController,
                    values: horizontalValues,
                    orientation: RadioGroupOrientation.Horizontal,
                    indexOfDefault: 0,
                    onChanged: (newValue) => setState(() {
                      horizontalValAutomatic = newValue.toString();
                    }),
                  ),
                  actionButtons(RadioGroupId.Horizontal),
                ],
              ),
            ),
          ),
        ),
      ),
    );
  }

  /// This method builds the section at the top of each radio group that shows
  /// which button is selected.
  ///
  /// This shows of the ability to be able to get the selected value in two
  /// different ways.
  Padding selectedValBoard(String automatic, String requested) {
    return Padding(
      padding: const EdgeInsets.only(bottom: 12.5),
      child: Column(
        children: [
          Text("Selected Value"),
          IntrinsicHeight(
            child: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
              Expanded(
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.end,
                  children: [
                    Column(
                      children: [
                        Text("onChange():"),
                        Text(automatic),
                      ],
                    ),
                  ],
                ),
              ),
              VerticalDivider(
                color: Colors.black,
              ),
              Expanded(
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: [
                    Column(
                      children: [
                        Text("\"Fetch Selected\" btn:"),
                        Text(requested),
                      ],
                    ),
                  ],
                ),
              ),
            ]),
          )
        ],
      ),
    );
  }

  /// The buttons used to demo the radio groups.
  Padding actionButtons(RadioGroupId radioGroupId) {
    /// Make the buttons blue.
    ButtonStyle buttonStyle = ButtonStyle(
      backgroundColor: MaterialStateProperty.resolveWith(
        (states) => states.contains(MaterialState.pressed)
            ? Colors.blueAccent
            : Colors.blue,
      ),
      padding: MaterialStateProperty.all(
        EdgeInsets.symmetric(
          horizontal: 16,
          vertical: 8,
        ),
      ),
    );

    /// Make the button text white.
    TextStyle textStyle = TextStyle(
      color: Colors.white,
    );

    /// Either the [verticalGroupController] or the [horizontalGroupController]
    /// depending on which radio group we are working with at the moment.
    RadioGroupController radioGroupController;
    if (radioGroupId == RadioGroupId.Vertical) {
      radioGroupController = verticalGroupController;
    } else {
      radioGroupController = horizontalGroupController;
    }

    return Padding(
      padding: const EdgeInsets.only(top: 12.5),
      child: Column(
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              TextButton(
                onPressed: () {
                  radioGroupController.value = null;
                },
                child: Text(
                  "Select None",
                  style: textStyle,
                ),
                style: buttonStyle,
              ),
              SizedBox(
                width: 12.5,
              ),
              TextButton(
                onPressed: () {
                  if (radioGroupId == RadioGroupId.Vertical) {
                    radioGroupController.value = verticalValues.last;
                  } else {
                    radioGroupController.value = horizontalValues.last;
                  }
                },
                child: Text(
                  "Select Last",
                  style: textStyle,
                ),
                style: buttonStyle,
              ),
            ],
          ),
          SizedBox(
            height: 12.5,
          ),
          TextButton(
            onPressed: () {
              setState(() {
                if (radioGroupId == RadioGroupId.Vertical) {
                  verticalValRequested = radioGroupController.value.toString();
                } else {
                  horizontalValRequested =
                      radioGroupController.value.toString();
                }
              });
            },
            child: Text(
              "Fetch Selected",
              style: textStyle,
            ),
            style: buttonStyle,
          ),
        ],
      ),
    );
  }
}

Download Details:

Author: Babincc
Source Code: https://github.com/babincc/flutter_workshop/ 
License: MIT

#flutter #dart #radio 

A Widget That Groups Radio Buttons So They Can Work together

A Flutter Package for New Radio Button Design

A Flutter package for new radio button design. With Elegant Animation.

Features

Screenshot 2021-11-26 115045 Screenshot 2021-11-26 115126 Screenshot 2021-11-26 115022

Usage

TODO: Include short and useful examples for package users. Add longer examples to /example folder.

              ElegantRadioButton<int>(
                groupValue: 1,
                value: 1,
                onChanged: (value) {
                  setState(() {
                    selectedValue = value;
                  });
                },
                fillColor: MaterialStateProperty.all(Colors.red),
              );

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add elegant_radio_button_group

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

dependencies:
  elegant_radio_button_group: ^0.0.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:elegant_radio_button_group/elegant_radio_button_group.dart'; 

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Elegant Radio button group pacakge expample',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

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

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

class _MyHomePageState extends State<MyHomePage> {
  late int? selectedValue;
  @override
  void initState() {
    super.initState();
    selectedValue = 1;
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: SafeArea(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            ListTile(
              leading: ElegantRadioButton<int>(
                groupValue: selectedValue,
                value: 1,
                onChanged: (value) {
                  setState(() {
                    selectedValue = value;
                  });
                },
                fillColor: MaterialStateProperty.all(Colors.red),
              ),
              title: const Text('Radio button 1'),
            ),
            ListTile(
              leading: ElegantRadioButton<int>(
                groupValue: selectedValue,
                value: 2,
                onChanged: (value) {
                  setState(() {
                    selectedValue = value;
                  });
                },
                fillColor: MaterialStateProperty.all(const Color(0xFFFF9494)),
              ),
              title: const Text('Radio button 2'),
            ),
            ListTile(
              leading: ElegantRadioButton<int>(
                groupValue: selectedValue,
                value: 3,
                onChanged: (value) {
                  setState(() {
                    selectedValue = value;
                  });
                },
                fillColor: MaterialStateProperty.all(const Color(0xFFFFDCDC)),
              ),
              title: const Text('Radio button 3'),
            ),
          ],
        ),
      ),
    );
  }
} 

Download Details:

Author: AymBch

Source Code: https://github.com/AymBch/elegant_radio_button_group

#radio #flutter #android 

A Flutter Package for New Radio Button Design
Hunter  Krajcik

Hunter Krajcik

1658719080

Radio_player: A Flutter Plugin to Play Streaming Audio Content

Radio Player

A Flutter plugin to play streaming audio content with background support and lock screen controls.  

Installation

To use this package, add radio_player as a dependency in your pubspec.yaml file.

dependencies:
  radio_player: ^0.6.0

By default iOS forbids loading from non-https url. To cancel this restriction edit your .plist and add:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

If necessary, add permissions to play in the background:

<key>UIBackgroundModes</key>
<array>
    <string>audio</string>
    <string>processing</string>
</array>

Usage

To create RadioPlayer instance, simply call the constructor.

RadioPlayer radioPlayer = RadioPlayer();

Configure it with your data.

radioPlayer.setChannel(title: TITLE, url: URL, imagePath: IMAGEPATH?);

Player Controls

radioPlayer.play();
radioPlayer.pause();

State Event

You can use it to show if player playing or paused.

bool isPlaying = false;
//...
radioPlayer.stateStream.listen((value) {
    setState(() { isPlaying = value; });
});

Metadata Event

This Event returns the current metadata.

List<String>? metadata;
//...
radioPlayer.metadataStream.listen((value) {
    setState(() { metadata = value; });
});

Image from metadata can be retrieved using getArtworkImage()

Installing

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add radio_player

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

dependencies:
  radio_player: ^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:radio_player/radio_player.dart';

example/lib/main.dart

/*
 *  main.dart
 *
 *  Created by Ilya Chirkunov <xc@yar.net> on 28.12.2020.
 */

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

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  RadioPlayer _radioPlayer = RadioPlayer();
  bool isPlaying = false;
  List<String>? metadata;

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

  void initRadioPlayer() {
    _radioPlayer.setChannel(
      title: 'Radio Player',
      url: 'http://stream-uk1.radioparadise.com/aac-320',
      imagePath: 'assets/cover.jpg',
    );

    _radioPlayer.stateStream.listen((value) {
      setState(() {
        isPlaying = value;
      });
    });

    _radioPlayer.metadataStream.listen((value) {
      setState(() {
        metadata = value;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          centerTitle: true,
          title: const Text('Radio Player'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              FutureBuilder(
                future: _radioPlayer.getArtworkImage(),
                builder: (BuildContext context, AsyncSnapshot snapshot) {
                  Image artwork;
                  if (snapshot.hasData) {
                    artwork = snapshot.data;
                  } else {
                    artwork = Image.asset(
                      'assets/cover.jpg',
                      fit: BoxFit.cover,
                    );
                  }
                  return Container(
                    height: 180,
                    width: 180,
                    child: ClipRRect(
                      child: artwork,
                      borderRadius: BorderRadius.circular(10.0),
                    ),
                  );
                },
              ),
              SizedBox(height: 20),
              Text(
                metadata?[0] ?? 'Metadata',
                softWrap: false,
                overflow: TextOverflow.fade,
                style: TextStyle(fontWeight: FontWeight.bold, fontSize: 24),
              ),
              Text(
                metadata?[1] ?? '',
                softWrap: false,
                overflow: TextOverflow.fade,
                style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
              ),
              SizedBox(height: 20),
            ],
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            isPlaying ? _radioPlayer.pause() : _radioPlayer.play();
          },
          tooltip: 'Control button',
          child: Icon(
            isPlaying ? Icons.pause_rounded : Icons.play_arrow_rounded,
          ),
        ),
      ),
    );
  }
}

Requirements

  • iOS: SDK 10.0 (or later)
  • Android: API Level 23 (or later)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

Author: Cheebeez
Source Code: https://github.com/cheebeez/radio_player 
License: MIT license

#flutter #dart #radio

Radio_player: A Flutter Plugin to Play Streaming Audio Content

A Stepped Slider with Radio Buttons for Flutter

flutter_radio_slider

A stepped slider implementation using radio buttons for Flutter.

Example Plugin Walkthrough

Features and bugs

Please file feature requests and bugs at the issue tracker.

License

Licensed under the terms of the Apache 2.0 license, the full version of which can be found in the LICENSE file included in the distribution.

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add flutter_radio_slider

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

dependencies:
  flutter_radio_slider: ^0.1.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_radio_slider/flutter_radio_slider.dart'; 

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final themeData = SliderTheme.of(context).copyWith(
        trackHeight: 10,
        overlayColor: Colors.lightGreen.withAlpha(32),
        activeTickMarkColor: Colors.lightGreen,
        activeTrackColor: Colors.grey[300],
        inactiveTrackColor: Colors.grey[300],
        inactiveTickMarkColor: Colors.grey[500]);

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('RadioSlider Example'),
        ),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.spaceEvenly,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Text("Horizontal with Divisions - Inner circle only"),
            SliderTheme(
              data: themeData,
              child: RadioSlider(
                onChanged: (value) {
                  // Do something
                },
                value: 3,
                divisions: 5,
                outerCircle: false,
              ),
            ),
            Divider(),
            Text("Default"),
            RadioSlider(
              activeColor: Colors.blue,
              onChanged: (value) {/* no-op */},
            ),
            Divider(),
            Text("Vertical Orientation"),
            SliderTheme(
              data: themeData,
              child: RadioSlider(
                orientation: RadioSliderOrientation.Vertical,
                onChanged: (value) {
                  print("Value changed: ${value.toString()}");
                },
              ),
            ),
          ],
        ),
      ),
    );
  }
} 

Download Details:

Author: adaptant-labs

Source Code: https://github.com/adaptant-labs/flutter_radio_slider

#slider #flutter #radio 

A Stepped Slider with Radio Buttons for Flutter

Flutter Radio Plugin Handles A Single Streaming Audio Preciously

Flutter radio plugin handles a single streaming media preciously. This plugin was developed with maximum usage in mind. Flutter Radio player enables Streaming audio content on both Android and iOS natively, as an added feature this plugin supports background music play as well. This plugin also integrate deeply with both core media capabilities such as MediaSession on Android and RemoteControl capabilities (Control Center) on iOS. This plugin also support controlling the player via both wearOS and WatchOS.

Features

  • Supports both android and ios
  • Supports background music playing
  • Integrates well with watchOS and WearOS.
  • Handles network interruptions.
  • Reactive
  • Developer friendly (Logs are placed though out the codebase, so it's easy to trace a bug)

Reactivity ?

Unlike any other Music Playing plugin Flutter Radio Player is very reactive. It communicates with the native layer using Event and Streams, this making the plugin very reactive to both Application (Flutter) side and the native side.

Plugin events

This plugin utilises Android LocalBroadcaster and iOS Notification center for pushing out events. Names of the events are listed below.

  • flutter_radio_playing
  • flutter_radio_paused
  • flutter_radio_stopped
  • flutter_radio_error
  • flutter_radio_loading

Getting Started

  1. Add this to your package's pubspec.yaml file
dependencies:
  flutter_radio_player: ^1.X.X
  1. Install it
$ flutter pub get
  1. Import it
import 'package:flutter_radio_player/flutter_radio_player.dart';
  1. Configure it Creat a new instance of the player. An FlutterRadioPlayer instance can play a single audio stream at a time. To create it, simply call the constructor. However DO NOT make multiple instances of the service as FRP is using a FOREGROUND SERVICE to keep itself live when you minimize the application in Android.
FlutterRadioPlayer _flutterRadioPlayer = new FlutterRadioPlayer();

When you have an FRP instance you may simply call the init method to invoke the platform specific player preparation. For the API please reffer FRP API.

await _flutterRadioPlayer.init("Flutter Radio Example", "Live", "URL_HERE", "true");

After player preparation you may simply call playOrPause method to toggle audio stream.

await _flutterRadioPlayer.playOrPause();

FRP does allow you to change the URL after player initialized. You can simply change the stream url by calling setUrl on FRP object.

await _flutterRadioPlayer.setUrl('URL_HERE', "false");

calling above method will cause the existing URL to pause and play the newly set URL. Please refer the FRP API for api documentation.

Besides above mentioned method, below are the methods that FRP exposes.

  • stop() - Will stop all the streaming audio streams and detaches itself from FOREGROUND SERVICE. You need to reinitialize to use the plugin again,
await _flutterRadioPlayer.stop()
  • start() - Will start the audio stream using the initialized object.
await _flutterRadioPlayer.start()
  • pause() - Will pause the audio stream using the initialized object.
await _flutterRadioPlayer.pause()

Now that's not all. This plugin handles almost everything for you when it comes to playing a single stream of audio. From Player meta details to network interruptions, FRP handles it all with a sweat. Please refer the example to get an idea about what FRP can do.

iOS and Android Support

If the plugin is failing to initiate, kindly make sure your permission for background processes are given for your application

For your Android application you might want to add permissions in AndroidManifest.xml. This is already added for in the library level.

    <!--  Permissions for the plugin  -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.INTERNET" />

    <!--  Services for the plugin  -->
    <application android:usesCleartextTraffic="true">
        <service android:name=".core.StreamingCore"/>
    </application>

For your iOS application you need to enable it like this

xcode image

Support

Please hit a like to plugin on pub if you used it and love it. put a ⭐️ my GitHub repo and show me some ♥️ so i can keep working on this.

Found a bug ?

Please feel free to throw in a pull request. Any support is warmly welcome.

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add flutter_radio_player

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

dependencies:
  flutter_radio_player: ^1.1.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_radio_player/flutter_radio_player.dart'; 

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_radio_player/flutter_radio_player.dart';

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

class MyApp extends StatefulWidget {
  final playerState = FlutterRadioPlayer.flutter_radio_paused;

  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  int _currentIndex = 0;
  double volume = 0.8;
  FlutterRadioPlayer _flutterRadioPlayer = new FlutterRadioPlayer();

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

  Future<void> initRadioService() async {
    try {
      await _flutterRadioPlayer.init(
        "Flutter Radio Example",
        "Live",
        "http://209.133.216.3:7018/stream?type=http&nocache=1906",
        "false",
      );
    } on PlatformException {
      print("Exception occurred while trying to register the services.");
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Flutter Radio Player Example'),
        ),
        body: Center(
          child: Column(
            children: <Widget>[
              StreamBuilder(
                stream: _flutterRadioPlayer.isPlayingStream,
                initialData: widget.playerState,
                builder:
                    (BuildContext context, AsyncSnapshot<String> snapshot) {
                  String returnData = snapshot.data;
                  print("object data: " + returnData);
                  switch (returnData) {
                    case FlutterRadioPlayer.flutter_radio_stopped:
                      return ElevatedButton(
                        style: ElevatedButton.styleFrom(),
                        child: Text("Start listening now"),
                        onPressed: () async {
                          await initRadioService();
                        },
                      );
                      break;
                    case FlutterRadioPlayer.flutter_radio_loading:
                      return Text("Loading stream...");
                    case FlutterRadioPlayer.flutter_radio_error:
                      return ElevatedButton(
                        style: ElevatedButton.styleFrom(),
                        child: Text("Retry ?"),
                        onPressed: () async {
                          await initRadioService();
                        },
                      );
                      break;
                    default:
                      return Row(
                        crossAxisAlignment: CrossAxisAlignment.center,
                        mainAxisAlignment: MainAxisAlignment.center,
                        children: <Widget>[
                          IconButton(
                            onPressed: () async {
                              print("button press data: " +
                                  snapshot.data.toString());
                              await _flutterRadioPlayer.playOrPause();
                            },
                            icon: snapshot.data ==
                                    FlutterRadioPlayer.flutter_radio_playing
                                ? Icon(Icons.pause)
                                : Icon(Icons.play_arrow),
                          ),
                          IconButton(
                            onPressed: () async {
                              await _flutterRadioPlayer.stop();
                            },
                            icon: Icon(Icons.stop),
                          )
                        ],
                      );
                      break;
                  }
                },
              ),
              Slider(
                value: volume,
                min: 0,
                max: 1.0,
                onChanged: (value) => setState(
                  () {
                    volume = value;
                    _flutterRadioPlayer.setVolume(volume);
                  },
                ),
              ),
              Text(
                "Volume: " + (volume * 100).toStringAsFixed(0),
              ),
              SizedBox(
                height: 15,
              ),
              Text("Metadata Track "),
              StreamBuilder<String>(
                initialData: "",
                stream: _flutterRadioPlayer.metaDataStream,
                builder: (context, snapshot) {
                  return Text(snapshot.data);
                },
              ),
              ElevatedButton(
                style: ElevatedButton.styleFrom(),
                child: Text("Change URL"),
                onPressed: () async {
                  _flutterRadioPlayer.setUrl(
                    "http://209.133.216.3:7018/;stream.mp3",
                    "false",
                  );
                },
              )
            ],
          ),
        ),
        bottomNavigationBar: new BottomNavigationBar(
          currentIndex: this._currentIndex,
          onTap: (int index) {
            setState(() {
              _currentIndex = index;
            });
          },
          items: [
            BottomNavigationBarItem(
              icon: new Icon(Icons.home),
              label: "Home",
            ),
            BottomNavigationBarItem(
              icon: new Icon(Icons.pages),
              label: "Second Page",
            )
          ],
        ),
      ),
    );
  }
}

Download Details:

Author: Sithira

Source Code: https://github.com/Sithira/FlutterRadioPlayer

#flutter #audio #radio 

Flutter Radio Plugin Handles A Single Streaming Audio Preciously

A Flutter Package Whitch Contains Grouped Buttons Like Radio Buttons

flutter_group_button

A flutter package which contains basics grouped buttons like radio buttons and checkboxes

VERSION

[1.0.1]

Table of content

Getting start

To use this package, add flutter_group_button^[version] as a dependency in your pubspec.yaml file

dependencies:
  flutter_group_button: ^1.0.1

Fast Overview

Make sure that dependencie is add to your pubsec.yaml file.

RadioGroup Overview

    RadioGroup(
                  children: [
                    Text("Choice 1"),
                    Text("Choice 2"),
                    Text("Choice 3")
                  ],
                    /// no default selected item
                  defaultSelectedItem: -1,
                  onSelectionChanged: (selection) {
                    /// print the index of the selected item
                    print(selection);
                  })

CheckBoxGroup Overview

    CheckboxGroup(
                  child: {
                    Text("Choice 1"): false,
                    Text("Choice 2"): true,
                    Text("Choice 3"): false
                  },
                  ///  
                  onNewChecked: (l) {
                    /// print a list of the checked item name
                    print(l);
                  })

General info

Illustration

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

RadioGroup

The RadioGroup has many arguments for more flexibility which are optional. You can implements theme for your needs. Important to know that both the radio button and the radio's label are clickable

RadioGroup parameters list

 groupItemsAlignment,
 onSelectionChanged,
 defaultSelectedItem = 0,
 children,
 textBeforeRadio = true,
 padding = const EdgeInsets.all(0),
 margin = const EdgeInsets.all(0),
 activeColor,
 focusColor,
 hoverColor,
 textBelowRadio = true,
 priority = RadioPriority.textBeforeRadio,
 mainAxisAlignment = MainAxisAlignment.start,
 internMainAxisAlignment = MainAxisAlignment.start,
 

RadioGroup parameters details

(@Required) means that the argument is required by the Widget to work properly

Important to know there is only 3 required parameters for RadioGroup to work
they are:
    groupItemsAlignment,
    children,
    onSelectionChanged,

(@Optional) means that the argument is not required by the RadioGroup to work

(@Required)

groupItemsAlignment

The alignment of the RadioGroup Items. It can be GroupItemsAlignment.row for row alignment or GroupItemsAlignment.column for column alignment. Note that according to its value and the parent of the RadioGroup, you will have to play with both mainAxisAlignment and internalMainAxisAlignment to make the RadioGroup be at the right place

(@Required)

children

The item or the list of the items label of the RadioGroup. You can pass any widget or list of widget you want but It's good to pass a Text widget or a list of Text widget like shown
here. Note that you can add a Style to the Text or use any widget you want.

(@Required)

onSelectionChanged

Callback called when the selected item changed it returns the index of the selected radio button. Note that the index start at 0.

(@Optional)

defaultSelectedItem

(int): Is the default item to select for the RadioGroup. By default the first item is selected. Note that the index begin at 0. If you don't want any item to be selected, just give a negative value to it.

(@Optional)

padding

(EdgeInsetsGeometry): Empty space to inscribe inside the RadioGroup.

(@Optional)

textBeforeRadio

(bool) which tells if the items label must come before or after the radio button. By default it's set to true. if you want the opposite, just set it to false

(@Optional)

textBelowRadio

(bool): which tells if the item's label must be below or above the Radio. By default, it's set to true. If you want the opposite, just set it to false. One thing to take in consideration, the item's label can not be before and below the radio at the same time. it can only be (before of after the radio button depending on the textBeforeRadio's value) or (below or above the radio button depending on the textBelowRadio's value), so there is a priority to respect.

(@Optional)

priority

(RadioPriority) which tells if the [textBeforeRadio] is important or not than [textBelowRadio]. it can take two values (RadioPriority.textBeforeRadio or RadioPriority.textBelowRadio). By default, textBeforeRadio is important than textBelowRadio

(@Optional)

margin

(EdgeInsetsGeometry) Empty space to surround the the RadioGroup items.

(@Optional)

mainAxisAlignment)

(MainAxisAlignment) The main axis alignment of the RadioGroup. Depending on the container of the RadioGroup parent, you could need it or not.

(@Optional)

internMainAxisAlignment

(MainAxisAlignment): the internal axis alignment of the RadioGroup. You can control the main axis alignment of the radio button and its label. Depending on the RadioGroup parent, you can have to play with both mainAxisAlignment and this internalRadioAxisAlignment

(@Optional)

focusColor

(Color): The color for the radio's [Material] when it has the input focus.

(@Optional)

hoverColor;

(Color): The color for the radio's [Material] when a pointer is hovering over it.

(@Optional)

activeColor

(Color): The color to use when this radio button is selected. Defaults to [ThemeData.toggleableActiveColor].

Short illustration

  import 'package:flutter_group_button/flutter_group_button';  
   
 
  RadioGroup(
              children: [
                Text("Choice 1"),
                Text("Choice 2"),
                /// fell free to add a textStyle or change the Text to Cupertino
                /// Text widget
                Text("Choice 3")
              ],
              //to indicate that there is no default selected item
              defaultSelectedItem: -1,
              onSelectionChanged: (selection) {
                print(selection);
              })

This is the result of the code above

CheckboxGroup

The CheckboxGroup has many arguments for more flexibility which are optional. You can implements theme for your needs. Important to know that both the checkbox button and the checkbox's label are clickable

CheckBoxGroup parameters list

child,
onNewChecked,
activeColor,
focusColor,
hoverColor,
checkColor,
priority = CheckboxPriority.textBeforeCheckbox,
groupItemsAlignment,
padding = const EdgeInsets.all(0),
margin = const EdgeInsets.all(0),
textBeforeCheckbox = true,
textBelowCheckBox = true,
mainAxisAlignment = MainAxisAlignment.start,
internMainAxisAlignment = MainAxisAlignment.start,

Checkbox parameters details

(@Required) means that the argument is required by the Widget to work properly

Important to know, there is only 3 required parameters for CheckboxGroup to work.
They are : 
    groupItemsAlignment,
    child,
    onNewChecked,

(@Optional) means that the argument is not required by the Widget to work

groupItemsAlignment (@Required);

(GroupItemsAlignment): The alignment of the CheckboxGroup Items. It can be GroupItemsAlignment.row for row alignment or GroupItemsAlignment.column for column alignment. Note that according to its value and the parent of the RadioGroup, you will have to play with both mainAxisAlignment and internalRadioAxisAlignment to make the RadioGroup be right place

child (@Required)

(Map<Text, bool)): The items of the CheckboxGroup.
here is short illustration. Note that you can add a Style to the Text.

onNewChecked (@Required)

A callback to notify that a new check box is checked Return a list of checked items. Note That only the item's label (String) is returned

padding (@Optional);

(EdgeInsetsGeometry): Empty space to inscribe inside the CheckboxGroup.

textBeforeCheckbox (@Optional)

(bool): tells if the items label must come before or after the checkbox. By default it's set to true. if you want the opposite, just set it to false

textBelowCheckbox (@Optional);

(bool): tells if the item's label must be below or above the checkbox. By default, it's set to true. If you want the opposite, just set it to false. One thing to take in consideration, the item's label can not be before and below the checkbox at the same time. it can only be (before of after the checkbox depending on the textBeforeCheckbox's value) or (below or above the checkbox depending on the textBelowCheckbox's value), so there is a priority to respect.

priority (@Optional)

(CheckboxPriority): tells if the [textBeforeCheckbox] is important or not than [textBelowCheckbox]. it can take two values (CheckboxPriority.textBeforeCheckbox or CheckboxPriority.textBelowCkeckbox). By default, textBeforeCheckbox is important than textBelowCheckbox

margin (@Optional)

(EdgeInsetsGeometry): Empty space to surround the the RadioGroup items.

mainAxisAlignment (@Optional)

(MainAxisAlignment): The main axis alignment of the CheckboxGroup. Depending on the container of the CheckboxGroup parent, you could need it or not.

internMainAxisAlignment (@Optional)

(MainAxisAlignment): the internal axis alignment of the CheckboxGroup. You can control the main axis alignment of the checkbox and its label. Depending on the CheckboxGroup parent, you can have to play with both mainAxisAlignment and this internalRadioAxisAlignment

focusColor (@Optional)

(Color): The color for the checkbox's [Material] when it has the input focus.

hoverColor (@Optional)

(Color): The color for the checkbox's [Material] when a pointer is hovering over it.

activeColor (@Optional)

(Color): The color to use when the checkbox is checked. Defaults to [ThemeData.toggleableActiveColor].

checkColor (@Optional)

Color) The color to use for the check icon when this checkbox is checked. Defaults to Color(0xFFFFFFFF)

Checkbox short illustration

 Center(
          child: CheckboxGroup(
              child: {
                Text("Choice 1"): false,
                Text("Choice 2"): true,
                Text("Choice 3"): false
              },
              groupItemsAlignment: GroupItemsAlignment.column,
              mainAxisAlignment: MainAxisAlignment.center,
              internMainAxisAlignment: MainAxisAlignment.center,
              priority: CheckboxPriority.textBeforeCheckbox,
              onNewChecked: (l) {
                print(l);
              })
      ),

This is the result of the code above

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add flutter_group_button

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

dependencies:
  flutter_group_button: ^1.0.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:flutter_group_button/flutter_group_button.dart'; 

example/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter group button demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'RadioGroup demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, this.title}) : super(key: key);
  final String? title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title!),
      ),
      body: Column(
        children: [
          Center(
              child: RadioGroup(
                  children: [
                    Text("Choice 1"),
                    Text("Choice 2"),
                    /// fell free to add a textStyle or change the Text to Cupertino
                    /// Text widget
                    Text("Choice 3")
                  ],
                  groupItemsAlignment: GroupItemsAlignment.column,
                  mainAxisAlignment: MainAxisAlignment.center,
                  internMainAxisAlignment: MainAxisAlignment.center,
                  /// In reality this is not needed
                  priority: RadioPriority.textBeforeRadio,
                  defaultSelectedItem: -1,
                  onSelectionChanged: (selection) {
                    print(selection);
                  })
          ),

          Center(
              child: CheckboxGroup(
                  child: {
                    Text("Choice 1"): false,
                    Text("Choice 2"): true,
                    Text("Choice 3"): false
                  },
                  onNewChecked: (l) {
                    print(l);
                  })
          ),
        ],
      ),
    );
  }
} 

Download Details:

Author: stMerlHin

Source Code: https://github.com/stMerlHin/flutter_group_button

#flutter #radio #button 

A Flutter Package Whitch Contains Grouped Buttons Like Radio Buttons

Custom Flutter widgets that makes Checkbox and Radio Buttons

custom_radio_grouped_button

Custom Radio Buttons and Grouped Check Box Button

Custom Flutter widgets that makes Checkbox and Radio Buttons much cleaner and easier

Breaking Changes:

From Version 1.0.2

buttonColor is now unSelectedColor

Installing

Add the following to your pubspec.yaml file:

dependencies:
  custom_radio_grouped_button: any

Creating Radio Button

CustomRadioButton(
  elevation: 0,
  absoluteZeroSpacing: true,
  unSelectedColor: Theme.of(context).canvasColor,
  buttonLables: [
    'Student',
    'Parent',
    'Teacher',
  ],
  buttonValues: [
    "STUDENT",
    "PARENT",
    "TEACHER",
  ],
  buttonTextStyle: ButtonTextStyle(
      selectedColor: Colors.white,
      unSelectedColor: Colors.black,
      textStyle: TextStyle(fontSize: 16)),
  radioButtonValue: (value) {
    print(value);
  },
  selectedColor: Theme.of(context).accentColor,
),

Creating Grouped Button

CustomCheckBoxGroup(
  buttonTextStyle: ButtonTextStyle(
    selectedColor: Colors.red,
    unSelectedColor: Colors.orange,
    textStyle: TextStyle(
      fontSize: 16,
    ),
  ),
  unSelectedColor: Theme.of(context).canvasColor,
  buttonLables: [
    "M",
    "T",
    "W",
    "T",
    "F",
    "S",
    "S",
  ],
  buttonValuesList: [
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday",
    "Sunday",
  ],
  checkBoxButtonValues: (values) {
    print(values);
  },
  spacing: 0,
  defaultSelected: "Monday",
  horizontal: false,
  enableButtonWrap: false,
  width: 40,
  absoluteZeroSpacing: false,
  selectedColor: Theme.of(context).accentColor,
  padding: 10, 
);

Screenshots

Grouped ButtonGrouped Button

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add custom_radio_grouped_button

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

dependencies:
  custom_radio_grouped_button: ^2.1.1

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

Import it

Now in your Dart code, you can use:

import 'package:custom_radio_grouped_button/custom_radio_grouped_button.dart'; 

example/lib/main.dart

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

import './RadioButtonPage.dart';

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

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

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Grouped Button Example'),
        centerTitle: true,
      ),
      floatingActionButton: FloatingActionButton.extended(
        label: Text('Radio Button'),
        onPressed: () {
          Navigator.push(
              context, MaterialPageRoute(builder: (context) => RadioButton()));
        },
        icon: Icon(Icons.radio_button_checked),
      ),
      body: Container(
        child: ListView(
          children: <Widget>[
            SizedBox(
              height: 10,
            ),
            Text(
              'Horizontal',
              textAlign: TextAlign.center,
              style: TextStyle(fontSize: 20),
            ),
            SizedBox(
              height: 10,
            ),
            Row(
              children: <Widget>[
                Expanded(
                  child: Column(
                    children: <Widget>[
                      SizedBox(
                        height: 10,
                      ),
                      Text(
                        'Shape Disabled',
                        style: TextStyle(fontSize: 15),
                      ),
                      SizedBox(
                        height: 10,
                      ),
                      CustomCheckBoxGroup(
                        unSelectedColor: Theme.of(context).canvasColor,
                        buttonLables: [
                          "Monday",
                          "Tuesday",
                          "Wednesday",
                          "Thursday",
                        ],
                        buttonValuesList: [
                          "Monday",
                          "Tuesday",
                          "Wednesday",
                          "Thursday",
                        ],
                        checkBoxButtonValues: (values) {
                          print(values);
                        },
                        defaultSelected: ["Monday"],
                        horizontal: true,
                        width: 120,
                        // hight: 50,
                        selectedColor: Theme.of(context).colorScheme.secondary,
                        padding: 5,
                        spacing: 0.0,
                        // enableShape: true,
                      ),
                    ],
                  ),
                ),
                Expanded(
                  child: Column(
                    children: <Widget>[
                      SizedBox(
                        height: 10,
                      ),
                      Text(
                        'Shape Enabled',
                        style: TextStyle(fontSize: 15),
                      ),
                      SizedBox(
                        height: 10,
                      ),
                      CustomCheckBoxGroup(
                        unSelectedColor: Theme.of(context).canvasColor,
                        buttonLables: [
                          "Thursday",
                          "Friday",
                          "Saturday",
                          "Sunday",
                        ],
                        buttonValuesList: [
                          "Thursday",
                          "Friday",
                          "Saturday",
                          "Sunday",
                        ],
                        checkBoxButtonValues: (values) {
                          print(values);
                        },
                        defaultSelected: ["Sunday"],
                        horizontal: true,
                        width: 120,
                        // hight: 50,
                        selectedColor: Theme.of(context).accentColor,
                        padding: 5,
                        enableShape: true,
                      ),
                    ],
                  ),
                ),
              ],
            ),
            SizedBox(
              height: 10,
            ),
            Text(
              'Verticle',
              textAlign: TextAlign.center,
              style: TextStyle(fontSize: 20),
            ),
            SizedBox(
              height: 10,
            ),
            Column(
              children: <Widget>[
                Column(
                  children: <Widget>[
                    SizedBox(
                      height: 10,
                    ),
                    Text(
                      'Shape Disabled',
                      style: TextStyle(fontSize: 15),
                    ),
                    SizedBox(
                      height: 10,
                    ),
                    CustomCheckBoxGroup(
                      buttonTextStyle: ButtonTextStyle(
                        selectedColor: Colors.red,
                        unSelectedColor: Colors.orange,
                        textStyle:
                            TextStyle(fontSize: 16, color: Colors.pinkAccent),
                      ),
                      unSelectedColor: Theme.of(context).canvasColor,
                      buttonLables: [
                        "M",
                        "T",
                        "W",
                        "T",
                        "F",
                        "S",
                        "S",
                      ],
                      buttonValuesList: [
                        "Monday",
                        "Tuesday",
                        "Wednesday",
                        "Thursday",
                        "Friday",
                        "Saturday",
                        "Sunday",
                      ],
                      checkBoxButtonValues: (values) {
                        print(values);
                      },
                      spacing: 0,
                      defaultSelected: ["Monday"],
                      horizontal: false,
                      enableButtonWrap: false,
                      width: 40,
                      absoluteZeroSpacing: false,
                      selectedColor: Theme.of(context).accentColor,
                      padding: 10,
                      // enableShape: true,
                    ),
                  ],
                ),
                Column(
                  children: <Widget>[
                    SizedBox(
                      height: 10,
                    ),
                    Text(
                      'Shape Enabled and Wrap enabled',
                      style: TextStyle(fontSize: 15),
                    ),
                    SizedBox(
                      height: 10,
                    ),
                    CustomCheckBoxGroup(
                      buttonTextStyle: ButtonTextStyle(
                        selectedColor: Colors.white,
                        unSelectedColor: Colors.black,
                        textStyle: TextStyle(
                          fontSize: 16,
                        ),
                      ),
                      autoWidth: false,
                      enableButtonWrap: true,
                      wrapAlignment: WrapAlignment.center,
                      unSelectedColor: Theme.of(context).canvasColor,
                      buttonLables: [
                        "Monday",
                        "Tuesday",
                        "Wednesday",
                        "Thursday",
                        "Friday",
                        "Saturday",
                        "Sunday",
                      ],
                      buttonValuesList: [
                        "Monday",
                        "Tuesday",
                        "Wednesday",
                        "Thursday",
                        "Friday",
                        "Saturday",
                        "Sunday",
                      ],
                      checkBoxButtonValues: (values) {
                        print(values);
                      },
                      defaultSelected: ["Sunday"],
                      horizontal: false,
                      width: 120,
                      // hight: 50,
                      selectedColor: Theme.of(context).accentColor,
                      padding: 5,
                      enableShape: true,
                    ),
                  ],
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
} 

Download Details:

Author: ketanchoyal

Source Code: https://github.com/ketanchoyal/custom_radio_grouped_button

#flutter  #radio  #button 

Custom Flutter widgets that makes Checkbox and Radio Buttons

Anatole Lionel

1622017563

Internet radio online - Alle Deutschen Radiosender!

Internet radio, sometimes known as web radio deutschland, is an online digital music service transmitted over the Internet using the Internet’s bandwidth. Webcasting on the Internet is generally described as webcasting because it isn’t transmitted widely over traditional broadcast ways. It can be transmitted as a continuous streaming feed or as a delayed response, where each radio show or music track that is played is given a time that it will play. The latter method is used to give the listener a chance to skip past commercials or other signal interference. Many listeners also enjoy webcasting music because it’s easier to find and listen to songs that are similar to or popular among other listeners.

With the introduction of internet radio stations, the opportunities for consumers to hear radio online music has dramatically increased. Instead of being limited to local commercial radio stations or radio networks that play just a few options, internet radio stations offer a much broader selection of music and programming. And while listeners do need to purchase a subscription to watch online radio stations, it’s typically a one-time cost rather than monthly payment that makes online radio stations a much more appealing option.

Online radio stations offer a wide variety of musical genres including jazz, soul, hip hop, alternative, country, classical, reggae, and other music-oriented genres. As a result, there are many radio stations online that cater to listeners who enjoy listening to a wide variety of music. This gives internet users the opportunity to stumble across a song they enjoy listening to it at the same time. Most listeners like to have the option to rewind a song they’ve recently listened to so they can listen again to a portion that they found less interesting. There are also several other features that make online radio stations appealing to listeners, including the ability to interact with other radio subscribers and interact with the featured artist or band.

#radio #internetradiohoren #internetradiohoren.de

Internet radio online - Alle Deutschen Radiosender!

radio french

1622017107

Radio en direct - Écouter radio en ligne | RadioFrench

Vous êtes-vous déjà retrouvé en vouloir la bonne vieille radio? Je veux dire vraiment la seule chose meilleure que d’avoir cette tasse de café parfaite le matin ou si une siffle sur ce chocolat chaud parfait lorsque vous regardez votre programme de télévision préféré. Il satisfait vraiment le besoin de quelque chose de doux et de quelque chose de vivant. Eh bien, la plupart des gens conviendront que la radio audience n’est tout simplement pas la même que de regarder une émission de télévision en direct. Il y a quelque chose à propos de regarder un programme tout en écoutant la radio qui vous fait sentir à l’aise et qui vous fait sentir une partie de l’action. Il est similaire lorsque vous lisez des articles en ligne ou même bavarder avec des amis sur un canal écouter la radio

Il existe de nombreux avantages associés à l’écoute de la radio en direct plutôt que de l’enregistrer sur votre ordinateur et de le transférer sur votre lecteur MP3 ou de le télécharger sur Internet. L’un d’entre eux est certainement le sentiment d’appartenance à l’événement que vous écoutez; Il est bon d’entendre tout le temps mais de fin de ligne, toutes ces choses viennent à un prix.

Pour commencer, nous discuterons du coût d’enregistrement des programmes de radio. Le fait est que, à moins que vous ne soyez dans l’industrie de la radiodiffusion et que vous faites une somme d’argent très bien rangée en faisant ce genre de travail, vous avez probablement un budget mensuel pour vos émissions de radio. De la même manière que les téléspectateurs de télévision réguliers s’abonnent à des chaînes et aux films de paiement spécifiques, les passionnés de radio paient des frais pour entendre les différents programmes de radio. Ceci est définitivement plus coûteux car les stations de radio doivent généralement acheter l’équipement que vous utilisez (un ensemble d’écouteurs, écouteurs, émetteur radio radio-satellite et récepteur, microphone, etc.) et payez également le fournisseur Internet pour transporter leurs ondes radio Enfin, vous devrez payer des frais d’abonnement à votre station de radio Internet de votre choix.

Streaming Radio - La dernière et la méthode la plus pratique pour ceux qui souhaitent écouter vivent leurs émissions de radio préférées en ligne sont, sans surprise, via Internet. Vous avez de nombreuses façons de profiter de la radio en ligne sans avoir à payer quelque chose de plus. Vous pouvez simplement ouvrir votre navigateur Web préféré et faire ce que vous faites normalement sur le Web pour diffuser des fichiers audio: Visitez les différentes stations de radio en ligne à écouter de leur vie et à prendre note de laquelle vous préférez. Vous pouvez ensuite revenir sur votre bureau ou votre ordinateur portable et transférer les fichiers sur votre lecteur MP3 de choix.

La radio en ligne peut être gratuite ou payée; Beaucoup de gens écoutent leurs stations de radio préférées par le biais de stations de radio en ligne payantes offrant des émissions de radio en streaming en direct des émissions de radio populaires chaque jour. Si vous voulez en savoir plus sur certaines des stations de radio en ligne les plus populaires, vous pouvez toujours visiter leurs sites Web pour consulter leurs annonces actuelles ainsi que leurs émissions programmées à venir. Il existe des tonnes de sites offrant tous les genres de musique et de stations de radio; Vous pouvez également vous rendre directement au site Web des stations de radio pour vous inscrire à leur bulletin d’information, obtenir des téléchargements de chansons et regarder des émissions de radio comme ils l’air.

Ce ne sont que deux des moyens les plus populaires d’écouter la radio en ligne. Quelle que soit vos préférences, vous ne devriez avoir aucun problème à trouver une méthode qui fonctionne pour vous et convient à votre budget. Les supports de diffusion en streaming tels que les fichiers audio et vidéo sont disponibles sur Internet sans frais et sont souvent une source plus fiable d’audio et de vidéo que des stations de radio classiques. Donc, si vous êtes intéressé à profiter de Streaming Media Online, tout ce que vous avez à faire est de trouver un service offrant ce type de média à bas prix.

#radio #radioenligne #radiofrench

Radio en direct - Écouter radio en ligne | RadioFrench

20+ Superb Podcast & Radio WordPress Themes 2021

Roogan

Roogan is a personal podcast theme, made for creatives, corporate players, doctors, journalists – just anyone looking to start a podcast website. Roogan is a collection of beautiful layouts designed specifically for podcasters, with a complete set of features, including a powerful audio player. Why choose it for your next WordPress podcast website?

Podcaster

It is a clean, flexible and responsive WordPress Theme. It supports native audio and video players as well as oEmbed. Manage your podcast or screencast with Podcaster. The styling is very versatile. Choose between dark and light templates, choose a highlight color, the type of font or custom headers on the front page, blog page and any other custom page templates.

#wordpress #podcast #radio

20+ Superb Podcast & Radio WordPress Themes 2021

Studying the Ionospheric Radio Signals Propagation Using Python and SDR

Readers who were born at the 70s or earlier, and had medium-, long- or shortwave receivers at home, probably remember that stations of different wavelengths propagate differently at different times of the day. But how does it really work?

Image for post

I will show, how using an SDR receiver and 50 lines of Python code, it is possible to visualize radio stations signals with <0.01 Hertz accuracy and observe some interesting atmospheric effects.

General Idea

Most AM radio stations are broadcasting 24h per day, which allows us to analyse the radio signals they transmit. To do this, we will record the radio signal in WAV format and plot its spectrum using FFT (Fast Fourier Transform). FFT makes it possible to obtain an image in the frequency domain from a signal in the time domain, in other words, to get a spectrum of the signal. The larger the FFT window, the more frequency resolution we can get.

As we know, the signals of AM stations on the air look like this:

Image for post

The actual broadcast content is not interesting to us (is anyone still listening to the radio nowadays?), but the AM carrier — the centre of the signal, is important. It is a good marker by which it is convenient to monitor the signal on the spectrum.

#programming #science #radio #nature #physics #data-science

Studying the Ionospheric Radio Signals Propagation Using Python and SDR