The flutter_ibm_watson makes it easy to integrate IBM Watson

Overview

Flutter Ibm Watson

IBM Watson

Installation

  • Add this to your package's pubspec.yaml file:
dependencies:
  flutter_ibm_watson: ^0.0.1
  • You can install packages from the command line: with Flutter:
$ flutter packages get
  • Import it Now in your Dart code, you can use:
 import 'package:flutter_ibm_watson/flutter_ibm_watson.dart';

Usage

Language Translator

    import 'package:flutter_ibm_watson/flutter_ibm_watson.dart';
    // or import
    import 'package:flutter_ibm_watson/language_translator/LanguageTranslator.dart';
    import 'package:flutter_ibm_watson/utils/Language.dart';
    import 'package:flutter_ibm_watson/utils/IamOptions.dart';
  • Code Flutter to translate text
IamOptions options = await IamOptions(iamApiKey: "Your ApiKey", url: "Your Url").build();
LanguageTranslator service = new LanguageTranslator(iamOptions: options);
TranslationResult translationResult = await service.translate("Your Text", Language.ENGLISH, Language.SPANISH);
print(translationResult);
  • Example
void languageTranslator(String text) async {
    IamOptions options = await IamOptions(iamApiKey: "fr8sBBKkjZidQJij6sadfxAwqwqe4S8yY_fdXmSrKZoH_F8LB", url: "https://gateway-syd.watsonplatform.net/language-translator/api").build();
    LanguageTranslator service = new LanguageTranslator(iamOptions: options);
    TranslationResult translationResult = await service.translate(text, Language.ENGLISH, Language.SPANISH);
    print(translationResult);
}

*Code Flutter to identify language

IamOptions options = await IamOptions(iamApiKey: "Your ApiKey", url: "Your Url").build();
LanguageTranslator service = new LanguageTranslator(iamOptions: options);
IdentifyLanguageResult identifyLanguageResult = await service.identifylanguage("You text to identify");
print(identifyLanguageResult);
  • Example
void identifyLanguage(String text) async {
    IamOptions options = await IamOptions(iamApiKey: "fr8sBBKkjZidQJij6sadfxAwqwqe4S8yY_fdXmSrKZoH_F8LB", url: "https://gateway-syd.watsonplatform.net/language-translator/api").build();
    LanguageTranslator service = new LanguageTranslator(iamOptions: this.options);
    IdentifyLanguageResult identifyLanguageResult = await service.identifylanguage(text);
    print(identifyLanguageResult);
}

Visual Recognition

    import 'package:flutter_ibm_watson/flutter_ibm_watson.dart';
    // or import
    import 'package:flutter_ibm_watson/visual-recognition/VisualRecognition.dart';
    import 'package:flutter_ibm_watson/utils/Language.dart';
    import 'package:flutter_ibm_watson/utils/IamOptions.dart';
  • Code Flutter for Visual Recognition Image Url
IamOptions options = await IamOptions(iamApiKey: "Your ApiKey", url: "Your Url").build();
VisualRecognition visualRecognition = new VisualRecognition(iamOptions: this.options, language: Language.ENGLISH); // Language.ENGLISH is language response 
ClassifiedImages classifiedImages = await visualRecognition.classifyImageUrl("Your Image URLS");
print(classifiedImages.getImages()[0].getClassifiers()[0].getClasses()[0].className);
  • Example
void visualRecognitionUrl(String url) async {
    IamOptions options = await IamOptions(iamApiKey: "PtrAMdthejasdsaqqweXpRSs3gxwQAdsasdRPNzLEnLQ", url: "https://gateway.watsonplatform.net/visual-recognition/api").build();
    VisualRecognition visualRecognition = new VisualRecognition(iamOptions: this.options, language: Language.ENGLISH);
    ClassifiedImages classifiedImages = await visualRecognition.classifyImageUrl(url);
    print(classifiedImages
        .getImages()[0]
        .getClassifiers()[0]
        .getClasses()[0]
        .className);
}
  • Visual Recognition File
IamOptions options = await IamOptions(iamApiKey: "Your ApiKey", url: "Your Url").build();
VisualRecognition visualRecognition = new VisualRecognition(iamOptions: this.options, language: Language.ENGLISH); // Language.ENGLISH is language response 
ClassifiedImages classifiedImages = await visualRecognition.classifyImageFile("Image File Path");
print(classifiedImages.getImages()[0].getClassifiers()[0].getClasses()[0].class_name);
  • Example
void visualRecognitionFile(File image) async {
    IamOptions options = await IamOptions(iamApiKey: "PtrAMdthejasdsaqqweXpRSs3gxwQAdsasdRPNzLEnLQ", url: "https://gateway.watsonplatform.net/visual-recognition/api").build();
    VisualRecognition visualRecognition = new VisualRecognition(
        iamOptions: this.options, language: Language.ENGLISH);
    ClassifiedImages classifiedImages =
        await visualRecognition.classifyImageFile(image.path);

    print(classifiedImages
        .getImages()[0]
        .getClassifiers()[0]
        .getClasses()[0]
        .className);
}

Text To Speech

  import 'package:flutter_ibm_watson/flutter_ibm_watson.dart';
  or
  import 'package:flutter_ibm_watson/services/textToSpeech.dart';
  import 'package:flutter_ibm_watson/utils/IamOptions.dart';
  • Code Flutter to text to speech
IamOptions options = await IamOptions(iamApiKey: "Your ApiKey", url: "Your Url").build();
TextToSpeech service = new TextToSpeech(iamOptions: options);
service.setVoice("Enter Voice"); //default en-US_AllisonV3Voice
Uint8List bi = await service.toSpeech("Your Text");
  • Example
void textToSpeech() async {
    IamOptions options = await IamOptions(iamApiKey: "Your ApiKey", url: "Your Url").build();
    TextToSpeech service = new TextToSpeech(iamOptions: options);
    service.setVoice("en-US_AllisonV3Voice");
    Uint8List bi = await service.toSpeech(text);
}
  • Get List Languages
IamOptions options = await IamOptions(iamApiKey: "Your ApiKey", url: "Your Url").build();
TextToSpeech service = new TextToSpeech(iamOptions: options);
List<Voice> listVoice = await service.getListVoices();

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

You might also like...

Toor makes service locators compile-time safe and easy to manage

🌱 What is Toor Toor makes service locators compile-time safe and easy to manage. 🚀 Getting Started Define your dependencies somewhere in the project

Jul 25, 2022

Flutter plugin to simply integrate Agora Video Calling or Live Video Streaming to your app with just a few lines of code.

Agora UI Kit for Flutter Instantly integrate Agora video calling or video streaming into your Flutter application. Getting started Requirements An Ago

Dec 16, 2022

Integrate Flutter with the Facebook Stetho tool for Android

Integrate Flutter with the Facebook Stetho tool for Android

flutter_stetho A plugin that connects Flutter to the Chrome Dev Tools on Android devices via the Stetho Android Library. Network Inspector The main fe

Nov 20, 2022

In this video we will learn how to Integrate NodeJS Login and Register API in our Flutter application using JWT Token Authentication.

In this video we will learn how to Integrate NodeJS Login and Register API in our Flutter application using JWT Token Authentication.

Flutter Login & Register with Node JS Rest API In this video we will learn how to Integrate NodeJS Login and Register API in our Flutter application u

Nov 28, 2022

Plugin to integrate native firebase admob to Flutter application

flutter_native_admob Plugin to integrate Firebase Native Admob to Flutter application Platform supported: iOS, Android Getting Started For help gettin

Dec 21, 2022

Plugin to integrate Facebook Native Banner Ad

flutter_fbaudience_network Plugin to integrate Facebook Native Ad to Flutter application Warning: The plugin is based on Flutter PlatformView (Android

May 13, 2020

A most easily usable RESAS API wrapper in Dart. With this library, you can easily integrate your application with the RESAS API.

A most easily usable RESAS API wrapper library in Dart! 1. About 1.1. What Is RESAS? 1.2. Introduction 1.2.1. Install Library 1.2.2. Import It 1.2.3.

Apr 7, 2022

Integrate any icons you like to your flutter app

Integrate any icons you like to your flutter app

Flutter Tutorial - Icons - Custom & Plugin Icons Integrate any icons you like to your flutter app - Material Icons, Beautiful Icons & Custom Icons. ⚡

Dec 28, 2021

The LoginRadius Flutter SDK will let you integrate LoginRadius' customer identity platform with your Flutter application(s).

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them. Features TODO: List w

Feb 3, 2022
Comments
  • Support null safety

    Support null safety

    Hi, since Dart 2.12 and Flutter 2.0 the null safety language features were introduced into the Dart language. Could you migrate your package to sound null safety? For more info, please see https://dart.dev/null-safety/understanding-null-safety

    opened by dvorapa 0
  • Why this project needs Flutter dependency?

    Why this project needs Flutter dependency?

    Hello!

    I was wondering why this project has the Flutter dependency. Since it is only consulting IBM services, it should net depend on Flutter's framework.

    Removing it, would enable this librayr to run on other Dart environments like CLI, javascript, native, and also flutter!

    opened by shinayser 0
  • Visual Recognition

    Visual Recognition

    await not working, I solved the problem

    put the code below on line 189 on the File VisualRecognition.dart

    var value =await response.stream.bytesToString(); dynamic result; result = json.decode(value); classifiedImages = new ClassifiedImages(result); return classifiedImages;

    you may found better solution yourself but if you update your lib will work

    opened by cronnysousa 0
  • Main file is missing in the project.

    Main file is missing in the project.

    Hi victor really nice effort you have put in this repository. I have clone the repository but when I opened it in IDE I'vent see any main.dart file in this project.

    opened by nomantalish 0
Owner
Victor Alfonso Rodas Oña
Victor Alfonso Rodas Oña
A library that makes it easy for you to create your own custom wizard.

Flutter Wizard Author: Jop Middelkamp A library that makes it easy for you to create your custom wizard. You'll have 100% control over the appearance

Baseflow 13 Dec 2, 2022
Flutter makes it easy and fast to build beautiful apps for mobile and beyond

Flutter is Google's SDK for crafting beautiful, fast user experiences for mobile, web, and desktop from a single codebase. Flutter works with existing

Flutter 148.2k Jan 8, 2023
🙌🏾 This package makes it easy to use the Mono connect widget in a flutter project

Flutter Mono ** This is an unofficial SDK for flutter This package makes it easy to use the Mono connect widget in a flutter project. ?? Screen Shots

Chiziaruhoma Ogbonda 12 Dec 20, 2022
flutter_thrio makes it easy and fast to add flutter to existing mobile applications, and provide a simple and consistent navigator APIs.

中文文档 英文文档 问题集 原仓库不再维护,代码已经很老了 最近版本更新会很快,主要是增加新特性,涉及到混合栈的稳定性的问题应该不多,可放心升级,发现问题加 QQ 群号码:1014085473,我会尽快解决。 不打算好好看看源码的使用者可以放弃这个库了,因为很多设定是比较死的,而我本人不打算花时间写

null 290 Dec 29, 2022
Nexus is a state management library that makes it easy to create and consume your application's reactive data to the user interface.

Nexus ?? Nexus is a state management library that makes it easy to create and consume your application's reactive data to the user interface. With nex

Gor Mkhitaryan 3 Sep 7, 2022
flutter_thrio makes it easy and fast to add flutter to existing mobile applications, and provide a simple and consistent navigator APIs.

本仓库不再维护,可移步新仓库 https://github.com/flutter-thrio/flutter_thrio 中文文档 问题集 QQ 群号码:1014085473 The Navigator for iOS, Android, Flutter. Version 0.2.2 requir

Hellobike 732 Dec 5, 2022
This library provides a customizable Flutter widget that makes it easy to display text in the middle of a Divider.

1. About 1.1. Introduction 1.1.1. Install Library 1.1.2. Import It 1.1.3. Use TextDivider 1.2. Details 1.2.1. Customization Options 1.2.2. Horizontal

Kato Shinya 2 Feb 9, 2022
A Flutter tool that makes golden testing easy.

???? Alchemist Developed with ?? by Very Good Ventures ?? and Betterment ☀️ . A Flutter tool that makes golden testing easy. Alchemist is a Flutter pa

Betterment 210 Dec 12, 2022
Dart package to which makes data communication easy among different modules of your application.

LiveStream - Dart LiveStream is a data holder class which can observe change of data in real-time and emit values too. Here's emitter subscriber patte

Shreyas Patil 75 Sep 28, 2022