-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d17769a
Showing
88 changed files
with
10,124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Flutter_Tests | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
|
||
env: | ||
GIPHY_API_KEY: ${{secrets.GIPHY_API_KEY}} | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: subosito/flutter-action@v2 | ||
with: | ||
channel: 'stable' | ||
- name: Restore packages | ||
run: flutter pub get | ||
|
||
- name: Analyze | ||
run: flutter analyze | ||
|
||
- name: Run tests | ||
run: flutter test --coverage | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
/coverage | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
**/doc/api/ | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.packages | ||
.pub-cache/ | ||
.pub/ | ||
build/ | ||
|
||
# Android related | ||
**/android/**/gradle-wrapper.jar | ||
**/android/.gradle | ||
**/android/captures/ | ||
**/android/gradlew | ||
**/android/gradlew.bat | ||
**/android/local.properties | ||
**/android/**/GeneratedPluginRegistrant.java | ||
|
||
# iOS/XCode related | ||
**/ios/**/*.mode1v3 | ||
**/ios/**/*.mode2v3 | ||
**/ios/**/*.moved-aside | ||
**/ios/**/*.pbxuser | ||
**/ios/**/*.perspectivev3 | ||
**/ios/**/*sync/ | ||
**/ios/**/.sconsign.dblite | ||
**/ios/**/.tags* | ||
**/ios/**/.vagrant/ | ||
**/ios/**/DerivedData/ | ||
**/ios/**/Icon? | ||
**/ios/**/Pods/ | ||
**/ios/**/.symlinks/ | ||
**/ios/**/profile | ||
**/ios/**/xcuserdata | ||
**/ios/.generated/ | ||
**/ios/Flutter/App.framework | ||
**/ios/Flutter/Flutter.framework | ||
**/ios/Flutter/Flutter.podspec | ||
**/ios/Flutter/Generated.xcconfig | ||
**/ios/Flutter/app.flx | ||
**/ios/Flutter/app.zip | ||
**/ios/Flutter/flutter_assets/ | ||
**/ios/Flutter/flutter_export_environment.sh | ||
**/ios/ServiceDefinitions.json | ||
**/ios/Runner/GeneratedPluginRegistrant.* | ||
|
||
# Exceptions to above rules. | ||
!**/ios/**/default.mode1v3 | ||
!**/ios/**/default.mode2v3 | ||
!**/ios/**/default.pbxuser | ||
!**/ios/**/default.perspectivev3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: 13860a7d23c564ec9ff38a44661d21160c3f7b1e | ||
channel: master | ||
|
||
project_type: package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### 1.0.0 | ||
|
||
* Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Bazo SPA | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
# Giphy Selector | ||
|
||
## Overview | ||
|
||
Inspired by [giphy_get](https://github.com/bazookon/giphy_get) | ||
|
||
This package allow to get gifs, sticker or emojis from [GIPHY](https://www.giphy.com/) in pure dart | ||
code using [Giphy SDK](https://developers.giphy.com/docs/sdk) design guidelines. | ||
|
||
<img src="https://github.com/bazookon/giphy_get/raw/main/example/assets/demo/giphy_get_widget.gif" width="360" /> | ||
|
||
## Getting Started | ||
|
||
Important! you must register your app at [Giphy Develepers](https://developers.giphy.com/dashboard/) | ||
and get your APIKEY | ||
|
||
## Localizations | ||
|
||
Currently english, french and spanish is supported. | ||
|
||
```dart | ||
void runApp() { | ||
return MaterialApp( | ||
title: 'Giphy Get Demo', | ||
localizationsDelegates: [ | ||
// Default Delegates | ||
GlobalMaterialLocalizations.delegate, | ||
GlobalWidgetsLocalizations.delegate, | ||
// Add this line | ||
GiphyGetUILocalizations.delegate | ||
], | ||
supportedLocales: [ | ||
//Your supported languages | ||
Locale('en', ''), | ||
Locale('es', ''), | ||
Locale('fr', ''), | ||
], | ||
home: MyHomePage(title: 'Giphy Get Demo'), | ||
); | ||
} | ||
``` | ||
|
||
### Get only Gif | ||
|
||
This is for get gif without wrapper and tap to more | ||
|
||
```dart | ||
import 'package:giphy_get/giphy_get.dart'; | ||
GiphyGif gif = await GiphyGet.getGif( | ||
context: context, //Required | ||
apiKey: "your api key HERE", //Required. | ||
lang: GiphyLanguage.english, //Optional - Language for query. | ||
randomID: "abcd", // Optional - An ID/proxy for a specific user. | ||
tabColor:Colors.teal, // Optional- default accent color. | ||
); | ||
``` | ||
|
||
### Options | ||
|
||
| Value | Type | Description | Default | | ||
|--------------|--------|------------------------------------------------------------------------------------------------------------------|---------------------------------| | ||
| `lang` | String | Use [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) language code or use GiphyLanguage constants | `GiphyLanguage.english` | | ||
| `randomID` | String | An ID/proxy for a specific user. | `null` | | ||
| `searchText` | String | Input search hint, we recommend use [flutter_18n package](https://pub.dev/packages/flutter_i18n) for translation | `"Search GIPHY"` | | ||
| `tabColor` | Color | Color for tabs and loading progress, | `Theme.of(context).accentColor` | | ||
|
||
### [Get Random ID](https://developers.giphy.com/docs/api/endpoint#random-id) | ||
|
||
```dart | ||
Futurew<void> doSomeThing() async { | ||
GiphyClient giphyClient = GiphyClient(apiKey: 'YOUR API KEY'); | ||
String randomId = await giphyClient.getRandomId(); | ||
} | ||
``` | ||
|
||
# Widgets | ||
|
||
Optional but this widget is required if you get more gif's of user or view on Giphy following Giphy | ||
Design guidelines | ||
|
||
 | ||
|
||
## GiphyGifWidget | ||
|
||
Parameters | ||
|
||
| Value | Type | Description | Default | | ||
|----------------------------|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------|------------------| | ||
| `gif` required | GiphyGif | GiphyGif object from stream or JSON | | | ||
| `giphyGetWrapper` required | GiphyGetWrapper | selector instance used to find more by author | null | | ||
| `showGiphyLabel` | bool | show or hide `Powered by GIPHY`label at bottom | true | | ||
| `borderRadius` | BorderRadius | add border radius to image | null | | ||
| `imageAlignment` | Alignment | this widget is a [Stack](https://api.flutter.dev/flutter/widgets/Stack-class.html) with Image and tap buttons this property adjust alignment | Alignment.center | | ||
|
||
## GiphyGetWrapper | ||
|
||
Parameters | ||
|
||
| Value | Type | Description | Default | | ||
|--------------------------|----------|-------------------------------------------------------------|---------| | ||
| `giphy_api_key` required | String | Your Giphy API KEY | null | | ||
| `builder` | function | return Stream\<GiphyGif\> and Instance of GiphyGetWrapper | null | | ||
|
||
## Available methods | ||
|
||
```dart | ||
void getGif(String queryText, BuildContext context); | ||
``` | ||
|
||
```dart | ||
void build(BuildContext context) { | ||
return GiphyGetWrapper( | ||
giphy_api_key: 'REPLACE_WITH YOUR_API_KEY', | ||
// Builder with Stream<GiphyGif> and Instance of GiphyGetWrapper | ||
builder: (stream, giphyGetWrapper) => | ||
StreamBuilder<GiphyGif>( | ||
stream: stream, | ||
builder: (context, snapshot) { | ||
return Scaffold( | ||
body: snapshot.hasData | ||
? SizedBox( | ||
// GiphyGifWidget with tap to more | ||
child: GiphyGifWidget( | ||
imageAlignment: Alignment.center, | ||
gif: snapshot.data, | ||
giphyGetWrapper: giphyGetWrapper, | ||
borderRadius: BorderRadius.circular(30), | ||
showGiphyLabel: true, | ||
), | ||
) | ||
: Text("No GIF"), | ||
floatingActionButton: FloatingActionButton( | ||
onPressed: () async { | ||
//Open Giphy Sheet | ||
giphyGetWrapper.getGif('', context); | ||
}, | ||
tooltip: 'Open Sticker', | ||
child: Icon(Icons.insert_emoticon), | ||
), | ||
); | ||
} | ||
) | ||
); | ||
} | ||
``` | ||
|
||
## Using the example | ||
|
||
First export your giphy api key | ||
|
||
```terminal | ||
export GIPHY_API_KEY=YOUR_GIPHY_API_KEY | ||
``` | ||
|
||
and then run. | ||
|
||
## Contrib | ||
|
||
Feel free to make any PR's |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# The following line activates a set of recommended lints for Flutter apps, | ||
# packages, and plugins designed to encourage good coding practices. | ||
include: package:flutter_lints/flutter.yaml | ||
|
||
linter: | ||
# A list of all available lints | ||
# and their documentation is published at | ||
# https://dart-lang.github.io/linter/lints/index.html. | ||
# | ||
# Instead of disabling a lint rule for the entire project in the | ||
# section below, it can also be suppressed for a single line of code | ||
# or a specific dart file by using the `// ignore: name_of_lint` and | ||
# `// ignore_for_file: name_of_lint` syntax on the line or in the file | ||
# producing the lint. | ||
rules: | ||
use_build_context_synchronously: false | ||
# avoid_print: false # Uncomment to disable the `avoid_print` rule | ||
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule | ||
|
||
# Additional information about this file can be found at | ||
# https://dart.dev/guides/language/analysis-options |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
flutter test --coverage test | ||
genhtml coverage/lcov.info -o coverage/html | ||
open coverage/html/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TEST=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
**/doc/api/ | ||
**/ios/Flutter/.last_build_id | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.packages | ||
.pub-cache/ | ||
.pub/ | ||
/build/ | ||
|
||
# Web related | ||
lib/generated_plugin_registrant.dart | ||
|
||
# Symbolication related | ||
app.*.symbols | ||
|
||
# Obfuscation related | ||
app.*.map.json | ||
|
Oops, something went wrong.