DEV Community

Amey Sunu
Amey Sunu

Posted on

Running Flutter Tests using Github Actions

My Workflow

My workflow is a testing parameter for Flutter Apps, and I made it for my Flutter package which allows seamless integration of with Flutter. The workflow runs a flutter test, that checks if there is a valid response from the server, whenever there is push or pull request to the master branch.

Submission Category:

Phone Friendly

Yaml File or Link to Code

GitHub logo ameysunu / flutter_witai

Integrating with Flutter for structured response based on your query.

Flutter Package

Codemagic build status is a natural language interface for statements into structured data. This package helps get a structured data from console as per the trained utterance for Flutter. You can read a lot more about and its documentation here.

Feel free to hit me up with PR for any issues and further improvements for this package.

Getting Started

Begin by importing the package into your dart file.

import 'package:flutter_witai/flutter_witai.dart'

Create an object wit from the package's WitManager option. WitManager has three parameters, namely params, utterance and headers.

Within utterance, add your utterance text for which the data has to be generated, and within headers add your Server Access Token which can be retrieved from settings console. params is the GET parameter for accessing various HTTP APIs. Various parameters for the retrieval of HTTP API can be viewed below.

    final wit =

YAML File:

name: Flutter Test
    branches: [ master ]
    branches: [ master ]


    runs-on: ubuntu-latest

      - uses: actions/checkout@v2
      - uses: actions/setup-java@v2
          distribution: 'zulu'
          java-version: '11'
      - uses: subosito/flutter-action@v1
          flutter-version: '2.0.5'

      - name: Get all Flutter Packages
        run: flutter pub get

      - name: Run a multi-line script
        run: flutter test
Enter fullscreen mode Exit fullscreen mode

Additional Resources / Info

Shoutout to Flutter Actions for helping me with the workflow analysis.

Top comments (0)