├── dart_test.yaml ├── CHANGELOG.md ├── example ├── ios │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner │ │ ├── Runner-Bridging-Header.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── 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-1024x1024@1x.png │ │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ │ └── Contents.json │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ ├── Main.storyboard │ │ │ └── LaunchScreen.storyboard │ │ └── Info.plist │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── project.pbxproj │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ └── .gitignore ├── web │ ├── favicon.png │ ├── icons │ │ ├── Icon-192.png │ │ ├── Icon-512.png │ │ ├── Icon-maskable-192.png │ │ └── Icon-maskable-512.png │ ├── manifest.json │ └── index.html ├── android │ ├── gradle.properties │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── values-night │ │ │ │ │ │ └── styles.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── settings.gradle │ └── build.gradle ├── .metadata ├── README.md ├── .gitignore ├── lib │ └── main.dart ├── analysis_options.yaml ├── pubspec.yaml └── pubspec.lock ├── assets ├── smileys.gif ├── flutter_02.png ├── flutter_03.png └── fonts │ └── Roboto-Black.ttf ├── test ├── src │ ├── goldens │ │ ├── ci │ │ │ ├── smiley_widget.png │ │ │ ├── smileys_dialog.png │ │ │ ├── smileys_selection.png │ │ │ └── smileys_bottom_sheet.png │ │ └── windows │ │ │ ├── smiley_widget.png │ │ │ ├── smileys_dialog.png │ │ │ ├── smileys_selection.png │ │ │ └── smileys_bottom_sheet.png │ ├── smileys_selection_test.dart │ ├── smileys_bottom_sheet_test.dart │ ├── smileys_dialog_test.dart │ └── smiley_widget_test.dart └── flutter_test_config.dart ├── .metadata ├── lib ├── smiley_ui.dart └── src │ ├── eye_curve.dart │ ├── smileys_selection.dart │ ├── smiley_expression.dart │ ├── smileys_dialog.dart │ ├── smileys_bottom_sheet.dart │ ├── smiley_widget.dart │ └── face_painter.dart ├── .github └── workflows │ ├── test.yaml │ └── web.yaml ├── pubspec.yaml ├── .gitignore ├── LICENSE ├── analysis_options.yaml ├── README.md └── pubspec.lock /dart_test.yaml: -------------------------------------------------------------------------------- 1 | tags: 2 | golden: -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /assets/smileys.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/assets/smileys.gif -------------------------------------------------------------------------------- /assets/flutter_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/assets/flutter_02.png -------------------------------------------------------------------------------- /assets/flutter_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/assets/flutter_03.png -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/web/favicon.png -------------------------------------------------------------------------------- /assets/fonts/Roboto-Black.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/assets/fonts/Roboto-Black.ttf -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /test/src/goldens/ci/smiley_widget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/test/src/goldens/ci/smiley_widget.png -------------------------------------------------------------------------------- /test/src/goldens/ci/smileys_dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/test/src/goldens/ci/smileys_dialog.png -------------------------------------------------------------------------------- /test/src/goldens/ci/smileys_selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/test/src/goldens/ci/smileys_selection.png -------------------------------------------------------------------------------- /test/src/goldens/ci/smileys_bottom_sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/test/src/goldens/ci/smileys_bottom_sheet.png -------------------------------------------------------------------------------- /test/src/goldens/windows/smiley_widget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/test/src/goldens/windows/smiley_widget.png -------------------------------------------------------------------------------- /test/src/goldens/windows/smileys_dialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/test/src/goldens/windows/smileys_dialog.png -------------------------------------------------------------------------------- /test/src/goldens/windows/smileys_selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/test/src/goldens/windows/smileys_selection.png -------------------------------------------------------------------------------- /test/src/goldens/windows/smileys_bottom_sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/test/src/goldens/windows/smileys_bottom_sheet.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/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/TesteurManiak/bastiui_smileys/HEAD/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/TesteurManiak/bastiui_smileys/HEAD/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/TesteurManiak/bastiui_smileys/HEAD/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/TesteurManiak/bastiui_smileys/HEAD/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/TesteurManiak/bastiui_smileys/HEAD/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/TesteurManiak/bastiui_smileys/HEAD/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/TesteurManiak/bastiui_smileys/HEAD/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/TesteurManiak/bastiui_smileys/HEAD/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/TesteurManiak/bastiui_smileys/HEAD/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/TesteurManiak/bastiui_smileys/HEAD/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/TesteurManiak/bastiui_smileys/HEAD/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/TesteurManiak/bastiui_smileys/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TesteurManiak/bastiui_smileys/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.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: c860cba910319332564e1e9d470a17074c1f2dfd 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /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: c860cba910319332564e1e9d470a17074c1f2dfd 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /lib/smiley_ui.dart: -------------------------------------------------------------------------------- 1 | library smiley_ui; 2 | 3 | export 'src/eye_curve.dart'; 4 | export 'src/face_painter.dart'; 5 | export 'src/smiley_expression.dart'; 6 | export 'src/smiley_widget.dart' hide kDefaultSmileySize; 7 | export 'src/smileys_bottom_sheet.dart'; 8 | export 'src/smileys_dialog.dart'; 9 | export 'src/smileys_selection.dart' hide kDefaultSmileyExpressions; 10 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/flutter_test_config.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:alchemist/alchemist.dart'; 4 | 5 | Future testExecutable(FutureOr Function() testMain) async { 6 | const isRunningInCi = bool.fromEnvironment('CI', defaultValue: false); 7 | 8 | return AlchemistConfig.runWithConfig( 9 | config: const AlchemistConfig( 10 | platformGoldensConfig: PlatformGoldensConfig( 11 | enabled: !isRunningInCi, 12 | ), 13 | ), 14 | run: testMain, 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.github/workflows/test.yaml: -------------------------------------------------------------------------------- 1 | name: Test workflow 2 | 3 | on: 4 | push: 5 | branches: [ main, dev ] 6 | pull_request: 7 | branches: [ main, dev ] 8 | 9 | jobs: 10 | test: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: subosito/flutter-action@v1.5.3 15 | - run: flutter packages get 16 | - name: Test 17 | run: flutter test --coverage --dart-define=CI=true 18 | - name: Collect and report coverage 19 | uses: coverallsapp/github-action@v1.1.2 20 | with: 21 | github-token: ${{ secrets.GITHUB_TOKEN }} -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: smiley_ui 2 | description: A new Flutter package project. 3 | version: 1.0.0 4 | homepage: https://github.com/TesteurManiak/bastiui_smileys 5 | 6 | environment: 7 | sdk: ">=2.16.2 <3.0.0" 8 | flutter: ">=1.17.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | 14 | dev_dependencies: 15 | alchemist: ^0.3.3 16 | flutter_lints: ^1.0.0 17 | flutter_test: 18 | sdk: flutter 19 | 20 | flutter: 21 | uses-material-design: true 22 | fonts: 23 | - family: Roboto 24 | fonts: 25 | - asset: assets/fonts/Roboto-Black.ttf 26 | weight: 900 27 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 25 | /pubspec.lock 26 | **/doc/api/ 27 | .dart_tool/ 28 | .packages 29 | build/ 30 | 31 | coverage/ 32 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /lib/src/eye_curve.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | /// Made by Aloïs Deniel: https://dartpad.dev/?id=1c6ebcd140a168d77776903101ce8fc9 4 | class EyeCurve extends Curve { 5 | final Duration period; 6 | final Duration blinking; 7 | 8 | const EyeCurve({required this.period, required this.blinking}); 9 | 10 | @override 11 | double transformInternal(double t) { 12 | final blinkingDuration = blinking.inMilliseconds / period.inMilliseconds; 13 | final startBlinking = 1.0 - blinkingDuration; 14 | if (t >= 1 || t < startBlinking) { 15 | return 1; 16 | } 17 | final relativeTime = (t - startBlinking) / blinkingDuration; 18 | if (relativeTime < 0.5) { 19 | return 1 - Curves.easeOut.transform(relativeTime * 2); 20 | } 21 | 22 | return Curves.easeIn.transform((relativeTime - 0.5) * 2); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /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 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /test/src/smileys_selection_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:alchemist/alchemist.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:smiley_ui/smiley_ui.dart'; 4 | 5 | void main() { 6 | group('SmileysSelection', () { 7 | goldenTest( 8 | 'SmileysSelection Golden Tests', 9 | fileName: 'smileys_selection', 10 | pumpBeforeTest: (tester) async { 11 | for (int i = 0; i < 10; i++) { 12 | await tester.pump(const Duration(seconds: 1)); 13 | } 14 | }, 15 | builder: () => GoldenTestGroup( 16 | children: [ 17 | GoldenTestScenario( 18 | name: 'default render', 19 | child: const SmileysSelection(), 20 | ), 21 | GoldenTestScenario( 22 | name: 'only sad faces', 23 | child: const SmileysSelection( 24 | expressions: [ 25 | SmileyExpression.sad, 26 | SmileyExpression.verySad, 27 | ], 28 | ), 29 | ), 30 | ], 31 | ), 32 | ); 33 | }); 34 | } 35 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /.github/workflows/web.yaml: -------------------------------------------------------------------------------- 1 | name: Web build workflow 2 | 3 | on: 4 | workflow_run: 5 | workflows: Test workflow 6 | branches: main 7 | types: completed 8 | 9 | defaults: 10 | run: 11 | working-directory: ./example 12 | jobs: 13 | build_web: 14 | name: Build Web 15 | runs-on: ubuntu-latest 16 | env: 17 | my_secret: ${{secrets.commit_secret}} 18 | steps: 19 | - uses: actions/checkout@v2 20 | - uses: subosito/flutter-action@v1.5.3 21 | - name: Install dependencies 22 | run: flutter packages get 23 | - name: Build web 24 | run: flutter build web --release --base-href "/bastiui_smileys/" 25 | - name: Publish 26 | run: | 27 | cd build/web 28 | git init 29 | git config --global user.email rouxguillaume8@gmail.com 30 | git config --global user.name "Guillaume Roux" 31 | git remote add origin https://${{secrets.commit_secret}}@github.com/TesteurManiak/bastiui_smileys.git 32 | git checkout -b gh-pages 33 | git add --all 34 | git commit -m "update" 35 | git push origin gh-pages -f 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Guillaume Roux 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:smiley_ui/smiley_ui.dart'; 3 | 4 | void main() => runApp(const MyApp()); 5 | 6 | class MyApp extends StatelessWidget { 7 | const MyApp({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return MaterialApp( 12 | theme: ThemeData.dark(), 13 | home: const MyHomePage(), 14 | ); 15 | } 16 | } 17 | 18 | class MyHomePage extends StatefulWidget { 19 | const MyHomePage({Key? key}) : super(key: key); 20 | 21 | @override 22 | State createState() => _MyHomePageState(); 23 | } 24 | 25 | class _MyHomePageState extends State { 26 | @override 27 | Widget build(BuildContext context) { 28 | return Scaffold( 29 | body: Center( 30 | child: Column( 31 | mainAxisSize: MainAxisSize.min, 32 | children: [ 33 | const SmileysSelection(), 34 | const SizedBox(height: 8), 35 | ElevatedButton( 36 | onPressed: () => showSmileysBottomSheet(context), 37 | child: const Text('Show bottom sheet'), 38 | ), 39 | const SizedBox(height: 8), 40 | ElevatedButton( 41 | onPressed: () => showSmileysDialog(context), 42 | child: const Text('Show dialog'), 43 | ), 44 | ], 45 | ), 46 | ), 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /test/src/smileys_bottom_sheet_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:alchemist/alchemist.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:smiley_ui/smiley_ui.dart'; 5 | 6 | void main() { 7 | group('SmileysBottomSheet', () { 8 | goldenTest( 9 | 'SmileysBottomSheet Golden Tests', 10 | fileName: 'smileys_bottom_sheet', 11 | pumpBeforeTest: (tester) async { 12 | for (int i = 0; i < 10; i++) { 13 | await tester.pump(const Duration(seconds: 1)); 14 | } 15 | }, 16 | builder: () => GoldenTestGroup( 17 | children: [ 18 | GoldenTestScenario( 19 | name: 'default', 20 | child: const SmileysBottomSheet(), 21 | ), 22 | GoldenTestScenario( 23 | name: 'title: Test', 24 | child: const SmileysBottomSheet( 25 | title: 'Test', 26 | ), 27 | ), 28 | GoldenTestScenario( 29 | name: 'submitButtonText: Test', 30 | child: const SmileysBottomSheet( 31 | submitButtonText: 'Test', 32 | ), 33 | ), 34 | GoldenTestScenario( 35 | name: 'red button', 36 | child: SmileysBottomSheet( 37 | submitButtonStyle: ButtonStyle( 38 | foregroundColor: MaterialStateProperty.all(Colors.red), 39 | ), 40 | ), 41 | ), 42 | ], 43 | ), 44 | ); 45 | }); 46 | } 47 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /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 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | 3 | analyzer: 4 | exclude: 5 | - lib/**.g.dart 6 | - test/**.mocks.dart 7 | - lib/generated_plugin_registrant.dart 8 | strong-mode: 9 | implicit-casts: false 10 | errors: 11 | missing_required_param: error 12 | unrelated_type_equality_checks: error 13 | missing_return: warning 14 | close_sinks: warning 15 | cancel_subscriptions: warning 16 | parameter_assignments: warning 17 | prefer_final_in_for_each: warning 18 | prefer_mixin: warning 19 | unawaited_futures: warning 20 | unnecessary_await_in_return: warning 21 | unnecessary_null_aware_assignments: warning 22 | use_string_buffers: warning 23 | avoid_unnecessary_containers: warning 24 | 25 | linter: 26 | rules: 27 | - always_declare_return_types 28 | - avoid_bool_literals_in_conditional_expressions 29 | - avoid_escaping_inner_quotes 30 | - avoid_positional_boolean_parameters 31 | - parameter_assignments 32 | - prefer_null_aware_method_calls 33 | - require_trailing_commas 34 | - use_is_even_rather_than_modulo 35 | - use_named_constants 36 | - use_to_and_as_if_applicable 37 | - prefer_relative_imports 38 | - avoid_unused_constructor_parameters 39 | - sort_child_properties_last 40 | - directives_ordering 41 | - close_sinks 42 | - cancel_subscriptions 43 | - unnecessary_statements 44 | - avoid_annotating_with_dynamic 45 | - prefer_final_locals 46 | - prefer_final_in_for_each 47 | - prefer_interpolation_to_compose_strings 48 | - prefer_mixin 49 | - unawaited_futures 50 | - unnecessary_await_in_return 51 | - unnecessary_lambdas 52 | - unnecessary_null_aware_assignments 53 | - unnecessary_parenthesis 54 | - unnecessary_raw_strings 55 | - use_if_null_to_convert_nulls_to_bools 56 | - use_string_buffers 57 | - avoid_unnecessary_containers 58 | - use_build_context_synchronously 59 | -------------------------------------------------------------------------------- /test/src/smileys_dialog_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:alchemist/alchemist.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:smiley_ui/smiley_ui.dart'; 5 | 6 | void main() { 7 | group('SmileysDialog', () { 8 | goldenTest( 9 | 'SmileysDialog Golden Tests', 10 | fileName: 'smileys_dialog', 11 | pumpBeforeTest: (tester) async { 12 | for (int i = 0; i < 10; i++) { 13 | await tester.pump(const Duration(seconds: 1)); 14 | } 15 | }, 16 | builder: () => GoldenTestGroup( 17 | children: [ 18 | GoldenTestScenario( 19 | name: 'default', 20 | child: const SmileysDialog(), 21 | ), 22 | GoldenTestScenario( 23 | name: 'title: Test', 24 | child: const SmileysDialog( 25 | title: 'Test', 26 | ), 27 | ), 28 | GoldenTestScenario( 29 | name: 'submitButtonText: Test', 30 | child: const SmileysDialog( 31 | submitButtonText: 'Test', 32 | ), 33 | ), 34 | GoldenTestScenario( 35 | name: 'cancelButtonText: Test', 36 | child: const SmileysDialog( 37 | cancelButtonText: 'Test', 38 | ), 39 | ), 40 | GoldenTestScenario( 41 | name: 'red submit button', 42 | child: SmileysDialog( 43 | submitButtonStyle: ButtonStyle( 44 | foregroundColor: MaterialStateProperty.all(Colors.red), 45 | ), 46 | ), 47 | ), 48 | GoldenTestScenario( 49 | name: 'red cancel button', 50 | child: SmileysDialog( 51 | cancelButtonStyle: ButtonStyle( 52 | foregroundColor: MaterialStateProperty.all(Colors.red), 53 | ), 54 | ), 55 | ), 56 | ], 57 | ), 58 | ); 59 | }); 60 | } 61 | -------------------------------------------------------------------------------- /test/src/smiley_widget_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:alchemist/alchemist.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:smiley_ui/smiley_ui.dart'; 4 | 5 | void main() { 6 | group('SmileyWidget', () { 7 | goldenTest( 8 | 'SmileyWidget Golden Tests', 9 | fileName: 'smiley_widget', 10 | pumpBeforeTest: (tester) async { 11 | for (int i = 0; i < 10; i++) { 12 | await tester.pump(const Duration(seconds: 1)); 13 | } 14 | }, 15 | builder: () => GoldenTestGroup( 16 | children: [ 17 | GoldenTestScenario( 18 | name: 'verySad', 19 | child: const SmileyWidget( 20 | expression: SmileyExpression.verySad, 21 | ), 22 | ), 23 | GoldenTestScenario( 24 | name: 'sad', 25 | child: const SmileyWidget( 26 | expression: SmileyExpression.sad, 27 | ), 28 | ), 29 | GoldenTestScenario( 30 | name: 'neutral', 31 | child: const SmileyWidget( 32 | expression: SmileyExpression.neutral, 33 | ), 34 | ), 35 | GoldenTestScenario( 36 | name: 'happy', 37 | child: const SmileyWidget( 38 | expression: SmileyExpression.happy, 39 | ), 40 | ), 41 | GoldenTestScenario( 42 | name: 'veryHappy', 43 | child: const SmileyWidget( 44 | expression: SmileyExpression.veryHappy, 45 | ), 46 | ), 47 | GoldenTestScenario( 48 | name: 'veryHappy - selected', 49 | child: const SmileyWidget( 50 | expression: SmileyExpression.veryHappy, 51 | isSelected: true, 52 | ), 53 | ), 54 | GoldenTestScenario( 55 | name: 'veryHappy - disabled', 56 | child: const SmileyWidget( 57 | expression: SmileyExpression.veryHappy, 58 | isEnabled: false, 59 | ), 60 | ), 61 | ], 62 | ), 63 | ); 64 | }); 65 | } 66 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.example.example" 47 | minSdkVersion flutter.minSdkVersion 48 | targetSdkVersion flutter.targetSdkVersion 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | release { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig signingConfigs.debug 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source '../..' 64 | } 65 | 66 | dependencies { 67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 68 | } 69 | -------------------------------------------------------------------------------- /lib/src/smileys_selection.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'smiley_expression.dart'; 4 | import 'smiley_widget.dart'; 5 | 6 | const kDefaultSmileyExpressions = [ 7 | SmileyExpression.verySad, 8 | SmileyExpression.sad, 9 | SmileyExpression.neutral, 10 | SmileyExpression.happy, 11 | SmileyExpression.veryHappy, 12 | ]; 13 | 14 | typedef SmileySelectionCallback = void Function( 15 | SmileyExpression? smileySelected, 16 | ); 17 | 18 | class SmileysSelection extends StatefulWidget { 19 | /// List of smiley expressions to display. 20 | final List expressions; 21 | 22 | /// Callback triggered when the user selects or unselect a smiley. 23 | final SmileySelectionCallback? onSmileySelected; 24 | 25 | /// Create a widget which displays a list of smileys and allows selection. 26 | const SmileysSelection({ 27 | Key? key, 28 | this.expressions = kDefaultSmileyExpressions, 29 | this.onSmileySelected, 30 | }) : super(key: key); 31 | 32 | @override 33 | State createState() => _SmileysSelectionState(); 34 | } 35 | 36 | class _SmileysSelectionState extends State { 37 | SmileyExpression? _selectedExpression; 38 | 39 | void _onSmileyTapped(SmileyExpression expression) { 40 | if (_selectedExpression == expression) { 41 | setState(() => _selectedExpression = null); 42 | } else { 43 | setState(() => _selectedExpression = expression); 44 | } 45 | widget.onSmileySelected?.call(_selectedExpression); 46 | } 47 | 48 | @override 49 | Widget build(BuildContext context) { 50 | return ConstrainedBox( 51 | constraints: const BoxConstraints(minHeight: kDefaultSmileySize * 1.2), 52 | child: Wrap( 53 | spacing: 8, 54 | runSpacing: 8, 55 | crossAxisAlignment: WrapCrossAlignment.center, 56 | alignment: WrapAlignment.center, 57 | runAlignment: WrapAlignment.center, 58 | children: widget.expressions.map((expression) { 59 | return SmileyWidget( 60 | expression: expression, 61 | isSelected: _selectedExpression == expression, 62 | isEnabled: _selectedExpression == null, 63 | onTap: () => _onSmileyTapped(expression), 64 | ); 65 | }).toList(), 66 | ), 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/src/smiley_expression.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'face_painter.dart'; 4 | 5 | class SmileyExpression { 6 | /// Initial top offset of the face. 7 | final double topPos; 8 | 9 | /// Initial right offset of the face. 10 | final double rightPos; 11 | 12 | /// Color of the face. 13 | final Color color; 14 | 15 | /// [CustomPainter] that draws the face. 16 | final FacePainter _face; 17 | 18 | /// Duration before the smiley's animation is triggered. 19 | final Duration period; 20 | 21 | const SmileyExpression({ 22 | required this.topPos, 23 | this.rightPos = 8.0, 24 | required this.color, 25 | required FacePainter facePainter, 26 | this.period = const Duration(seconds: 2), 27 | }) : _face = facePainter; 28 | 29 | static const verySad = SmileyExpression( 30 | topPos: 34, 31 | color: Color(0xFFFF603E), 32 | facePainter: VerySadFacePainter(), 33 | period: Duration(milliseconds: 1400), 34 | ); 35 | 36 | static const sad = SmileyExpression( 37 | topPos: 28, 38 | color: Color(0xFFFF833E), 39 | facePainter: SadFacePainter(), 40 | period: Duration(milliseconds: 2400), 41 | ); 42 | 43 | static const neutral = SmileyExpression( 44 | topPos: 24, 45 | color: Color(0xFFFFC061), 46 | facePainter: NeutralFacePainter(), 47 | period: Duration(milliseconds: 3200), 48 | ); 49 | 50 | static const happy = SmileyExpression( 51 | topPos: 18, 52 | color: Color(0xFFFFD43E), 53 | facePainter: HappyFacePainter(), 54 | period: Duration(milliseconds: 4000), 55 | ); 56 | 57 | static const veryHappy = SmileyExpression( 58 | topPos: 12, 59 | rightPos: 10, 60 | color: Color(0xFFFFED4E), 61 | facePainter: VeryHappyFacePainter(), 62 | period: Duration(milliseconds: 4800), 63 | ); 64 | 65 | FacePainter createPainter(Animation animation) => 66 | _face.copyWith(eyeOpening: animation); 67 | 68 | @override 69 | bool operator ==(Object other) { 70 | if (identical(this, other)) return true; 71 | 72 | return other is SmileyExpression && 73 | other.topPos == topPos && 74 | other.rightPos == rightPos && 75 | other.color == color && 76 | other._face == _face && 77 | other.period == period; 78 | } 79 | 80 | @override 81 | int get hashCode { 82 | return topPos.hashCode ^ 83 | rightPos.hashCode ^ 84 | color.hashCode ^ 85 | _face.hashCode ^ 86 | period.hashCode; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/src/smileys_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'smiley_expression.dart'; 4 | import 'smileys_selection.dart'; 5 | 6 | const _kDefaultTitle = 'How was your experience?'; 7 | const _kDefaultSubmitText = 'Submit'; 8 | const _kDefaultCancelText = 'Cancel'; 9 | 10 | class SmileysDialog extends StatefulWidget { 11 | final String? title; 12 | final String? submitButtonText; 13 | final String? cancelButtonText; 14 | final ButtonStyle? submitButtonStyle; 15 | final ButtonStyle? cancelButtonStyle; 16 | 17 | const SmileysDialog({ 18 | Key? key, 19 | this.title, 20 | this.submitButtonText, 21 | this.cancelButtonText, 22 | this.submitButtonStyle, 23 | this.cancelButtonStyle, 24 | }) : super(key: key); 25 | 26 | @override 27 | State createState() => _SmileysDialogState(); 28 | } 29 | 30 | class _SmileysDialogState extends State { 31 | final _selectedExpression = ValueNotifier(null); 32 | 33 | @override 34 | void dispose() { 35 | _selectedExpression.dispose(); 36 | super.dispose(); 37 | } 38 | 39 | @override 40 | Widget build(BuildContext context) { 41 | final title = widget.title ?? _kDefaultTitle; 42 | final submitButtonText = widget.submitButtonText ?? _kDefaultSubmitText; 43 | final cancelButtonText = widget.cancelButtonText ?? _kDefaultCancelText; 44 | 45 | return AlertDialog( 46 | title: Text(title), 47 | content: SmileysSelection( 48 | expressions: kDefaultSmileyExpressions, 49 | onSmileySelected: (smileySelected) => 50 | _selectedExpression.value = smileySelected, 51 | ), 52 | actions: [ 53 | TextButton( 54 | style: widget.cancelButtonStyle, 55 | onPressed: () => Navigator.pop(context), 56 | child: Text(cancelButtonText), 57 | ), 58 | ValueListenableBuilder( 59 | valueListenable: _selectedExpression, 60 | builder: (context, selectedExpression, _) { 61 | return ElevatedButton( 62 | style: widget.submitButtonStyle, 63 | onPressed: selectedExpression != null 64 | ? () => Navigator.pop(context, selectedExpression) 65 | : null, 66 | child: Text(submitButtonText), 67 | ); 68 | }, 69 | ), 70 | ], 71 | ); 72 | } 73 | } 74 | 75 | Future showSmileysDialog( 76 | BuildContext context, { 77 | String? title, 78 | String? submitButtonText, 79 | String? cancelButtonText, 80 | ButtonStyle? submitButtonStyle, 81 | ButtonStyle? cancelButtonStyle, 82 | }) { 83 | return showDialog( 84 | context: context, 85 | builder: (_) => SmileysDialog( 86 | title: title, 87 | submitButtonText: submitButtonText, 88 | cancelButtonText: cancelButtonText, 89 | submitButtonStyle: submitButtonStyle, 90 | cancelButtonStyle: cancelButtonStyle, 91 | ), 92 | ); 93 | } 94 | -------------------------------------------------------------------------------- /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.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /lib/src/smileys_bottom_sheet.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'smiley_expression.dart'; 4 | import 'smileys_selection.dart'; 5 | 6 | const _kDefaultTitle = 'How was your experience?'; 7 | const _kDefaultSubmitText = 'Submit'; 8 | 9 | class SmileysBottomSheet extends StatefulWidget { 10 | /// Title of the bottom sheet. 11 | /// 12 | /// By default, the title is `"How was your experience?"`. 13 | /// 14 | /// Its [TextStyle] is based on the value of [ThemeData.textTheme.headline6]. 15 | final String? title; 16 | 17 | /// Text that will be used for the submit button. 18 | /// 19 | /// By default, the submit button text is `"Submit"`. 20 | final String? submitButtonText; 21 | 22 | /// [ButtonStyle] used for the submit button. 23 | final ButtonStyle? submitButtonStyle; 24 | 25 | /// Widget to use as the content of a bottom sheet. 26 | /// 27 | /// This widget will display the [SmileysSelection] widget alongside a title 28 | /// and a submit button which will be disabled while the user did not select 29 | /// a smiley. 30 | const SmileysBottomSheet({ 31 | Key? key, 32 | this.title, 33 | this.submitButtonText, 34 | this.submitButtonStyle, 35 | }) : super(key: key); 36 | 37 | @override 38 | State createState() => _SmileysBottomSheetState(); 39 | } 40 | 41 | class _SmileysBottomSheetState extends State { 42 | final _selectedExpression = ValueNotifier(null); 43 | 44 | @override 45 | void dispose() { 46 | _selectedExpression.dispose(); 47 | super.dispose(); 48 | } 49 | 50 | @override 51 | Widget build(BuildContext context) { 52 | final title = widget.title ?? _kDefaultTitle; 53 | final submitButtonText = widget.submitButtonText ?? _kDefaultSubmitText; 54 | 55 | return Padding( 56 | padding: const EdgeInsets.all(16), 57 | child: Column( 58 | children: [ 59 | Align( 60 | alignment: Alignment.topLeft, 61 | child: IconButton( 62 | icon: const Icon(Icons.close_rounded), 63 | onPressed: () => Navigator.pop(context), 64 | ), 65 | ), 66 | Padding( 67 | padding: const EdgeInsets.symmetric(vertical: 16), 68 | child: Text(title, style: Theme.of(context).textTheme.headline6), 69 | ), 70 | SmileysSelection( 71 | onSmileySelected: (smileySelected) => 72 | _selectedExpression.value = smileySelected, 73 | ), 74 | const SizedBox(height: 16), 75 | ValueListenableBuilder( 76 | valueListenable: _selectedExpression, 77 | builder: (context, selectedExpression, _) { 78 | return TextButton( 79 | onPressed: selectedExpression != null 80 | ? () => Navigator.pop(context, selectedExpression) 81 | : null, 82 | style: widget.submitButtonStyle, 83 | child: Text(submitButtonText), 84 | ); 85 | }, 86 | ), 87 | ], 88 | ), 89 | ); 90 | } 91 | } 92 | 93 | /// Shows a modal bottom sheet that contains a [SmileysBottomSheet]. 94 | Future showSmileysBottomSheet( 95 | BuildContext context, { 96 | String? title, 97 | String? submitButtonText, 98 | }) { 99 | return showModalBottomSheet( 100 | context: context, 101 | shape: const RoundedRectangleBorder( 102 | borderRadius: BorderRadius.vertical(top: Radius.circular(16)), 103 | ), 104 | builder: (_) => SmileysBottomSheet( 105 | title: title, 106 | submitButtonText: submitButtonText, 107 | ), 108 | ); 109 | } 110 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # smiley_ui 2 | 3 | [![GitHub stars](https://img.shields.io/github/stars/TesteurManiak/bastiui_smileys)](https://github.com/TesteurManiak/bastiui_smileys/stargazers) 4 | [![GitHub license](https://img.shields.io/github/license/TesteurManiak/bastiui_smileys)](https://github.com/TesteurManiak/bastiui_smileys/blob/main/LICENSE) 5 | [![Coverage Status](https://coveralls.io/repos/github/TesteurManiak/bastiui_smileys/badge.svg?branch=main)](https://coveralls.io/github/TesteurManiak/bastiui_smileys?branch=main) 6 | 7 | Implementation of BastiUi design in Flutter. (Inspired by [Aloïs Deniel implementation](https://twitter.com/aloisdeniel/status/1518564668935217153)) 8 | 9 | ![](assets/smileys.gif) 10 | 11 | [Try the demo](https://rouxguillau.me/bastiui_smileys/#/) 12 | 13 | # Getting started 14 | 15 | For now this package is not available on pub.dev so, you can add the package by adding the following to your pubspec.yaml: 16 | 17 | ```yaml 18 | smiley_ui: 19 | git: 20 | url: https://github.com/TesteurManiak/bastiui_smileys.git 21 | ref: main # Optional, use it if you want a specific branch or tag. 22 | ``` 23 | 24 | # Documentation 25 | 26 | ## [`SmileyWidget`](lib/src/smiley_widget.dart) 27 | 28 | Base widget which draws an animated smiley. 29 | 30 | ### Code Sample 31 | 32 | ```dart 33 | SmileyWidget( 34 | expression: SmileyExpression.happy, 35 | ); 36 | ``` 37 | 38 | ### Screenshot 39 | 40 | SmileyWidget 41 | 42 | ### Supported Parameters 43 | 44 | * `expression`: The expression of the smiley. 45 | * `isSelected`: Selection state of the smiley. 46 | * `isEnabled`: Define if the widget is enabled or not. (Manage the opacity on the widget) 47 | * `onTap`: Callback when the widget is tapped on. 48 | 49 | ## [`SmileysSelection`](lib/src/smileys_selection.dart) 50 | 51 | Widget which displays a list of smileys and allows selection. 52 | 53 | ### Code Sample 54 | 55 | ```dart 56 | SmileysSelection(); 57 | ``` 58 | 59 | ### Screenshot 60 | 61 | SmileysSelection 62 | 63 | ### Supported Parameters 64 | 65 | * `expressions`: List of smiley expressions to display. 66 | * `onSmileySelected`: Callback triggered when the user selects or unselect a smiley. 67 | 68 | ## [`SmileyBottomSheet`](lib/src/smileys_bottom_sheet.dart) 69 | 70 | Widget to use as the content of a bottom sheet. 71 | 72 | This widget will display the `SmileysSelection` widget alongside a title and a submit button which will be disabled while the user did not select a smiley. 73 | 74 | ### Code Sample 75 | 76 | ```dart 77 | SmileyBottomSheet(); 78 | 79 | // Or use 80 | showSmileysBottomSheet(context); 81 | ``` 82 | 83 | ### Screenshot 84 | 85 | SmileyBottomSheet 86 | 87 | ### Supported Parameters 88 | 89 | * `title`: Title of the bottom sheet. 90 | * `submitButtonText`: Text that will be used for the submit button. 91 | * `submitButtonStyle`: `ButtonStyle` used for the submit button. 92 | 93 | ## [`SmileysDialog`](lib/src/smileys_dialog.dart) 94 | 95 | Dialog which contains the `SmileysSelection` widget. 96 | 97 | ### Code Sample 98 | 99 | ```dart 100 | SmileysDialog(); 101 | 102 | // Or use 103 | showSmileysDialog(context); 104 | ``` 105 | 106 | ### Screenshot 107 | 108 | SmileysDialog 109 | 110 | ### Supported Parameters 111 | 112 | * `title`: Title of the dialog. 113 | * `submitButtonText`: Text of the submit button. 114 | * `cancelButtonText`: Text of the cancel button. 115 | * `submitButtonStyle`: Style of the submit button. 116 | * `cancelButtonStyle`: Style of the cancel button. 117 | 118 | ## Credits 119 | 120 | * [BastiUi video](https://youtu.be/NIz7EiyunmY) 121 | * [BastiUi Figma](https://www.figma.com/community/file/1095723917861848844) 122 | * [Aloïs Deniel video](https://youtu.be/JJv-8lF_xAA) 123 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `flutter pub publish`. This is preferred for private packages. 6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.16.2 <3.0.0" 22 | 23 | # Dependencies specify other packages that your package needs in order to work. 24 | # To automatically upgrade your package dependencies to the latest versions 25 | # consider running `flutter pub upgrade --major-versions`. Alternatively, 26 | # dependencies can be manually updated by changing the version numbers below to 27 | # the latest version available on pub.dev. To see which dependencies have newer 28 | # versions available, run `flutter pub outdated`. 29 | dependencies: 30 | flutter: 31 | sdk: flutter 32 | smiley_ui: 33 | path: ../ 34 | 35 | 36 | # The following adds the Cupertino Icons font to your application. 37 | # Use with the CupertinoIcons class for iOS style icons. 38 | cupertino_icons: ^1.0.2 39 | 40 | dev_dependencies: 41 | flutter_test: 42 | sdk: flutter 43 | 44 | # The "flutter_lints" package below contains a set of recommended lints to 45 | # encourage good coding practices. The lint set provided by the package is 46 | # activated in the `analysis_options.yaml` file located at the root of your 47 | # package. See that file for information about deactivating specific lint 48 | # rules and activating additional ones. 49 | flutter_lints: ^1.0.0 50 | 51 | # For information on the generic Dart part of this file, see the 52 | # following page: https://dart.dev/tools/pub/pubspec 53 | 54 | # The following section is specific to Flutter. 55 | flutter: 56 | 57 | # The following line ensures that the Material Icons font is 58 | # included with your application, so that you can use the icons in 59 | # the material Icons class. 60 | uses-material-design: true 61 | 62 | # To add assets to your application, add an assets section, like this: 63 | # assets: 64 | # - images/a_dot_burr.jpeg 65 | # - images/a_dot_ham.jpeg 66 | 67 | # An image asset can refer to one or more resolution-specific "variants", see 68 | # https://flutter.dev/assets-and-images/#resolution-aware. 69 | 70 | # For details regarding adding assets from package dependencies, see 71 | # https://flutter.dev/assets-and-images/#from-packages 72 | 73 | # To add custom fonts to your application, add a fonts section here, 74 | # in this "flutter" section. Each entry in this list should have a 75 | # "family" key with the font family name, and a "fonts" key with a 76 | # list giving the asset and other descriptors for the font. For 77 | # example: 78 | # fonts: 79 | # - family: Schyler 80 | # fonts: 81 | # - asset: fonts/Schyler-Regular.ttf 82 | # - asset: fonts/Schyler-Italic.ttf 83 | # style: italic 84 | # - family: Trajan Pro 85 | # fonts: 86 | # - asset: fonts/TrajanPro.ttf 87 | # - asset: fonts/TrajanPro_Bold.ttf 88 | # weight: 700 89 | # 90 | # For details regarding fonts from package dependencies, 91 | # see https://flutter.dev/custom-fonts/#from-packages 92 | -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | example 33 | 34 | 35 | 36 | 39 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.8.2" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.1.0" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.2.0" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.3.1" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.0" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.15.0" 46 | cupertino_icons: 47 | dependency: "direct main" 48 | description: 49 | name: cupertino_icons 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.0.4" 53 | fake_async: 54 | dependency: transitive 55 | description: 56 | name: fake_async 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "1.2.0" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_lints: 66 | dependency: "direct dev" 67 | description: 68 | name: flutter_lints 69 | url: "https://pub.dartlang.org" 70 | source: hosted 71 | version: "1.0.4" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | lints: 78 | dependency: transitive 79 | description: 80 | name: lints 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "1.0.1" 84 | matcher: 85 | dependency: transitive 86 | description: 87 | name: matcher 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "0.12.11" 91 | material_color_utilities: 92 | dependency: transitive 93 | description: 94 | name: material_color_utilities 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.1.3" 98 | meta: 99 | dependency: transitive 100 | description: 101 | name: meta 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.7.0" 105 | path: 106 | dependency: transitive 107 | description: 108 | name: path 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.8.0" 112 | sky_engine: 113 | dependency: transitive 114 | description: flutter 115 | source: sdk 116 | version: "0.0.99" 117 | smiley_ui: 118 | dependency: "direct main" 119 | description: 120 | path: ".." 121 | relative: true 122 | source: path 123 | version: "1.0.0" 124 | source_span: 125 | dependency: transitive 126 | description: 127 | name: source_span 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "1.8.1" 131 | stack_trace: 132 | dependency: transitive 133 | description: 134 | name: stack_trace 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "1.10.0" 138 | stream_channel: 139 | dependency: transitive 140 | description: 141 | name: stream_channel 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "2.1.0" 145 | string_scanner: 146 | dependency: transitive 147 | description: 148 | name: string_scanner 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.1.0" 152 | term_glyph: 153 | dependency: transitive 154 | description: 155 | name: term_glyph 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "1.2.0" 159 | test_api: 160 | dependency: transitive 161 | description: 162 | name: test_api 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "0.4.8" 166 | typed_data: 167 | dependency: transitive 168 | description: 169 | name: typed_data 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.3.0" 173 | vector_math: 174 | dependency: transitive 175 | description: 176 | name: vector_math 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "2.1.1" 180 | sdks: 181 | dart: ">=2.16.2 <3.0.0" 182 | flutter: ">=1.17.0" 183 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | alchemist: 5 | dependency: "direct dev" 6 | description: 7 | name: alchemist 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "0.3.3" 11 | async: 12 | dependency: transitive 13 | description: 14 | name: async 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.8.2" 18 | boolean_selector: 19 | dependency: transitive 20 | description: 21 | name: boolean_selector 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.1.0" 25 | characters: 26 | dependency: transitive 27 | description: 28 | name: characters 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.2.0" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.3.1" 39 | clock: 40 | dependency: transitive 41 | description: 42 | name: clock 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.0" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.15.0" 53 | equatable: 54 | dependency: transitive 55 | description: 56 | name: equatable 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.0.3" 60 | fake_async: 61 | dependency: transitive 62 | description: 63 | name: fake_async 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "1.2.0" 67 | flutter: 68 | dependency: "direct main" 69 | description: flutter 70 | source: sdk 71 | version: "0.0.0" 72 | flutter_lints: 73 | dependency: "direct dev" 74 | description: 75 | name: flutter_lints 76 | url: "https://pub.dartlang.org" 77 | source: hosted 78 | version: "1.0.4" 79 | flutter_test: 80 | dependency: "direct dev" 81 | description: flutter 82 | source: sdk 83 | version: "0.0.0" 84 | lints: 85 | dependency: transitive 86 | description: 87 | name: lints 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "1.0.1" 91 | matcher: 92 | dependency: transitive 93 | description: 94 | name: matcher 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.12.11" 98 | material_color_utilities: 99 | dependency: transitive 100 | description: 101 | name: material_color_utilities 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "0.1.3" 105 | meta: 106 | dependency: transitive 107 | description: 108 | name: meta 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.7.0" 112 | path: 113 | dependency: transitive 114 | description: 115 | name: path 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "1.8.0" 119 | sky_engine: 120 | dependency: transitive 121 | description: flutter 122 | source: sdk 123 | version: "0.0.99" 124 | source_span: 125 | dependency: transitive 126 | description: 127 | name: source_span 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "1.8.1" 131 | stack_trace: 132 | dependency: transitive 133 | description: 134 | name: stack_trace 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "1.10.0" 138 | stream_channel: 139 | dependency: transitive 140 | description: 141 | name: stream_channel 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "2.1.0" 145 | string_scanner: 146 | dependency: transitive 147 | description: 148 | name: string_scanner 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.1.0" 152 | term_glyph: 153 | dependency: transitive 154 | description: 155 | name: term_glyph 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "1.2.0" 159 | test_api: 160 | dependency: transitive 161 | description: 162 | name: test_api 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "0.4.8" 166 | typed_data: 167 | dependency: transitive 168 | description: 169 | name: typed_data 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.3.0" 173 | vector_math: 174 | dependency: transitive 175 | description: 176 | name: vector_math 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "2.1.1" 180 | sdks: 181 | dart: ">=2.16.2 <3.0.0" 182 | flutter: ">=2.10.4" 183 | -------------------------------------------------------------------------------- /lib/src/smiley_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'eye_curve.dart'; 4 | import 'smiley_expression.dart'; 5 | 6 | const kDefaultSmileySize = 56.0; 7 | 8 | class SmileyWidget extends StatefulWidget { 9 | /// The expression of the smiley. 10 | final SmileyExpression expression; 11 | 12 | /// Selection state of the widget. By default it is `false`. 13 | /// 14 | /// If `true` the widget will be drawn with a white border. 15 | final bool isSelected; 16 | 17 | /// Define if the widget is enabled or not. By default it is `true`. 18 | /// 19 | /// If `false` the widget will be drawn with a `0.5` opacity. 20 | final bool isEnabled; 21 | 22 | /// Callback triggered when the widget is tapped on. 23 | final VoidCallback? onTap; 24 | 25 | /// Create a widget which draws an animated smiley face. 26 | const SmileyWidget({ 27 | Key? key, 28 | required this.expression, 29 | this.isSelected = false, 30 | this.isEnabled = true, 31 | this.onTap, 32 | }) : super(key: key); 33 | 34 | @override 35 | State createState() => _SmileyWidgetState(); 36 | } 37 | 38 | class _SmileyWidgetState extends State 39 | with SingleTickerProviderStateMixin { 40 | late final _controller = AnimationController( 41 | vsync: this, 42 | duration: widget.expression.period, 43 | ); 44 | 45 | late final Animation _openingAnimation = CurvedAnimation( 46 | parent: _controller, 47 | curve: EyeCurve( 48 | period: widget.expression.period, 49 | blinking: const Duration(milliseconds: 500), 50 | ), 51 | ); 52 | 53 | bool _isHovering = false; 54 | 55 | bool get _isVeryHappy => widget.expression == SmileyExpression.veryHappy; 56 | 57 | @override 58 | void initState() { 59 | super.initState(); 60 | _controller.repeat(); 61 | } 62 | 63 | @override 64 | void dispose() { 65 | _controller.dispose(); 66 | super.dispose(); 67 | } 68 | 69 | @override 70 | Widget build(BuildContext context) { 71 | return MouseRegion( 72 | onExit: (_) => setState(() => _isHovering = false), 73 | onEnter: (_) => setState(() => _isHovering = true), 74 | child: AnimatedOpacity( 75 | opacity: widget.isSelected || widget.isEnabled ? 1 : 0.5, 76 | duration: const Duration(milliseconds: 200), 77 | child: AnimatedContainer( 78 | duration: const Duration(milliseconds: 200), 79 | decoration: const BoxDecoration( 80 | color: Colors.white, 81 | shape: BoxShape.circle, 82 | ), 83 | height: 84 | widget.isSelected ? kDefaultSmileySize * 1.2 : kDefaultSmileySize, 85 | width: 86 | widget.isSelected ? kDefaultSmileySize * 1.2 : kDefaultSmileySize, 87 | alignment: Alignment.center, 88 | child: GestureDetector( 89 | onTap: widget.onTap, 90 | child: Stack( 91 | clipBehavior: Clip.none, 92 | children: [ 93 | Container( 94 | width: kDefaultSmileySize, 95 | height: kDefaultSmileySize, 96 | decoration: BoxDecoration( 97 | shape: BoxShape.circle, 98 | color: widget.expression.color, 99 | boxShadow: [ 100 | if (!widget.isSelected) 101 | const BoxShadow( 102 | color: Color.fromRGBO(0, 0, 0, 0.25), 103 | offset: Offset(0, 4), 104 | blurRadius: 4, 105 | ), 106 | ], 107 | ), 108 | foregroundDecoration: const BoxDecoration( 109 | backgroundBlendMode: BlendMode.overlay, 110 | shape: BoxShape.circle, 111 | gradient: RadialGradient( 112 | colors: [ 113 | Color.fromRGBO(0, 0, 0, 1), 114 | Color.fromRGBO(255, 255, 255, 1), 115 | ], 116 | center: Alignment.bottomLeft, 117 | radius: 1.8, 118 | ), 119 | ), 120 | ), 121 | AnimatedPositioned( 122 | height: kDefaultSmileySize, 123 | width: kDefaultSmileySize, 124 | top: widget.expression.topPos, 125 | right: _isHovering || widget.isSelected 126 | ? kDefaultSmileySize / 2 - 127 | widget.expression.rightPos * 128 | (_isVeryHappy ? 1.4 : 1.8) 129 | : widget.expression.rightPos, 130 | duration: const Duration(milliseconds: 200), 131 | child: CustomPaint( 132 | painter: widget.expression.createPainter(_openingAnimation), 133 | ), 134 | ), 135 | ], 136 | ), 137 | ), 138 | ), 139 | ), 140 | ); 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /lib/src/face_painter.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' as math; 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | const _kDefaultEyeSize = 4.0; 6 | 7 | abstract class FacePainter extends CustomPainter { 8 | final double eyeSize; 9 | final Animation? eyeOpening; 10 | 11 | const FacePainter({this.eyeSize = _kDefaultEyeSize, this.eyeOpening}) 12 | : super(repaint: eyeOpening); 13 | 14 | @override 15 | bool shouldRepaint(covariant FacePainter oldDelegate) => false; 16 | 17 | FacePainter copyWith({Animation? eyeOpening}); 18 | } 19 | 20 | class VerySadFacePainter extends FacePainter { 21 | const VerySadFacePainter({Animation? eyeOpening}) 22 | : super(eyeOpening: eyeOpening); 23 | 24 | @override 25 | void paint(Canvas canvas, Size size) { 26 | canvas 27 | ..drawEyes(size: size, eyeSize: eyeSize, opening: eyeOpening?.value) 28 | ..drawSadMouth(size: size, eyeSize: eyeSize); 29 | 30 | final eyebrowPaint = Paint() 31 | ..color = Colors.black 32 | ..style = PaintingStyle.stroke 33 | ..strokeWidth = 4; 34 | 35 | final leftEyebrowPath = Path() 36 | ..moveTo(size.width + eyeSize * 1.5, -8.5) 37 | ..lineTo(size.width - eyeSize * 1.3, -4.5) 38 | ..close(); 39 | 40 | final rightEyebrowPath = Path() 41 | ..moveTo(size.width - eyeSize * 7.5, -8.5) 42 | ..lineTo(size.width - 24 + eyeSize * 1.3, -4.5) 43 | ..close(); 44 | 45 | canvas 46 | ..drawPath(leftEyebrowPath, eyebrowPaint) 47 | ..drawPath(rightEyebrowPath, eyebrowPaint); 48 | } 49 | 50 | @override 51 | FacePainter copyWith({Animation? eyeOpening}) { 52 | return VerySadFacePainter(eyeOpening: eyeOpening); 53 | } 54 | } 55 | 56 | class SadFacePainter extends FacePainter { 57 | const SadFacePainter({Animation? eyeOpening}) 58 | : super(eyeOpening: eyeOpening); 59 | 60 | @override 61 | void paint(Canvas canvas, Size size) { 62 | final mouthPaint = Paint() 63 | ..color = Colors.black 64 | ..style = PaintingStyle.stroke 65 | ..strokeWidth = 4; 66 | 67 | canvas 68 | ..drawEyes(size: size, eyeSize: eyeSize, opening: eyeOpening?.value) 69 | ..drawArc( 70 | Rect.fromCenter( 71 | center: Offset(size.width - 13, eyeSize * 2), 72 | width: 10, 73 | height: 10, 74 | ), 75 | math.pi, 76 | math.pi, 77 | false, 78 | mouthPaint, 79 | ); 80 | } 81 | 82 | @override 83 | FacePainter copyWith({Animation? eyeOpening}) => 84 | SadFacePainter(eyeOpening: eyeOpening); 85 | } 86 | 87 | class NeutralFacePainter extends FacePainter { 88 | const NeutralFacePainter({Animation? eyeOpening}) 89 | : super(eyeOpening: eyeOpening); 90 | 91 | @override 92 | void paint(Canvas canvas, Size size) { 93 | final mouthPaint = Paint()..color = Colors.black; 94 | 95 | canvas 96 | ..drawEyes(size: size, eyeSize: eyeSize, opening: eyeOpening?.value) 97 | ..drawRect( 98 | Rect.fromLTWH(size.width - 21, eyeSize, 16, 4), 99 | mouthPaint, 100 | ); 101 | } 102 | 103 | @override 104 | FacePainter copyWith({Animation? eyeOpening}) => NeutralFacePainter( 105 | eyeOpening: eyeOpening, 106 | ); 107 | } 108 | 109 | class HappyFacePainter extends FacePainter { 110 | const HappyFacePainter({Animation? eyeOpening}) 111 | : super(eyeOpening: eyeOpening); 112 | 113 | @override 114 | void paint(Canvas canvas, Size size) { 115 | final mouthPaint = Paint() 116 | ..color = Colors.black 117 | ..style = PaintingStyle.stroke 118 | ..strokeWidth = 4; 119 | 120 | canvas 121 | ..drawEyes(size: size, eyeSize: eyeSize, opening: eyeOpening?.value) 122 | ..drawArc( 123 | Rect.fromCenter( 124 | center: Offset(size.width - 13, eyeSize), 125 | width: 10, 126 | height: 10, 127 | ), 128 | 0, 129 | math.pi, 130 | false, 131 | mouthPaint, 132 | ); 133 | } 134 | 135 | @override 136 | FacePainter copyWith({Animation? eyeOpening}) => HappyFacePainter( 137 | eyeOpening: eyeOpening, 138 | ); 139 | } 140 | 141 | class VeryHappyFacePainter extends FacePainter { 142 | const VeryHappyFacePainter({Animation? eyeOpening}) 143 | : super(eyeOpening: eyeOpening); 144 | 145 | @override 146 | void paint(Canvas canvas, Size size) { 147 | final mouthPaint = Paint()..color = Colors.black; 148 | canvas 149 | ..drawEyes(size: size, eyeSize: eyeSize, opening: eyeOpening?.value) 150 | ..drawArc( 151 | Rect.fromCenter( 152 | center: Offset(size.width - 13, eyeSize), 153 | width: 16, 154 | height: 16, 155 | ), 156 | 0, 157 | math.pi, 158 | false, 159 | mouthPaint, 160 | ); 161 | } 162 | 163 | @override 164 | FacePainter copyWith({Animation? eyeOpening}) => VeryHappyFacePainter( 165 | eyeOpening: eyeOpening, 166 | ); 167 | } 168 | 169 | extension on Canvas { 170 | void drawEyes({ 171 | required Size size, 172 | required double eyeSize, 173 | required double? opening, 174 | }) { 175 | final eyePaint = Paint() 176 | ..color = Colors.black 177 | ..strokeCap = StrokeCap.round; 178 | 179 | final point1 = Offset(size.width - 24 - eyeSize / 2, 0); 180 | final point2 = Offset(size.width, 0); 181 | 182 | final leftEyePath = Path(); 183 | if (opening != null && opening < 1) { 184 | leftEyePath.addOval( 185 | Rect.fromCenter( 186 | center: point1, 187 | width: eyeSize * 2, 188 | height: eyeSize * 2 * opening, 189 | ), 190 | ); 191 | } else { 192 | leftEyePath.addOval(Rect.fromCircle(center: point1, radius: eyeSize)); 193 | } 194 | 195 | final rightEyePath = Path(); 196 | if (opening != null && opening < 1) { 197 | rightEyePath.addOval( 198 | Rect.fromCenter( 199 | center: point2, 200 | width: eyeSize * 2, 201 | height: eyeSize * 2 * opening, 202 | ), 203 | ); 204 | } else { 205 | rightEyePath.addOval(Rect.fromCircle(center: point2, radius: eyeSize)); 206 | } 207 | 208 | this 209 | ..drawPath(leftEyePath, eyePaint) 210 | ..drawPath(rightEyePath, eyePaint); 211 | } 212 | 213 | void drawSadMouth({required Size size, required double eyeSize}) { 214 | final mouthPaint = Paint() 215 | ..color = Colors.black 216 | ..style = PaintingStyle.stroke 217 | ..strokeWidth = 4; 218 | 219 | drawArc( 220 | Rect.fromCenter( 221 | center: Offset(size.width - 13, eyeSize * 2), 222 | width: 10, 223 | height: 10, 224 | ), 225 | math.pi, 226 | math.pi, 227 | false, 228 | mouthPaint, 229 | ); 230 | } 231 | } 232 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 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 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1300; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | INFOPLIST_FILE = Runner/Info.plist; 293 | LD_RUNPATH_SEARCH_PATHS = ( 294 | "$(inherited)", 295 | "@executable_path/Frameworks", 296 | ); 297 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 298 | PRODUCT_NAME = "$(TARGET_NAME)"; 299 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 300 | SWIFT_VERSION = 5.0; 301 | VERSIONING_SYSTEM = "apple-generic"; 302 | }; 303 | name = Profile; 304 | }; 305 | 97C147031CF9000F007C117D /* Debug */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ALWAYS_SEARCH_USER_PATHS = NO; 309 | CLANG_ANALYZER_NONNULL = YES; 310 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 311 | CLANG_CXX_LIBRARY = "libc++"; 312 | CLANG_ENABLE_MODULES = YES; 313 | CLANG_ENABLE_OBJC_ARC = YES; 314 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 315 | CLANG_WARN_BOOL_CONVERSION = YES; 316 | CLANG_WARN_COMMA = YES; 317 | CLANG_WARN_CONSTANT_CONVERSION = YES; 318 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 319 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 320 | CLANG_WARN_EMPTY_BODY = YES; 321 | CLANG_WARN_ENUM_CONVERSION = YES; 322 | CLANG_WARN_INFINITE_RECURSION = YES; 323 | CLANG_WARN_INT_CONVERSION = YES; 324 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 325 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 326 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 327 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 328 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 329 | CLANG_WARN_STRICT_PROTOTYPES = YES; 330 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 331 | CLANG_WARN_UNREACHABLE_CODE = YES; 332 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 333 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 334 | COPY_PHASE_STRIP = NO; 335 | DEBUG_INFORMATION_FORMAT = dwarf; 336 | ENABLE_STRICT_OBJC_MSGSEND = YES; 337 | ENABLE_TESTABILITY = YES; 338 | GCC_C_LANGUAGE_STANDARD = gnu99; 339 | GCC_DYNAMIC_NO_PIC = NO; 340 | GCC_NO_COMMON_BLOCKS = YES; 341 | GCC_OPTIMIZATION_LEVEL = 0; 342 | GCC_PREPROCESSOR_DEFINITIONS = ( 343 | "DEBUG=1", 344 | "$(inherited)", 345 | ); 346 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 347 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 348 | GCC_WARN_UNDECLARED_SELECTOR = YES; 349 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 350 | GCC_WARN_UNUSED_FUNCTION = YES; 351 | GCC_WARN_UNUSED_VARIABLE = YES; 352 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 353 | MTL_ENABLE_DEBUG_INFO = YES; 354 | ONLY_ACTIVE_ARCH = YES; 355 | SDKROOT = iphoneos; 356 | TARGETED_DEVICE_FAMILY = "1,2"; 357 | }; 358 | name = Debug; 359 | }; 360 | 97C147041CF9000F007C117D /* Release */ = { 361 | isa = XCBuildConfiguration; 362 | buildSettings = { 363 | ALWAYS_SEARCH_USER_PATHS = NO; 364 | CLANG_ANALYZER_NONNULL = YES; 365 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 366 | CLANG_CXX_LIBRARY = "libc++"; 367 | CLANG_ENABLE_MODULES = YES; 368 | CLANG_ENABLE_OBJC_ARC = YES; 369 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 370 | CLANG_WARN_BOOL_CONVERSION = YES; 371 | CLANG_WARN_COMMA = YES; 372 | CLANG_WARN_CONSTANT_CONVERSION = YES; 373 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 374 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 375 | CLANG_WARN_EMPTY_BODY = YES; 376 | CLANG_WARN_ENUM_CONVERSION = YES; 377 | CLANG_WARN_INFINITE_RECURSION = YES; 378 | CLANG_WARN_INT_CONVERSION = YES; 379 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 380 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 381 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 382 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 383 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 384 | CLANG_WARN_STRICT_PROTOTYPES = YES; 385 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 386 | CLANG_WARN_UNREACHABLE_CODE = YES; 387 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 388 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 389 | COPY_PHASE_STRIP = NO; 390 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 391 | ENABLE_NS_ASSERTIONS = NO; 392 | ENABLE_STRICT_OBJC_MSGSEND = YES; 393 | GCC_C_LANGUAGE_STANDARD = gnu99; 394 | GCC_NO_COMMON_BLOCKS = YES; 395 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 396 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 397 | GCC_WARN_UNDECLARED_SELECTOR = YES; 398 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 399 | GCC_WARN_UNUSED_FUNCTION = YES; 400 | GCC_WARN_UNUSED_VARIABLE = YES; 401 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 402 | MTL_ENABLE_DEBUG_INFO = NO; 403 | SDKROOT = iphoneos; 404 | SUPPORTED_PLATFORMS = iphoneos; 405 | SWIFT_COMPILATION_MODE = wholemodule; 406 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 407 | TARGETED_DEVICE_FAMILY = "1,2"; 408 | VALIDATE_PRODUCT = YES; 409 | }; 410 | name = Release; 411 | }; 412 | 97C147061CF9000F007C117D /* Debug */ = { 413 | isa = XCBuildConfiguration; 414 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 415 | buildSettings = { 416 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 417 | CLANG_ENABLE_MODULES = YES; 418 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 419 | ENABLE_BITCODE = NO; 420 | INFOPLIST_FILE = Runner/Info.plist; 421 | LD_RUNPATH_SEARCH_PATHS = ( 422 | "$(inherited)", 423 | "@executable_path/Frameworks", 424 | ); 425 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 426 | PRODUCT_NAME = "$(TARGET_NAME)"; 427 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 428 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 429 | SWIFT_VERSION = 5.0; 430 | VERSIONING_SYSTEM = "apple-generic"; 431 | }; 432 | name = Debug; 433 | }; 434 | 97C147071CF9000F007C117D /* Release */ = { 435 | isa = XCBuildConfiguration; 436 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 437 | buildSettings = { 438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 439 | CLANG_ENABLE_MODULES = YES; 440 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 441 | ENABLE_BITCODE = NO; 442 | INFOPLIST_FILE = Runner/Info.plist; 443 | LD_RUNPATH_SEARCH_PATHS = ( 444 | "$(inherited)", 445 | "@executable_path/Frameworks", 446 | ); 447 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 448 | PRODUCT_NAME = "$(TARGET_NAME)"; 449 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 450 | SWIFT_VERSION = 5.0; 451 | VERSIONING_SYSTEM = "apple-generic"; 452 | }; 453 | name = Release; 454 | }; 455 | /* End XCBuildConfiguration section */ 456 | 457 | /* Begin XCConfigurationList section */ 458 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 459 | isa = XCConfigurationList; 460 | buildConfigurations = ( 461 | 97C147031CF9000F007C117D /* Debug */, 462 | 97C147041CF9000F007C117D /* Release */, 463 | 249021D3217E4FDB00AE95B9 /* Profile */, 464 | ); 465 | defaultConfigurationIsVisible = 0; 466 | defaultConfigurationName = Release; 467 | }; 468 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 469 | isa = XCConfigurationList; 470 | buildConfigurations = ( 471 | 97C147061CF9000F007C117D /* Debug */, 472 | 97C147071CF9000F007C117D /* Release */, 473 | 249021D4217E4FDB00AE95B9 /* Profile */, 474 | ); 475 | defaultConfigurationIsVisible = 0; 476 | defaultConfigurationName = Release; 477 | }; 478 | /* End XCConfigurationList section */ 479 | }; 480 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 481 | } 482 | --------------------------------------------------------------------------------