Firda Sahidi
Firda Sahidi

Reputation: 1281

Import Git Reprository Library to Flutter

I'm new to flutter an I have an issue to import Library to Flutter that hasn't been published in Pub. Here's the library that I want to import: https://github.com/LiewJunTung/pin_code_text_field

And I've add this to my Pubspec.yaml as written in Flutter Documentation.

dependencies:
  flutter:
    sdk: flutter
  pin_code_text_field:
    git:
      url: git://github.com/LiewJunTung/pin_code_text_field.git

But I don't know how to import that to my current class. Usually if it's published in pub, you can easily put that as example:

import 'package:flutter/material.dart';

But how if it's not? How to import that? Thank you.

Upvotes: 1

Views: 655

Answers (1)

Santosh Anand
Santosh Anand

Reputation: 1228

In pubspec.yaml

dependencies:
  flutter:
    sdk: flutter
  pin_code_text_field: ^1.2.1

And in your class you can import like this

import 'package:pin_code_text_field/pin_code_text_field.dart';

Upvotes: 1

Related Questions