├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── example ├── .gitignore ├── .metadata ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart └── pubspec.yaml ├── fonts ├── Roboto-Medium.ttf └── SF-Pro-Medium.ttf ├── lib ├── flutter_auth_buttons.dart ├── graphics │ ├── Twitter_Logo_Blue.png │ ├── apple_logo_black.png │ ├── apple_logo_white.png │ ├── flogo-HexRBG-Wht-100.png │ ├── google-logo.png │ └── ms-symbollockup_mssymbol_19.png └── src │ ├── apple.dart │ ├── button.dart │ ├── facebook.dart │ ├── google.dart │ ├── microsoft.dart │ └── twitter.dart ├── pubspec.yaml ├── screenshots ├── example-app.png ├── facebook.png ├── google-dark.png ├── google-light.png └── twitter.png └── test ├── apple_test.dart ├── facebook_test.dart ├── google_test.dart ├── microsoft_test.dart └── twitter_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | .packages 4 | .pub/ 5 | build/ 6 | ios/.generated/ 7 | ios/Flutter/Generated.xcconfig 8 | ios/Runner/GeneratedPluginRegistrant.* 9 | pubspec.lock 10 | flutter_auth_buttons.iml 11 | android/ 12 | example/ios/Flutter/flutter_export_environment.sh 13 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # Thank you to https://robertohuertas.com/2019/01/20/publish-flutter-package-with-travis/ 2 | # for the example Travis configuration. 3 | 4 | language: dart 5 | dart: 6 | - stable 7 | os: 8 | - linux 9 | sudo: false 10 | addons: 11 | apt: 12 | sources: 13 | - ubuntu-toolchain-r-test # you need this source to get the right version of libstdc++6 14 | packages: 15 | - libstdc++6 16 | install: 17 | - echo 'Avoid default Travis CI install step' # this is to avoid an error with pub in Travis 18 | 19 | before_script: 20 | - cd .. 21 | - git clone https://github.com/flutter/flutter.git -b stable 22 | - export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH 23 | - flutter doctor 24 | 25 | script: 26 | - cd $TRAVIS_BUILD_DIR 27 | - flutter packages get 28 | - flutter analyze --no-pub --no-current-package lib 29 | - flutter test 30 | - flutter packages pub publish --dry-run 31 | 32 | cache: 33 | directories: 34 | - $HOME/.pub-cache 35 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.10.0] 2 | 3 | * Support for centered buttons (thanks [@Jwildsmith](https://github.com/Jwildsmith)). 4 | 5 | ## [0.9.0] 6 | 7 | * Updated Facebook button (thanks [@chetan-cueclad](https://github.com/chetan-cueclad)). 8 | 9 | ## [0.8.0] 10 | 11 | * Button splash color can be set (thanks [@bitmoxy](https://github.com/bitmoxy)). 12 | 13 | ## [0.7.0] 14 | 15 | * Text styles can be overridden (thanks [@bitmoxy](https://github.com/bitmoxy)). 16 | 17 | ## [0.6.0] 18 | 19 | * Added Apple button (thanks [@json469](https://github.com/json469)). 20 | * Simplified the example app (removed stretched button examples). 21 | 22 | ## [0.5.0] 23 | 24 | * Added Microsoft button. 25 | 26 | ## [0.4.0] 27 | 28 | * Border radius can be specified (thanks [@nerder](https://github.com/nerder)). 29 | * Google button shows correct background colour when pressed (thanks [@g3rrydanc3](https://github.com/g3rrydanc3)). 30 | * Button content left-aligns when stretched. 31 | * `onPressed` attribute is no longer required. 32 | 33 | ## [0.3.1] 34 | 35 | * Improved package description. 36 | 37 | ## [0.3.0] 38 | 39 | * Added Twitter button. 40 | 41 | ## [0.2.1] 42 | 43 | * Fix bug to prevent buttons from stretching. 44 | 45 | ## [0.2.0] 46 | 47 | * Added Facebook button. 48 | 49 | ## [0.1.0] 50 | 51 | * Added example application. 52 | 53 | ## [0.0.1] 54 | 55 | * Support for Google button. 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2018 Duncan Jones 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the 4 | following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following 7 | disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following 10 | disclaimer in the documentation and/or other materials provided with the distribution. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 13 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 14 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 15 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 16 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 17 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 18 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter Auth Buttons 2 | 3 | [![Build Status](https://travis-ci.org/dmjones/flutter_auth_buttons.svg?branch=master)](https://travis-ci.org/dmjones/flutter_auth_buttons) 4 | 5 | --- 6 | 7 | > ## This library is now in maintenance mode 8 | > 9 | > I'm no longer actively using Flutter and don't have the time to keep this library maintained. No further changes will be made. 10 | > 11 | > You are very welcome to fork and maintain this elsewhere. If you do that, please let me know and I can point people there. 12 | > 13 | > Otherwise, there are some other libraries ([such as this one](https://github.com/ZaynJarvis/Flutter-Sign-in-Button)) which seem more advanced and could be a good choice. 14 | 15 | --- 16 | 17 | Flutter widget library containing buttons for authenticating with popular social networks: Apple, Google, Facebook, Twitter 18 | and Microsoft. 19 | 20 | Screenshot 21 | 22 | ## Usage 23 | 24 | Add `flutter_auth_buttons` to your `pubspec.yaml`, then import the Dart file: 25 | 26 | ```dart 27 | import 'package:flutter_auth_buttons/flutter_auth_buttons.dart'; 28 | ``` 29 | 30 | Use the `onPressed` attribute to capture the button press and call your authentication logic within that. To disable 31 | the button, pass `null` or omit the attribute. 32 | 33 | ```dart 34 | FacebookSignInButton(onPressed: () { 35 | // call authentication logic 36 | }); 37 | ``` 38 | 39 | Some buttons have a dark mode. Enable this with the optional parameter: 40 | 41 | ```dart 42 | GoogleSignInButton( 43 | onPressed: () {/* ... */}, 44 | darkMode: true, // default: false 45 | ) 46 | ``` 47 | 48 | You can adjust the border-radius of the buttons: 49 | 50 | ```dart 51 | TwitterSignInButton( 52 | onPressed: () {}, 53 | borderRadius: 10.0, 54 | ) 55 | ``` 56 | 57 | You can adjust the text style of the buttons: 58 | 59 | ```dart 60 | TwitterSignInButton( 61 | onPressed: () {}, 62 | textStyle: TextStyle(fontSize: 20, fontWeight: FontWeight.w700, fontFamily: "Roboto"), 63 | ) 64 | ``` 65 | 66 | You can adjust the splash color of the buttons: 67 | 68 | ```dart 69 | GoogleSignInButton( 70 | onPressed: () {/* ... */}, 71 | splashColor: Colors.white, 72 | // setting splashColor to Colors.transparent will remove button ripple effect. 73 | ) 74 | ``` 75 | 76 | Buttons can be stretched like normal Material buttons. By default the button 77 | contents are left-aligned when stretched. You can choose to center the icon and 78 | text using the `centered` property. 79 | 80 | ```dart 81 | TwitterSignInButton( 82 | onPressed: () {}, 83 | centered: true, 84 | ) 85 | ``` 86 | 87 | See the documentation for API details: https://pub.dartlang.org/documentation/flutter_auth_buttons/latest/. 88 | 89 | ## Contributions 90 | 91 | Contributions are very welcome. I would recommend discussing large changes in an issue before you spend the time on them. 92 | 93 | Good quality pull requests will win you commit rights. 94 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # Visual Studio Code related 20 | .vscode/ 21 | 22 | # Flutter/Dart/Pub related 23 | **/doc/api/ 24 | .dart_tool/ 25 | .flutter-plugins 26 | .packages 27 | .pub-cache/ 28 | .pub/ 29 | build/ 30 | 31 | # Android related 32 | **/android/**/gradle-wrapper.jar 33 | **/android/.gradle 34 | **/android/captures/ 35 | **/android/gradlew 36 | **/android/gradlew.bat 37 | **/android/local.properties 38 | **/android/**/GeneratedPluginRegistrant.java 39 | 40 | # iOS/XCode related 41 | **/ios/**/*.mode1v3 42 | **/ios/**/*.mode2v3 43 | **/ios/**/*.moved-aside 44 | **/ios/**/*.pbxuser 45 | **/ios/**/*.perspectivev3 46 | **/ios/**/*sync/ 47 | **/ios/**/.sconsign.dblite 48 | **/ios/**/.tags* 49 | **/ios/**/.vagrant/ 50 | **/ios/**/DerivedData/ 51 | **/ios/**/Icon? 52 | **/ios/**/Pods/ 53 | **/ios/**/.symlinks/ 54 | **/ios/**/profile 55 | **/ios/**/xcuserdata 56 | **/ios/.generated/ 57 | **/ios/Flutter/App.framework 58 | **/ios/Flutter/Flutter.framework 59 | **/ios/Flutter/Generated.xcconfig 60 | **/ios/Flutter/app.flx 61 | **/ios/Flutter/app.zip 62 | **/ios/Flutter/flutter_assets/ 63 | **/ios/ServiceDefinitions.json 64 | **/ios/Runner/GeneratedPluginRegistrant.* 65 | 66 | # Exceptions to above rules. 67 | !**/ios/**/default.mode1v3 68 | !**/ios/**/default.mode2v3 69 | !**/ios/**/default.pbxuser 70 | !**/ios/**/default.perspectivev3 71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 72 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: f37c235c32fc15babe6dc7b7bc2ee4387e5ecf92 8 | channel: beta 9 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 13 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 14 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 15 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 16 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 17 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXCopyFilesBuildPhase section */ 21 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 22 | isa = PBXCopyFilesBuildPhase; 23 | buildActionMask = 2147483647; 24 | dstPath = ""; 25 | dstSubfolderSpec = 10; 26 | files = ( 27 | ); 28 | name = "Embed Frameworks"; 29 | runOnlyForDeploymentPostprocessing = 0; 30 | }; 31 | /* End PBXCopyFilesBuildPhase section */ 32 | 33 | /* Begin PBXFileReference section */ 34 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 35 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 36 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 39 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 40 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 41 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 42 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 44 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 45 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 46 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 47 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | /* End PBXFileReference section */ 49 | 50 | /* Begin PBXFrameworksBuildPhase section */ 51 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | /* End PBXFrameworksBuildPhase section */ 59 | 60 | /* Begin PBXGroup section */ 61 | 9740EEB11CF90186004384FC /* Flutter */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 65 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 66 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 67 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 68 | ); 69 | name = Flutter; 70 | sourceTree = ""; 71 | }; 72 | 97C146E51CF9000F007C117D = { 73 | isa = PBXGroup; 74 | children = ( 75 | 9740EEB11CF90186004384FC /* Flutter */, 76 | 97C146F01CF9000F007C117D /* Runner */, 77 | 97C146EF1CF9000F007C117D /* Products */, 78 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 79 | ); 80 | sourceTree = ""; 81 | }; 82 | 97C146EF1CF9000F007C117D /* Products */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 97C146EE1CF9000F007C117D /* Runner.app */, 86 | ); 87 | name = Products; 88 | sourceTree = ""; 89 | }; 90 | 97C146F01CF9000F007C117D /* Runner */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 94 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 95 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 96 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 98 | 97C147021CF9000F007C117D /* Info.plist */, 99 | 97C146F11CF9000F007C117D /* Supporting Files */, 100 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 101 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 102 | ); 103 | path = Runner; 104 | sourceTree = ""; 105 | }; 106 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 107 | isa = PBXGroup; 108 | children = ( 109 | 97C146F21CF9000F007C117D /* main.m */, 110 | ); 111 | name = "Supporting Files"; 112 | sourceTree = ""; 113 | }; 114 | /* End PBXGroup section */ 115 | 116 | /* Begin PBXNativeTarget section */ 117 | 97C146ED1CF9000F007C117D /* Runner */ = { 118 | isa = PBXNativeTarget; 119 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 120 | buildPhases = ( 121 | 9740EEB61CF901F6004384FC /* Run Script */, 122 | 97C146EA1CF9000F007C117D /* Sources */, 123 | 97C146EB1CF9000F007C117D /* Frameworks */, 124 | 97C146EC1CF9000F007C117D /* Resources */, 125 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 126 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 127 | ); 128 | buildRules = ( 129 | ); 130 | dependencies = ( 131 | ); 132 | name = Runner; 133 | productName = Runner; 134 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 135 | productType = "com.apple.product-type.application"; 136 | }; 137 | /* End PBXNativeTarget section */ 138 | 139 | /* Begin PBXProject section */ 140 | 97C146E61CF9000F007C117D /* Project object */ = { 141 | isa = PBXProject; 142 | attributes = { 143 | LastUpgradeCheck = 0910; 144 | ORGANIZATIONNAME = "The Chromium Authors"; 145 | TargetAttributes = { 146 | 97C146ED1CF9000F007C117D = { 147 | CreatedOnToolsVersion = 7.3.1; 148 | }; 149 | }; 150 | }; 151 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 152 | compatibilityVersion = "Xcode 3.2"; 153 | developmentRegion = English; 154 | hasScannedForEncodings = 0; 155 | knownRegions = ( 156 | en, 157 | Base, 158 | ); 159 | mainGroup = 97C146E51CF9000F007C117D; 160 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 161 | projectDirPath = ""; 162 | projectRoot = ""; 163 | targets = ( 164 | 97C146ED1CF9000F007C117D /* Runner */, 165 | ); 166 | }; 167 | /* End PBXProject section */ 168 | 169 | /* Begin PBXResourcesBuildPhase section */ 170 | 97C146EC1CF9000F007C117D /* Resources */ = { 171 | isa = PBXResourcesBuildPhase; 172 | buildActionMask = 2147483647; 173 | files = ( 174 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 175 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 176 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 177 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 178 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 179 | ); 180 | runOnlyForDeploymentPostprocessing = 0; 181 | }; 182 | /* End PBXResourcesBuildPhase section */ 183 | 184 | /* Begin PBXShellScriptBuildPhase section */ 185 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 186 | isa = PBXShellScriptBuildPhase; 187 | buildActionMask = 2147483647; 188 | files = ( 189 | ); 190 | inputPaths = ( 191 | ); 192 | name = "Thin Binary"; 193 | outputPaths = ( 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | shellPath = /bin/sh; 197 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 198 | }; 199 | 9740EEB61CF901F6004384FC /* Run Script */ = { 200 | isa = PBXShellScriptBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | ); 204 | inputPaths = ( 205 | ); 206 | name = "Run Script"; 207 | outputPaths = ( 208 | ); 209 | runOnlyForDeploymentPostprocessing = 0; 210 | shellPath = /bin/sh; 211 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 212 | }; 213 | /* End PBXShellScriptBuildPhase section */ 214 | 215 | /* Begin PBXSourcesBuildPhase section */ 216 | 97C146EA1CF9000F007C117D /* Sources */ = { 217 | isa = PBXSourcesBuildPhase; 218 | buildActionMask = 2147483647; 219 | files = ( 220 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 221 | 97C146F31CF9000F007C117D /* main.m in Sources */, 222 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | }; 226 | /* End PBXSourcesBuildPhase section */ 227 | 228 | /* Begin PBXVariantGroup section */ 229 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 230 | isa = PBXVariantGroup; 231 | children = ( 232 | 97C146FB1CF9000F007C117D /* Base */, 233 | ); 234 | name = Main.storyboard; 235 | sourceTree = ""; 236 | }; 237 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 238 | isa = PBXVariantGroup; 239 | children = ( 240 | 97C147001CF9000F007C117D /* Base */, 241 | ); 242 | name = LaunchScreen.storyboard; 243 | sourceTree = ""; 244 | }; 245 | /* End PBXVariantGroup section */ 246 | 247 | /* Begin XCBuildConfiguration section */ 248 | 97C147031CF9000F007C117D /* Debug */ = { 249 | isa = XCBuildConfiguration; 250 | buildSettings = { 251 | ALWAYS_SEARCH_USER_PATHS = NO; 252 | CLANG_ANALYZER_NONNULL = YES; 253 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 254 | CLANG_CXX_LIBRARY = "libc++"; 255 | CLANG_ENABLE_MODULES = YES; 256 | CLANG_ENABLE_OBJC_ARC = YES; 257 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 258 | CLANG_WARN_BOOL_CONVERSION = YES; 259 | CLANG_WARN_COMMA = YES; 260 | CLANG_WARN_CONSTANT_CONVERSION = YES; 261 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 262 | CLANG_WARN_EMPTY_BODY = YES; 263 | CLANG_WARN_ENUM_CONVERSION = YES; 264 | CLANG_WARN_INFINITE_RECURSION = YES; 265 | CLANG_WARN_INT_CONVERSION = YES; 266 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 267 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 268 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 269 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 270 | CLANG_WARN_STRICT_PROTOTYPES = YES; 271 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 272 | CLANG_WARN_UNREACHABLE_CODE = YES; 273 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 274 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 275 | COPY_PHASE_STRIP = NO; 276 | DEBUG_INFORMATION_FORMAT = dwarf; 277 | ENABLE_STRICT_OBJC_MSGSEND = YES; 278 | ENABLE_TESTABILITY = YES; 279 | GCC_C_LANGUAGE_STANDARD = gnu99; 280 | GCC_DYNAMIC_NO_PIC = NO; 281 | GCC_NO_COMMON_BLOCKS = YES; 282 | GCC_OPTIMIZATION_LEVEL = 0; 283 | GCC_PREPROCESSOR_DEFINITIONS = ( 284 | "DEBUG=1", 285 | "$(inherited)", 286 | ); 287 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 288 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 289 | GCC_WARN_UNDECLARED_SELECTOR = YES; 290 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 291 | GCC_WARN_UNUSED_FUNCTION = YES; 292 | GCC_WARN_UNUSED_VARIABLE = YES; 293 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 294 | MTL_ENABLE_DEBUG_INFO = YES; 295 | ONLY_ACTIVE_ARCH = YES; 296 | SDKROOT = iphoneos; 297 | TARGETED_DEVICE_FAMILY = "1,2"; 298 | }; 299 | name = Debug; 300 | }; 301 | 97C147041CF9000F007C117D /* Release */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | ALWAYS_SEARCH_USER_PATHS = NO; 305 | CLANG_ANALYZER_NONNULL = YES; 306 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 307 | CLANG_CXX_LIBRARY = "libc++"; 308 | CLANG_ENABLE_MODULES = YES; 309 | CLANG_ENABLE_OBJC_ARC = YES; 310 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 311 | CLANG_WARN_BOOL_CONVERSION = YES; 312 | CLANG_WARN_COMMA = YES; 313 | CLANG_WARN_CONSTANT_CONVERSION = YES; 314 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 315 | CLANG_WARN_EMPTY_BODY = YES; 316 | CLANG_WARN_ENUM_CONVERSION = YES; 317 | CLANG_WARN_INFINITE_RECURSION = YES; 318 | CLANG_WARN_INT_CONVERSION = YES; 319 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 320 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 321 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 322 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 323 | CLANG_WARN_STRICT_PROTOTYPES = YES; 324 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 325 | CLANG_WARN_UNREACHABLE_CODE = YES; 326 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 327 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 328 | COPY_PHASE_STRIP = NO; 329 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 330 | ENABLE_NS_ASSERTIONS = NO; 331 | ENABLE_STRICT_OBJC_MSGSEND = YES; 332 | GCC_C_LANGUAGE_STANDARD = gnu99; 333 | GCC_NO_COMMON_BLOCKS = YES; 334 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 335 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 336 | GCC_WARN_UNDECLARED_SELECTOR = YES; 337 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 338 | GCC_WARN_UNUSED_FUNCTION = YES; 339 | GCC_WARN_UNUSED_VARIABLE = YES; 340 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 341 | MTL_ENABLE_DEBUG_INFO = NO; 342 | SDKROOT = iphoneos; 343 | TARGETED_DEVICE_FAMILY = "1,2"; 344 | VALIDATE_PRODUCT = YES; 345 | }; 346 | name = Release; 347 | }; 348 | 97C147061CF9000F007C117D /* Debug */ = { 349 | isa = XCBuildConfiguration; 350 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 351 | buildSettings = { 352 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 353 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 354 | ENABLE_BITCODE = NO; 355 | FRAMEWORK_SEARCH_PATHS = ( 356 | "$(inherited)", 357 | "$(PROJECT_DIR)/Flutter", 358 | ); 359 | INFOPLIST_FILE = Runner/Info.plist; 360 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 361 | LIBRARY_SEARCH_PATHS = ( 362 | "$(inherited)", 363 | "$(PROJECT_DIR)/Flutter", 364 | ); 365 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 366 | PRODUCT_NAME = "$(TARGET_NAME)"; 367 | VERSIONING_SYSTEM = "apple-generic"; 368 | }; 369 | name = Debug; 370 | }; 371 | 97C147071CF9000F007C117D /* Release */ = { 372 | isa = XCBuildConfiguration; 373 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 374 | buildSettings = { 375 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 376 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 377 | ENABLE_BITCODE = NO; 378 | FRAMEWORK_SEARCH_PATHS = ( 379 | "$(inherited)", 380 | "$(PROJECT_DIR)/Flutter", 381 | ); 382 | INFOPLIST_FILE = Runner/Info.plist; 383 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 384 | LIBRARY_SEARCH_PATHS = ( 385 | "$(inherited)", 386 | "$(PROJECT_DIR)/Flutter", 387 | ); 388 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 389 | PRODUCT_NAME = "$(TARGET_NAME)"; 390 | VERSIONING_SYSTEM = "apple-generic"; 391 | }; 392 | name = Release; 393 | }; 394 | /* End XCBuildConfiguration section */ 395 | 396 | /* Begin XCConfigurationList section */ 397 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 398 | isa = XCConfigurationList; 399 | buildConfigurations = ( 400 | 97C147031CF9000F007C117D /* Debug */, 401 | 97C147041CF9000F007C117D /* Release */, 402 | ); 403 | defaultConfigurationIsVisible = 0; 404 | defaultConfigurationName = Release; 405 | }; 406 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 407 | isa = XCConfigurationList; 408 | buildConfigurations = ( 409 | 97C147061CF9000F007C117D /* Debug */, 410 | 97C147071CF9000F007C117D /* Release */, 411 | ); 412 | defaultConfigurationIsVisible = 0; 413 | defaultConfigurationName = Release; 414 | }; 415 | /* End XCConfigurationList section */ 416 | }; 417 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 418 | } 419 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_auth_buttons/flutter_auth_buttons.dart'; 3 | 4 | void main() async { 5 | runApp(new MyApp()); 6 | } 7 | 8 | class MyApp extends StatelessWidget { 9 | @override 10 | Widget build(BuildContext context) { 11 | const padding = 25.0; 12 | 13 | return MaterialApp( 14 | title: 'Button Demo', 15 | home: Scaffold( 16 | appBar: AppBar( 17 | title: Text("flutter_auth_buttons"), 18 | ), 19 | backgroundColor: Color.fromARGB(0xFF, 0xF0, 0xF0, 0xF0), 20 | body: SingleChildScrollView( 21 | child: Column( 22 | crossAxisAlignment: CrossAxisAlignment.stretch, 23 | children: [ 24 | Column( 25 | children: [ 26 | SizedBox(height: padding), 27 | AppleSignInButton(onPressed: () {}), 28 | AppleSignInButton( 29 | onPressed: () {}, style: AppleButtonStyle.whiteOutline), 30 | AppleSignInButton( 31 | onPressed: () {}, style: AppleButtonStyle.black), 32 | SizedBox(height: padding), 33 | GoogleSignInButton(onPressed: () {}), 34 | GoogleSignInButton(onPressed: () {}, darkMode: true), 35 | SizedBox(height: padding), 36 | FacebookSignInButton(onPressed: () {}), 37 | SizedBox(height: padding), 38 | TwitterSignInButton(onPressed: () {}), 39 | SizedBox(height: padding), 40 | MicrosoftSignInButton(onPressed: () {}), 41 | MicrosoftSignInButton(onPressed: () {}, darkMode: true), 42 | ], 43 | ), 44 | ], 45 | ), 46 | ), 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: Example project for flutter_auth_buttons 3 | 4 | environment: 5 | sdk: ">=2.0.0-dev.68.0 <3.0.0" 6 | 7 | dependencies: 8 | flutter: 9 | sdk: flutter 10 | 11 | flutter_auth_buttons: 12 | path: ../ 13 | 14 | dev_dependencies: 15 | flutter_test: 16 | sdk: flutter 17 | 18 | 19 | flutter: 20 | uses-material-design: true -------------------------------------------------------------------------------- /fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /fonts/SF-Pro-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/fonts/SF-Pro-Medium.ttf -------------------------------------------------------------------------------- /lib/flutter_auth_buttons.dart: -------------------------------------------------------------------------------- 1 | export 'src/facebook.dart'; 2 | export 'src/google.dart'; 3 | export 'src/microsoft.dart'; 4 | export 'src/twitter.dart'; 5 | export 'src/apple.dart'; 6 | -------------------------------------------------------------------------------- /lib/graphics/Twitter_Logo_Blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/lib/graphics/Twitter_Logo_Blue.png -------------------------------------------------------------------------------- /lib/graphics/apple_logo_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/lib/graphics/apple_logo_black.png -------------------------------------------------------------------------------- /lib/graphics/apple_logo_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/lib/graphics/apple_logo_white.png -------------------------------------------------------------------------------- /lib/graphics/flogo-HexRBG-Wht-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/lib/graphics/flogo-HexRBG-Wht-100.png -------------------------------------------------------------------------------- /lib/graphics/google-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/lib/graphics/google-logo.png -------------------------------------------------------------------------------- /lib/graphics/ms-symbollockup_mssymbol_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/lib/graphics/ms-symbollockup_mssymbol_19.png -------------------------------------------------------------------------------- /lib/src/apple.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_auth_buttons/src/button.dart'; 3 | 4 | const double defaultBorderRadius = 3.0; 5 | 6 | enum AppleButtonStyle { white, whiteOutline, black } 7 | 8 | /// A sign in button that matches Apple's design guidelines. 9 | class AppleSignInButton extends StatelessWidget { 10 | final String text; 11 | final AppleButtonStyle style; 12 | final double borderRadius; 13 | final VoidCallback onPressed; 14 | final TextStyle textStyle; 15 | final Color splashColor; 16 | final bool centered; 17 | 18 | /// Creates a new button. Set [darkMode] to `true` to use the dark 19 | /// black background variant with white text, otherwise an all-white background 20 | /// with dark text is used. 21 | AppleSignInButton( 22 | {this.onPressed, 23 | // 'Continue with Apple' is also an available variant depdening on App's sign-in experience. 24 | this.text = 'Sign in with Apple', 25 | this.textStyle, 26 | this.splashColor, 27 | this.style = AppleButtonStyle.white, 28 | // Apple doesn't specify a border radius, but this looks about right. 29 | this.borderRadius = defaultBorderRadius, 30 | this.centered = false, 31 | Key key}) 32 | : assert(text != null), 33 | super(key: key); 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | return StretchableButton( 38 | buttonColor: 39 | style == AppleButtonStyle.black ? Colors.black : Colors.white, 40 | borderRadius: borderRadius, 41 | splashColor: splashColor, 42 | buttonBorderColor: 43 | style == AppleButtonStyle.whiteOutline ? Colors.black : null, 44 | onPressed: onPressed, 45 | buttonPadding: 0.0, 46 | centered: centered, 47 | children: [ 48 | Center( 49 | child: Row( 50 | children: [ 51 | Padding( 52 | padding: const EdgeInsets.only(left: 22.0, bottom: 3.0), 53 | child: Container( 54 | height: 38.0, 55 | width: 32.0, 56 | decoration: BoxDecoration( 57 | borderRadius: BorderRadius.circular(this.borderRadius), 58 | ), 59 | child: Center( 60 | child: Image( 61 | image: AssetImage( 62 | "graphics/apple_logo_${style == AppleButtonStyle.black ? "white" : "black"}.png", 63 | package: "flutter_auth_buttons", 64 | ), 65 | height: 17.0, 66 | width: 17.0, 67 | ), 68 | ), 69 | ), 70 | ), 71 | Padding( 72 | padding: const EdgeInsets.fromLTRB(0.0, 8.0, 32.0, 8.0), 73 | child: Text( 74 | text, 75 | style: textStyle ?? 76 | TextStyle( 77 | fontSize: 16.0, 78 | fontFamily: "SF Pro", 79 | fontWeight: FontWeight.w500, 80 | color: style == AppleButtonStyle.black 81 | ? Colors.white 82 | : Colors.black, 83 | ), 84 | ), 85 | ), 86 | ], 87 | ), 88 | ) 89 | ], 90 | ); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /lib/src/button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | const double defaultBorderRadius = 3.0; 4 | 5 | class StretchableButton extends StatelessWidget { 6 | final VoidCallback onPressed; 7 | final double borderRadius; 8 | final double buttonPadding; 9 | final Color buttonColor, splashColor; 10 | final Color buttonBorderColor; 11 | final List children; 12 | final bool centered; 13 | 14 | StretchableButton({ 15 | @required this.buttonColor, 16 | @required this.borderRadius, 17 | @required this.children, 18 | this.splashColor, 19 | this.buttonBorderColor, 20 | this.onPressed, 21 | this.buttonPadding, 22 | this.centered = false, 23 | }); 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | return LayoutBuilder( 28 | builder: (context, constraints) { 29 | var contents = List.from(children); 30 | 31 | if (constraints.minWidth == 0) { 32 | contents.add(SizedBox.shrink()); 33 | } else { 34 | if (centered) { 35 | contents.insert(0, Spacer()); 36 | } 37 | contents.add(Spacer()); 38 | } 39 | 40 | BorderSide bs; 41 | if (buttonBorderColor != null) { 42 | bs = BorderSide( 43 | color: buttonBorderColor, 44 | ); 45 | } else { 46 | bs = BorderSide.none; 47 | } 48 | 49 | return ButtonTheme( 50 | height: 40.0, 51 | padding: EdgeInsets.all(buttonPadding), 52 | shape: RoundedRectangleBorder( 53 | borderRadius: BorderRadius.circular(borderRadius), 54 | side: bs, 55 | ), 56 | child: RaisedButton( 57 | onPressed: onPressed, 58 | color: buttonColor, 59 | splashColor: splashColor, 60 | child: Row( 61 | mainAxisSize: MainAxisSize.min, 62 | children: contents, 63 | ), 64 | ), 65 | ); 66 | }, 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/src/facebook.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_auth_buttons/src/button.dart'; 3 | 4 | /// A sign in button that matches Facebook's design guidelines. 5 | /// 6 | /// The button text can be overridden, however the default text is recommended 7 | /// in order to be compliant with the design guidelines and to maximise 8 | /// conversion. 9 | class FacebookSignInButton extends StatelessWidget { 10 | final String text; 11 | final TextStyle textStyle; 12 | final VoidCallback onPressed; 13 | final double borderRadius; 14 | final Color splashColor; 15 | final bool centered; 16 | 17 | /// Creates a new button. The default button text is 'Continue with Facebook', 18 | /// which apparently results in higher conversion. 'Login with Facebook' is 19 | /// another suggestion. 20 | FacebookSignInButton({ 21 | this.onPressed, 22 | this.borderRadius = defaultBorderRadius, 23 | this.text = 'Continue with Facebook', 24 | this.textStyle, 25 | this.splashColor, 26 | this.centered = false, 27 | Key key, 28 | }) : assert(text != null), 29 | super(key: key); 30 | 31 | @override 32 | Widget build(BuildContext context) { 33 | return StretchableButton( 34 | buttonColor: Color(0xFF1877F2), 35 | borderRadius: borderRadius, 36 | splashColor: splashColor, 37 | onPressed: onPressed, 38 | buttonPadding: 8.0, 39 | centered: centered, 40 | children: [ 41 | // Facebook doesn't provide strict sizes, so this is a good 42 | // estimate of their examples within documentation. 43 | 44 | Image( 45 | image: AssetImage( 46 | "graphics/flogo-HexRBG-Wht-100.png", 47 | package: "flutter_auth_buttons", 48 | ), 49 | height: 24.0, 50 | width: 24.0, 51 | ), 52 | Padding( 53 | padding: const EdgeInsets.only(left: 6.0, right: 10.0), 54 | child: Text( 55 | text, 56 | style: textStyle ?? 57 | TextStyle( 58 | // default to the application font-style 59 | fontSize: 18.0, 60 | fontWeight: FontWeight.bold, 61 | color: Colors.white, 62 | ), 63 | ), 64 | ), 65 | ], 66 | ); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/src/google.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_auth_buttons/src/button.dart'; 3 | 4 | /// A sign in button that matches Google's design guidelines. 5 | /// 6 | /// The button text can be overridden, however the default text is recommended 7 | /// in order to be compliant with the design guidelines and to maximise 8 | /// conversion. 9 | class GoogleSignInButton extends StatelessWidget { 10 | final String text; 11 | final TextStyle textStyle; 12 | final bool darkMode; 13 | final double borderRadius; 14 | final VoidCallback onPressed; 15 | final Color splashColor; 16 | final bool centered; 17 | 18 | /// Creates a new button. Set [darkMode] to `true` to use the dark 19 | /// blue background variant with white text, otherwise an all-white background 20 | /// with dark text is used. 21 | GoogleSignInButton( 22 | {this.onPressed, 23 | this.text = 'Sign in with Google', 24 | this.textStyle, 25 | this.splashColor, 26 | this.darkMode = false, 27 | // Google doesn't specify a border radius, but this looks about right. 28 | this.borderRadius = defaultBorderRadius, 29 | this.centered = false, 30 | Key key}) 31 | : assert(text != null), 32 | super(key: key); 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return StretchableButton( 37 | buttonColor: darkMode ? Color(0xFF4285F4) : Colors.white, 38 | borderRadius: borderRadius, 39 | splashColor: splashColor, 40 | onPressed: onPressed, 41 | buttonPadding: 0.0, 42 | centered: centered, 43 | children: [ 44 | // The Google design guidelines aren't consistent. The dark mode 45 | // seems to have a perfect square of white around the logo, with a 46 | // thin 1dp (ish) border. However, since the height of the button 47 | // is 40dp and the logo is 18dp, it suggests the bottom and top 48 | // padding is (40 - 18) * 0.5 = 11. That's 10dp once we account for 49 | // the thin border. 50 | // 51 | // The design guidelines suggest 8dp padding to the left of the 52 | // logo, which doesn't allow us to center the image (given the 10dp 53 | // above). Something needs to give - either the 8dp is wrong or the 54 | // 40dp should be 36dp. I've opted to increase left padding to 10dp. 55 | Padding( 56 | padding: const EdgeInsets.all(1.0), 57 | child: Container( 58 | height: 38.0, // 40dp - 2*1dp border 59 | width: 38.0, // matches above 60 | decoration: BoxDecoration( 61 | color: darkMode ? Colors.white : null, 62 | borderRadius: BorderRadius.circular(this.borderRadius), 63 | ), 64 | child: Center( 65 | child: Image( 66 | image: AssetImage( 67 | "graphics/google-logo.png", 68 | package: "flutter_auth_buttons", 69 | ), 70 | height: 18.0, 71 | width: 18.0, 72 | ), 73 | ), 74 | ), 75 | ), 76 | 77 | SizedBox(width: 14.0 /* 24.0 - 10dp padding */), 78 | Padding( 79 | padding: const EdgeInsets.fromLTRB(0.0, 8.0, 8.0, 8.0), 80 | child: Text( 81 | text, 82 | style: textStyle ?? 83 | TextStyle( 84 | fontSize: 18.0, 85 | fontFamily: "Roboto", 86 | fontWeight: FontWeight.w500, 87 | color: 88 | darkMode ? Colors.white : Colors.black.withOpacity(0.54), 89 | ), 90 | ), 91 | ), 92 | ], 93 | ); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /lib/src/microsoft.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_auth_buttons/src/button.dart'; 3 | 4 | /// A sign in button that matches Microsoft's design guidelines. 5 | class MicrosoftSignInButton extends StatelessWidget { 6 | final String text; 7 | final TextStyle textStyle; 8 | final VoidCallback onPressed; 9 | final double borderRadius; 10 | final bool darkMode; 11 | final Color splashColor; 12 | final bool centered; 13 | 14 | /// Creates a new button. The default button text is 'Sign in with Microsoft'. 15 | /// Microsoft also allows simply 'Sign in'. 16 | MicrosoftSignInButton({ 17 | this.onPressed, 18 | this.borderRadius = 0.0, 19 | this.text = 'Sign in with Microsoft', 20 | this.textStyle, 21 | this.darkMode = false, 22 | this.splashColor, 23 | this.centered = false, 24 | Key key, 25 | }) : assert(text != null), 26 | super(key: key); 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return StretchableButton( 31 | buttonColor: darkMode ? Color(0xFF2F2F2F) : Color(0xFFFFFFFF), 32 | borderRadius: borderRadius, 33 | splashColor: splashColor, 34 | buttonBorderColor: darkMode ? null : Color(0xFF8C8C8C), 35 | onPressed: onPressed, 36 | buttonPadding: 10.0, // This is an estimate 37 | centered: centered, 38 | children: [ 39 | Padding( 40 | padding: const EdgeInsets.only(left: 2.0), // adds to 10 to make 12 41 | child: Image( 42 | image: AssetImage( 43 | "graphics/ms-symbollockup_mssymbol_19.png", 44 | package: "flutter_auth_buttons", 45 | ), 46 | height: 21.0, // 41px - 2x 10px padding 47 | width: 21.0, 48 | ), 49 | ), 50 | Padding( 51 | padding: const EdgeInsets.only(left: 12.0, right: 2.0), 52 | child: Text( 53 | text, 54 | style: textStyle ?? 55 | TextStyle( 56 | // Should be Segoe 15px, but can't find that font and 15px 57 | // seems too small... 58 | fontSize: 18.0, 59 | fontWeight: FontWeight.w600, 60 | color: darkMode ? Colors.white : Color(0xFF5E5E5E), 61 | ), 62 | ), 63 | ), 64 | ], 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /lib/src/twitter.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_auth_buttons/src/button.dart'; 3 | 4 | /// A sign in button that matches Twitter's look and feel. 5 | /// 6 | /// The button text can be overridden, however the default text is recommended 7 | /// in order to be compliant with the design guidelines and to maximise 8 | /// conversion. 9 | class TwitterSignInButton extends StatelessWidget { 10 | final String text; 11 | final TextStyle textStyle; 12 | final VoidCallback onPressed; 13 | final double borderRadius; 14 | final Color splashColor; 15 | final bool centered; 16 | 17 | /// Creates a new button. The default button text is 'Sign in with Twitter'. 18 | TwitterSignInButton({ 19 | this.onPressed, 20 | this.borderRadius = defaultBorderRadius, 21 | this.text = 'Sign in with Twitter', 22 | this.textStyle, 23 | this.splashColor, 24 | this.centered = false, 25 | Key key, 26 | }) : assert(text != null), 27 | super(key: key); 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return StretchableButton( 32 | buttonColor: Color(0xFFE7E7E7), 33 | borderRadius: borderRadius, 34 | splashColor: splashColor, 35 | onPressed: onPressed, 36 | buttonBorderColor: Color(0xFFCCCCCC), 37 | buttonPadding: 0.0, 38 | centered: centered, 39 | children: [ 40 | // Facebook doesn't provide strict sizes, so this is a good 41 | // estimate of their examples within documentation. 42 | 43 | Image( 44 | image: AssetImage( 45 | "graphics/Twitter_Logo_Blue.png", 46 | package: "flutter_auth_buttons", 47 | ), 48 | height: 40.0, 49 | width: 40.0, 50 | ), 51 | Padding( 52 | padding: const EdgeInsets.only(right: 10.0), 53 | child: Text( 54 | text, 55 | style: textStyle ?? 56 | TextStyle( 57 | // default to the application font-style 58 | fontSize: 18.0, 59 | fontWeight: FontWeight.bold, 60 | color: Color(0xFF555555), 61 | ), 62 | ), 63 | ), 64 | ], 65 | ); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_auth_buttons 2 | description: Material buttons for logging into popular social networks, including Google, Facebook, Twitter and Microsoft. 3 | version: 0.10.0 4 | homepage: https://github.com/dmjones/flutter_auth_buttons 5 | 6 | environment: 7 | sdk: ">=2.0.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | dev_dependencies: 14 | flutter_test: 15 | sdk: flutter 16 | 17 | flutter: 18 | 19 | assets: 20 | - packages/flutter_auth_buttons/graphics/google-logo.png 21 | - packages/flutter_auth_buttons/graphics/flogo-HexRBG-Wht-100.png 22 | - packages/flutter_auth_buttons/graphics/Twitter_Logo_Blue.png 23 | - packages/flutter_auth_buttons/graphics/ms-symbollockup_mssymbol_19.png 24 | - packages/flutter_auth_buttons/graphics/apple_logo_black.png 25 | - packages/flutter_auth_buttons/graphics/apple_logo_white.png 26 | 27 | fonts: 28 | - family: Roboto 29 | fonts: 30 | - asset: fonts/Roboto-Medium.ttf 31 | weight: 500 32 | - family: SF Pro 33 | fonts: 34 | - asset: fonts/SF-Pro-Medium.ttf 35 | weight: 500 36 | -------------------------------------------------------------------------------- /screenshots/example-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/screenshots/example-app.png -------------------------------------------------------------------------------- /screenshots/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/screenshots/facebook.png -------------------------------------------------------------------------------- /screenshots/google-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/screenshots/google-dark.png -------------------------------------------------------------------------------- /screenshots/google-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/screenshots/google-light.png -------------------------------------------------------------------------------- /screenshots/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dmjones/flutter_auth_buttons/9f6f7a61999fac08d77a445670f97f99ccaec9ea/screenshots/twitter.png -------------------------------------------------------------------------------- /test/apple_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_auth_buttons/src/apple.dart'; 3 | import 'package:flutter_auth_buttons/src/button.dart'; 4 | import 'package:flutter_test/flutter_test.dart'; 5 | 6 | void main() { 7 | testWidgets('Check the onTap of the Button works', 8 | (WidgetTester tester) async { 9 | var appleButtonKey = UniqueKey(); 10 | var isTapped = false; 11 | 12 | await tester.pumpWidget( 13 | MaterialApp( 14 | home: Material( 15 | child: AppleSignInButton( 16 | key: appleButtonKey, 17 | onPressed: () { 18 | isTapped = true; 19 | }, 20 | ), 21 | ), 22 | ), 23 | ); 24 | 25 | await tester.tap(find.byKey(appleButtonKey)); 26 | expect(isTapped, true); 27 | }); 28 | 29 | testWidgets('Check the default text provided is used', 30 | (WidgetTester tester) async { 31 | await tester.pumpWidget( 32 | MaterialApp( 33 | home: Material( 34 | child: AppleSignInButton(), 35 | ), 36 | ), 37 | ); 38 | 39 | expect(find.text('Sign in with Apple'), findsOneWidget); 40 | }); 41 | 42 | testWidgets('Check the provided text is used', (WidgetTester tester) async { 43 | const buttonText = 'Sign up with Apple'; 44 | await tester.pumpWidget( 45 | MaterialApp( 46 | home: Material( 47 | child: AppleSignInButton( 48 | text: buttonText, 49 | ), 50 | ), 51 | ), 52 | ); 53 | 54 | expect(find.text(buttonText), findsOneWidget); 55 | }); 56 | 57 | testWidgets('Check the default text style of the button is used', 58 | (WidgetTester tester) async { 59 | const defaultTextStyle = TextStyle( 60 | fontSize: 16.0, 61 | fontWeight: FontWeight.w500, 62 | color: Colors.black, 63 | ); 64 | 65 | await tester.pumpWidget( 66 | MaterialApp( 67 | home: Material( 68 | child: AppleSignInButton(), 69 | ), 70 | ), 71 | ); 72 | 73 | var text = find.byType(Text).evaluate().toList()[0].widget as Text; 74 | expect(text.style.fontSize, defaultTextStyle.fontSize); 75 | expect(text.style.fontWeight, defaultTextStyle.fontWeight); 76 | expect(text.style.color, defaultTextStyle.color); 77 | }); 78 | 79 | testWidgets('Check the provided text style of the button is used', 80 | (WidgetTester tester) async { 81 | const providedTextStyle = TextStyle( 82 | fontSize: 22.0, 83 | fontWeight: FontWeight.w900, 84 | color: Colors.white, 85 | ); 86 | 87 | await tester.pumpWidget( 88 | MaterialApp( 89 | home: Material( 90 | child: AppleSignInButton( 91 | textStyle: providedTextStyle, 92 | ), 93 | ), 94 | ), 95 | ); 96 | 97 | final AppleSignInButton appleSignInButton = 98 | tester.firstWidget(find.byType(AppleSignInButton)); 99 | expect(appleSignInButton.textStyle, providedTextStyle); 100 | }); 101 | 102 | testWidgets('Check supplied splash color is used', 103 | (WidgetTester tester) async { 104 | await tester.pumpWidget( 105 | MaterialApp( 106 | home: Material( 107 | child: AppleSignInButton( 108 | onPressed: () {}, 109 | splashColor: Colors.white, 110 | ), 111 | ), 112 | ), 113 | ); 114 | 115 | var button = find.byType(StretchableButton).evaluate().toList()[0].widget 116 | as StretchableButton; 117 | expect(button.splashColor, Colors.white); 118 | }); 119 | 120 | testWidgets('Check default splash color is used', 121 | (WidgetTester tester) async { 122 | ButtonThemeData buttonTheme; 123 | 124 | await tester.pumpWidget(MaterialApp( 125 | home: Builder( 126 | builder: (BuildContext context) { 127 | buttonTheme = ButtonTheme.of(context); 128 | return AppleSignInButton( 129 | onPressed: () {}, 130 | ); 131 | }, 132 | ), 133 | )); 134 | 135 | var button = 136 | find.byType(RaisedButton).evaluate().toList()[0].widget as RaisedButton; 137 | expect(buttonTheme.getSplashColor(button), 138 | buttonTheme.getTextColor(button).withOpacity(0.12)); 139 | }); 140 | 141 | testWidgets('Check the default AppleButtonStyle option is used', 142 | (WidgetTester tester) async { 143 | await tester.pumpWidget( 144 | MaterialApp( 145 | home: Material( 146 | child: AppleSignInButton(), 147 | ), 148 | ), 149 | ); 150 | final AppleSignInButton appleSignInButton = 151 | tester.firstWidget(find.byType(AppleSignInButton)); 152 | expect(appleSignInButton.style, AppleButtonStyle.white); 153 | }); 154 | 155 | testWidgets('Check the provided AppleButtonStyle option is used', 156 | (WidgetTester tester) async { 157 | final appleButtonStyle = AppleButtonStyle.black; 158 | 159 | await tester.pumpWidget( 160 | MaterialApp( 161 | home: Material( 162 | child: AppleSignInButton( 163 | style: appleButtonStyle, 164 | ), 165 | ), 166 | ), 167 | ); 168 | 169 | final AppleSignInButton appleSignInButton = 170 | tester.firstWidget(find.byType(AppleSignInButton)); 171 | expect(appleSignInButton.style, appleButtonStyle); 172 | }); 173 | 174 | testWidgets('Check the default border radius of the button is used', 175 | (WidgetTester tester) async { 176 | await tester.pumpWidget( 177 | MaterialApp( 178 | home: Material( 179 | child: AppleSignInButton(), 180 | ), 181 | ), 182 | ); 183 | final AppleSignInButton appleSignInButton = 184 | tester.firstWidget(find.byType(AppleSignInButton)); 185 | expect(appleSignInButton.borderRadius, 3.0); 186 | }); 187 | 188 | testWidgets('Check the provided border radius of the button is used', 189 | (WidgetTester tester) async { 190 | var appleButtonKey = UniqueKey(); 191 | 192 | var borderRadius = 20.0; 193 | 194 | await tester.pumpWidget( 195 | MaterialApp( 196 | home: Material( 197 | child: AppleSignInButton( 198 | key: appleButtonKey, 199 | borderRadius: borderRadius, 200 | ), 201 | ), 202 | ), 203 | ); 204 | 205 | final AppleSignInButton appleSignInButton = 206 | tester.firstWidget(find.byType(AppleSignInButton)); 207 | expect(appleSignInButton.borderRadius, borderRadius); 208 | }); 209 | } 210 | -------------------------------------------------------------------------------- /test/facebook_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_auth_buttons/src/button.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:flutter_auth_buttons/flutter_auth_buttons.dart'; 5 | 6 | void main() { 7 | testWidgets('Check on tap works', (WidgetTester tester) async { 8 | var buttonKey = UniqueKey(); 9 | 10 | var testVal = false; 11 | 12 | await tester.pumpWidget( 13 | MaterialApp( 14 | home: Material( 15 | child: FacebookSignInButton( 16 | key: buttonKey, 17 | onPressed: () { 18 | testVal = true; 19 | }, 20 | ), 21 | ), 22 | ), 23 | ); 24 | 25 | await tester.tap(find.byKey(buttonKey)); 26 | expect(testVal, true); 27 | }); 28 | 29 | testWidgets('Check default text is used', (WidgetTester tester) async { 30 | await tester.pumpWidget( 31 | MaterialApp( 32 | home: Material( 33 | child: FacebookSignInButton( 34 | onPressed: () {}, 35 | ), 36 | ), 37 | ), 38 | ); 39 | 40 | expect(find.text("Continue with Facebook"), findsOneWidget); 41 | }); 42 | 43 | testWidgets('Check supplied text is used', (WidgetTester tester) async { 44 | const suppliedText = "Hello, World!"; 45 | 46 | await tester.pumpWidget( 47 | MaterialApp( 48 | home: Material( 49 | child: FacebookSignInButton( 50 | onPressed: () {}, 51 | text: suppliedText, 52 | ), 53 | ), 54 | ), 55 | ); 56 | 57 | expect(find.text(suppliedText), findsOneWidget); 58 | }); 59 | 60 | testWidgets('Check default text style is used', (WidgetTester tester) async { 61 | const defaultTextStyle = TextStyle( 62 | fontSize: 18.0, fontWeight: FontWeight.bold, color: Colors.white); 63 | 64 | await tester.pumpWidget( 65 | MaterialApp( 66 | home: Material( 67 | child: FacebookSignInButton( 68 | onPressed: () {}, 69 | ), 70 | ), 71 | ), 72 | ); 73 | 74 | var text = find.byType(Text).evaluate().toList()[0].widget as Text; 75 | expect(text.style.fontSize, defaultTextStyle.fontSize); 76 | expect(text.style.fontWeight, defaultTextStyle.fontWeight); 77 | expect(text.style.color, defaultTextStyle.color); 78 | }); 79 | 80 | testWidgets('Check supplied text style is used', (WidgetTester tester) async { 81 | const suppliedTextStyle = TextStyle( 82 | color: Color(0xff000000), 83 | fontSize: 20, 84 | fontWeight: FontWeight.w700, 85 | fontFamily: "Roboto"); 86 | var buttonKey = UniqueKey(); 87 | 88 | await tester.pumpWidget( 89 | MaterialApp( 90 | home: Material( 91 | child: FacebookSignInButton( 92 | key: buttonKey, 93 | onPressed: () {}, 94 | textStyle: suppliedTextStyle, 95 | ), 96 | ), 97 | ), 98 | ); 99 | 100 | final FacebookSignInButton button = 101 | tester.firstWidget(find.byType(FacebookSignInButton)); 102 | expect(button.textStyle, suppliedTextStyle); 103 | }); 104 | 105 | testWidgets('Check supplied splash color is used', 106 | (WidgetTester tester) async { 107 | await tester.pumpWidget( 108 | MaterialApp( 109 | home: Material( 110 | child: FacebookSignInButton( 111 | onPressed: () {}, 112 | splashColor: Colors.white, 113 | ), 114 | ), 115 | ), 116 | ); 117 | 118 | var button = find.byType(StretchableButton).evaluate().toList()[0].widget 119 | as StretchableButton; 120 | expect(button.splashColor, Colors.white); 121 | }); 122 | 123 | testWidgets('Check default splash color is used', 124 | (WidgetTester tester) async { 125 | ButtonThemeData buttonTheme; 126 | 127 | await tester.pumpWidget(MaterialApp( 128 | home: Builder( 129 | builder: (BuildContext context) { 130 | buttonTheme = ButtonTheme.of(context); 131 | return FacebookSignInButton( 132 | onPressed: () {}, 133 | ); 134 | }, 135 | ), 136 | )); 137 | 138 | var button = 139 | find.byType(RaisedButton).evaluate().toList()[0].widget as RaisedButton; 140 | expect(buttonTheme.getSplashColor(button), 141 | buttonTheme.getTextColor(button).withOpacity(0.12)); 142 | }); 143 | } 144 | -------------------------------------------------------------------------------- /test/google_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_auth_buttons/src/button.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:flutter_auth_buttons/flutter_auth_buttons.dart'; 5 | 6 | void main() { 7 | testWidgets('Check on tap works', (WidgetTester tester) async { 8 | var buttonKey = UniqueKey(); 9 | 10 | var testVal = false; 11 | 12 | await tester.pumpWidget( 13 | MaterialApp( 14 | home: Material( 15 | child: GoogleSignInButton( 16 | key: buttonKey, 17 | onPressed: () { 18 | testVal = true; 19 | }, 20 | ), 21 | ), 22 | ), 23 | ); 24 | 25 | await tester.tap(find.byKey(buttonKey)); 26 | expect(testVal, true); 27 | }); 28 | 29 | testWidgets('Check default text is used', (WidgetTester tester) async { 30 | await tester.pumpWidget( 31 | MaterialApp( 32 | home: Material( 33 | child: GoogleSignInButton( 34 | onPressed: () {}, 35 | ), 36 | ), 37 | ), 38 | ); 39 | 40 | expect(find.text("Sign in with Google"), findsOneWidget); 41 | }); 42 | 43 | testWidgets('Check supplied text is used', (WidgetTester tester) async { 44 | const suppliedText = "Hello, World!"; 45 | 46 | await tester.pumpWidget( 47 | MaterialApp( 48 | home: Material( 49 | child: GoogleSignInButton( 50 | onPressed: () {}, 51 | text: suppliedText, 52 | ), 53 | ), 54 | ), 55 | ); 56 | 57 | expect(find.text(suppliedText), findsOneWidget); 58 | }); 59 | 60 | testWidgets('Check dark mode works', (WidgetTester tester) async { 61 | await tester.pumpWidget( 62 | MaterialApp( 63 | home: Material( 64 | child: GoogleSignInButton( 65 | onPressed: () {}, 66 | darkMode: true, 67 | ), 68 | ), 69 | ), 70 | ); 71 | 72 | expect(find.byType(RaisedButton), findsOneWidget); 73 | 74 | var button = 75 | find.byType(RaisedButton).evaluate().toList()[0].widget as RaisedButton; 76 | expect(button.color, Color(0xFF4285F4)); 77 | 78 | var text = find.byType(Text).evaluate().toList()[0].widget as Text; 79 | expect(text.style.color, Colors.white); 80 | }); 81 | 82 | testWidgets('Check light mode works', (WidgetTester tester) async { 83 | await tester.pumpWidget( 84 | MaterialApp( 85 | home: Material( 86 | child: GoogleSignInButton( 87 | onPressed: () {}, 88 | ), 89 | ), 90 | ), 91 | ); 92 | 93 | expect(find.byType(RaisedButton), findsOneWidget); 94 | 95 | var button = 96 | find.byType(RaisedButton).evaluate().toList()[0].widget as RaisedButton; 97 | 98 | expect(button.color, Colors.white); 99 | 100 | var text = find.byType(Text).evaluate().toList()[0].widget as Text; 101 | expect(text.style.color, Colors.black.withOpacity(0.54)); 102 | }); 103 | 104 | testWidgets('Check default text style is used', (WidgetTester tester) async { 105 | var defaultTextStyle = TextStyle( 106 | fontSize: 18.0, 107 | fontFamily: "Roboto", 108 | fontWeight: FontWeight.w500, 109 | color: Colors.black.withOpacity(0.54)); 110 | 111 | await tester.pumpWidget( 112 | MaterialApp( 113 | home: Material( 114 | child: GoogleSignInButton( 115 | onPressed: () {}, 116 | ), 117 | ), 118 | ), 119 | ); 120 | 121 | var text = find.byType(Text).evaluate().toList()[0].widget as Text; 122 | expect(text.style.fontSize, defaultTextStyle.fontSize); 123 | expect(text.style.fontWeight, defaultTextStyle.fontWeight); 124 | expect(text.style.color, defaultTextStyle.color); 125 | }); 126 | 127 | testWidgets('Check supplied text style is used', (WidgetTester tester) async { 128 | const suppliedTextStyle = TextStyle( 129 | color: Color(0xff000000), 130 | fontSize: 20, 131 | fontWeight: FontWeight.w700, 132 | fontFamily: "Roboto"); 133 | var buttonKey = UniqueKey(); 134 | 135 | await tester.pumpWidget( 136 | MaterialApp( 137 | home: Material( 138 | child: GoogleSignInButton( 139 | key: buttonKey, 140 | onPressed: () {}, 141 | textStyle: suppliedTextStyle, 142 | ), 143 | ), 144 | ), 145 | ); 146 | 147 | final GoogleSignInButton button = 148 | tester.firstWidget(find.byType(GoogleSignInButton)); 149 | expect(button.textStyle, suppliedTextStyle); 150 | }); 151 | 152 | testWidgets('Check supplied splash color is used', 153 | (WidgetTester tester) async { 154 | await tester.pumpWidget( 155 | MaterialApp( 156 | home: Material( 157 | child: GoogleSignInButton( 158 | onPressed: () {}, 159 | splashColor: Colors.white, 160 | ), 161 | ), 162 | ), 163 | ); 164 | 165 | var button = find.byType(StretchableButton).evaluate().toList()[0].widget 166 | as StretchableButton; 167 | expect(button.splashColor, Colors.white); 168 | }); 169 | 170 | testWidgets('Check default splash color is used', 171 | (WidgetTester tester) async { 172 | ButtonThemeData buttonTheme; 173 | 174 | await tester.pumpWidget(MaterialApp( 175 | home: Builder( 176 | builder: (BuildContext context) { 177 | buttonTheme = ButtonTheme.of(context); 178 | return GoogleSignInButton( 179 | onPressed: () {}, 180 | ); 181 | }, 182 | ), 183 | )); 184 | 185 | var button = 186 | find.byType(RaisedButton).evaluate().toList()[0].widget as RaisedButton; 187 | expect(buttonTheme.getSplashColor(button), 188 | buttonTheme.getTextColor(button).withOpacity(0.12)); 189 | }); 190 | } 191 | -------------------------------------------------------------------------------- /test/microsoft_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_auth_buttons/flutter_auth_buttons.dart'; 3 | import 'package:flutter_auth_buttons/src/button.dart'; 4 | import 'package:flutter_test/flutter_test.dart'; 5 | 6 | void main() { 7 | testWidgets('Check the onTap of the Button works', 8 | (WidgetTester tester) async { 9 | var microsoftButtonKey = UniqueKey(); 10 | var isTapped = false; 11 | 12 | await tester.pumpWidget( 13 | MaterialApp( 14 | home: Material( 15 | child: MicrosoftSignInButton( 16 | key: microsoftButtonKey, 17 | onPressed: () { 18 | isTapped = true; 19 | }, 20 | ), 21 | ), 22 | ), 23 | ); 24 | 25 | await tester.tap(find.byKey(microsoftButtonKey)); 26 | expect(isTapped, true); 27 | }); 28 | 29 | testWidgets('Check the default text provided is used', 30 | (WidgetTester tester) async { 31 | await tester.pumpWidget( 32 | MaterialApp( 33 | home: Material( 34 | child: MicrosoftSignInButton(), 35 | ), 36 | ), 37 | ); 38 | 39 | expect(find.text('Sign in with Microsoft'), findsOneWidget); 40 | }); 41 | 42 | testWidgets('Check the provided text is used', (WidgetTester tester) async { 43 | const buttonText = 'Sign up with Microsoft'; 44 | await tester.pumpWidget( 45 | MaterialApp( 46 | home: Material( 47 | child: MicrosoftSignInButton( 48 | text: buttonText, 49 | ), 50 | ), 51 | ), 52 | ); 53 | 54 | expect(find.text(buttonText), findsOneWidget); 55 | }); 56 | 57 | testWidgets('Check the default text style of the button is used', 58 | (WidgetTester tester) async { 59 | const defaultTextStyle = TextStyle( 60 | fontSize: 18.0, 61 | fontWeight: FontWeight.w600, 62 | color: Color(0xFF5E5E5E), 63 | ); 64 | 65 | await tester.pumpWidget( 66 | MaterialApp( 67 | home: Material( 68 | child: MicrosoftSignInButton(), 69 | ), 70 | ), 71 | ); 72 | 73 | var text = find.byType(Text).evaluate().toList()[0].widget as Text; 74 | expect(text.style.fontSize, defaultTextStyle.fontSize); 75 | expect(text.style.fontWeight, defaultTextStyle.fontWeight); 76 | expect(text.style.color, defaultTextStyle.color); 77 | }); 78 | 79 | testWidgets('Check the provided text style of the button is used', 80 | (WidgetTester tester) async { 81 | const providedTextStyle = TextStyle( 82 | fontSize: 22.0, 83 | fontWeight: FontWeight.w900, 84 | color: Color(0xff000000), 85 | ); 86 | 87 | await tester.pumpWidget( 88 | MaterialApp( 89 | home: Material( 90 | child: MicrosoftSignInButton( 91 | textStyle: providedTextStyle, 92 | ), 93 | ), 94 | ), 95 | ); 96 | 97 | final MicrosoftSignInButton microsoftSignInButton = 98 | tester.firstWidget(find.byType(MicrosoftSignInButton)); 99 | expect(microsoftSignInButton.textStyle, providedTextStyle); 100 | }); 101 | 102 | testWidgets('Check supplied splash color is used', 103 | (WidgetTester tester) async { 104 | await tester.pumpWidget( 105 | MaterialApp( 106 | home: Material( 107 | child: MicrosoftSignInButton( 108 | onPressed: () {}, 109 | splashColor: Colors.white, 110 | ), 111 | ), 112 | ), 113 | ); 114 | 115 | var button = find.byType(StretchableButton).evaluate().toList()[0].widget 116 | as StretchableButton; 117 | expect(button.splashColor, Colors.white); 118 | }); 119 | 120 | testWidgets('Check default splash color is used', 121 | (WidgetTester tester) async { 122 | ButtonThemeData buttonTheme; 123 | 124 | await tester.pumpWidget(MaterialApp( 125 | home: Builder( 126 | builder: (BuildContext context) { 127 | buttonTheme = ButtonTheme.of(context); 128 | return MicrosoftSignInButton( 129 | onPressed: () {}, 130 | ); 131 | }, 132 | ), 133 | )); 134 | 135 | var button = 136 | find.byType(RaisedButton).evaluate().toList()[0].widget as RaisedButton; 137 | expect(buttonTheme.getSplashColor(button), 138 | buttonTheme.getTextColor(button).withOpacity(0.12)); 139 | }); 140 | 141 | testWidgets('Check the default dark mode option of the button is used', 142 | (WidgetTester tester) async { 143 | await tester.pumpWidget( 144 | MaterialApp( 145 | home: Material( 146 | child: MicrosoftSignInButton(), 147 | ), 148 | ), 149 | ); 150 | final MicrosoftSignInButton microsoftSignInButton = 151 | tester.firstWidget(find.byType(MicrosoftSignInButton)); 152 | expect(microsoftSignInButton.darkMode, false); 153 | }); 154 | 155 | testWidgets('Check the provided dark mode option of the button is used', 156 | (WidgetTester tester) async { 157 | var microsoftButtonKey = UniqueKey(); 158 | 159 | var darkMode = true; 160 | 161 | await tester.pumpWidget( 162 | MaterialApp( 163 | home: Material( 164 | child: MicrosoftSignInButton( 165 | key: microsoftButtonKey, 166 | darkMode: darkMode, 167 | ), 168 | ), 169 | ), 170 | ); 171 | 172 | final MicrosoftSignInButton microsoftSignInButton = 173 | tester.firstWidget(find.byType(MicrosoftSignInButton)); 174 | expect(microsoftSignInButton.darkMode, darkMode); 175 | }); 176 | 177 | testWidgets('Check the default border radius of the button is used', 178 | (WidgetTester tester) async { 179 | await tester.pumpWidget( 180 | MaterialApp( 181 | home: Material( 182 | child: MicrosoftSignInButton(), 183 | ), 184 | ), 185 | ); 186 | final MicrosoftSignInButton microsoftSignInButton = 187 | tester.firstWidget(find.byType(MicrosoftSignInButton)); 188 | expect(microsoftSignInButton.borderRadius, 0.0); 189 | }); 190 | 191 | testWidgets('Check the provided border radius of the button is used', 192 | (WidgetTester tester) async { 193 | var microsoftButtonKey = UniqueKey(); 194 | 195 | var borderRadius = 20.0; 196 | 197 | await tester.pumpWidget( 198 | MaterialApp( 199 | home: Material( 200 | child: MicrosoftSignInButton( 201 | key: microsoftButtonKey, 202 | borderRadius: borderRadius, 203 | ), 204 | ), 205 | ), 206 | ); 207 | 208 | final MicrosoftSignInButton microsoftSignInButton = 209 | tester.firstWidget(find.byType(MicrosoftSignInButton)); 210 | expect(microsoftSignInButton.borderRadius, borderRadius); 211 | }); 212 | } 213 | -------------------------------------------------------------------------------- /test/twitter_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_auth_buttons/src/button.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:flutter_auth_buttons/flutter_auth_buttons.dart'; 5 | 6 | void main() { 7 | testWidgets('Check on tap works', (WidgetTester tester) async { 8 | var buttonKey = UniqueKey(); 9 | 10 | var testVal = false; 11 | 12 | await tester.pumpWidget( 13 | MaterialApp( 14 | home: Material( 15 | child: TwitterSignInButton( 16 | key: buttonKey, 17 | onPressed: () { 18 | testVal = true; 19 | }, 20 | ), 21 | ), 22 | ), 23 | ); 24 | 25 | await tester.tap(find.byKey(buttonKey)); 26 | expect(testVal, true); 27 | }); 28 | 29 | testWidgets('Check default text is used', (WidgetTester tester) async { 30 | await tester.pumpWidget( 31 | MaterialApp( 32 | home: Material( 33 | child: TwitterSignInButton( 34 | onPressed: () {}, 35 | ), 36 | ), 37 | ), 38 | ); 39 | 40 | expect(find.text("Sign in with Twitter"), findsOneWidget); 41 | }); 42 | 43 | testWidgets('Check supplied text is used', (WidgetTester tester) async { 44 | const suppliedText = "Hello, World!"; 45 | 46 | await tester.pumpWidget( 47 | MaterialApp( 48 | home: Material( 49 | child: TwitterSignInButton( 50 | onPressed: () {}, 51 | text: suppliedText, 52 | ), 53 | ), 54 | ), 55 | ); 56 | 57 | expect(find.text(suppliedText), findsOneWidget); 58 | }); 59 | 60 | testWidgets('Check default text style is used', (WidgetTester tester) async { 61 | const defaultTextStyle = TextStyle( 62 | fontSize: 18.0, fontWeight: FontWeight.bold, color: Color(0xFF555555)); 63 | 64 | await tester.pumpWidget( 65 | MaterialApp( 66 | home: Material( 67 | child: TwitterSignInButton( 68 | onPressed: () {}, 69 | ), 70 | ), 71 | ), 72 | ); 73 | 74 | var text = find.byType(Text).evaluate().toList()[0].widget as Text; 75 | expect(text.style.fontSize, defaultTextStyle.fontSize); 76 | expect(text.style.fontWeight, defaultTextStyle.fontWeight); 77 | expect(text.style.color, defaultTextStyle.color); 78 | }); 79 | 80 | testWidgets('Check supplied text style is used', (WidgetTester tester) async { 81 | const suppliedTextStyle = TextStyle( 82 | color: Color(0xff000000), 83 | fontSize: 20, 84 | fontWeight: FontWeight.w700, 85 | fontFamily: "Roboto"); 86 | var buttonKey = UniqueKey(); 87 | 88 | await tester.pumpWidget( 89 | MaterialApp( 90 | home: Material( 91 | child: TwitterSignInButton( 92 | key: buttonKey, 93 | onPressed: () {}, 94 | textStyle: suppliedTextStyle, 95 | ), 96 | ), 97 | ), 98 | ); 99 | 100 | final TwitterSignInButton button = 101 | tester.firstWidget(find.byType(TwitterSignInButton)); 102 | expect(button.textStyle, suppliedTextStyle); 103 | }); 104 | 105 | testWidgets('Check supplied splash color is used', 106 | (WidgetTester tester) async { 107 | await tester.pumpWidget( 108 | MaterialApp( 109 | home: Material( 110 | child: TwitterSignInButton( 111 | onPressed: () {}, 112 | splashColor: Colors.white, 113 | ), 114 | ), 115 | ), 116 | ); 117 | 118 | var button = find.byType(StretchableButton).evaluate().toList()[0].widget 119 | as StretchableButton; 120 | expect(button.splashColor, Colors.white); 121 | }); 122 | 123 | testWidgets('Check default splash color is used', 124 | (WidgetTester tester) async { 125 | ButtonThemeData buttonTheme; 126 | 127 | await tester.pumpWidget(MaterialApp( 128 | home: Builder( 129 | builder: (BuildContext context) { 130 | buttonTheme = ButtonTheme.of(context); 131 | return TwitterSignInButton( 132 | onPressed: () {}, 133 | ); 134 | }, 135 | ), 136 | )); 137 | 138 | var button = 139 | find.byType(RaisedButton).evaluate().toList()[0].widget as RaisedButton; 140 | expect(buttonTheme.getSplashColor(button), 141 | buttonTheme.getTextColor(button).withOpacity(0.12)); 142 | }); 143 | } 144 | --------------------------------------------------------------------------------