├── ios ├── Assets │ └── .gitkeep ├── Classes │ ├── FlutterResponsivePlugin.h │ ├── SwiftFlutterResponsivePlugin.swift │ └── FlutterResponsivePlugin.m ├── .gitignore └── flutter_responsive.podspec ├── android ├── settings.gradle ├── .gitignore ├── gradle.properties ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ └── me │ │ └── carda │ │ └── flutter_responsive │ │ └── FlutterResponsivePlugin.kt ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties └── build.gradle ├── 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.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Runner.xcodeproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ └── project.pbxproj │ └── .gitignore ├── assets │ ├── TMNT.jpg │ ├── example1.png │ ├── example2.png │ ├── example3.png │ ├── example4.png │ ├── example5.png │ ├── example6.png │ ├── example7.png │ └── flutter-512.png ├── android │ ├── gradle.properties │ ├── .gitignore │ ├── 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 │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── me │ │ │ │ │ │ └── carda │ │ │ │ │ │ └── flutter_responsive_example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ └── build.gradle ├── .metadata ├── README.md ├── lib │ ├── main.dart │ ├── layouts │ │ ├── fullscreen_image.dart │ │ └── sidebar.dart │ └── pages │ │ ├── home_page.dart │ │ ├── sandbox_page.dart │ │ ├── grids_performance.dart │ │ └── grids_page.dart ├── .gitignore ├── test │ └── widget_test.dart ├── pubspec.yaml └── pubspec.lock ├── .gitattributes ├── .gitignore ├── .idea ├── misc.xml ├── vcs.xml ├── libraries │ ├── Flutter_Plugins.xml │ ├── Flutter_for_Android.xml │ └── Dart_SDK.xml ├── runConfigurations │ └── example_lib_main_dart.xml ├── modules.xml ├── codeStyles │ └── Project.xml └── workspace.xml ├── lib ├── flutter_responsive.dart └── src │ ├── responsive_enum.dart │ ├── responsive_screen.dart │ ├── responsive_container.dart │ ├── responsive_row.dart │ ├── responsive_col.dart │ └── responsive_widget.dart ├── .metadata ├── flutter_responsive.iml ├── test ├── responsive_container_test.dart ├── responsive_screen_test.dart └── responsive_col_test.dart ├── CHANGELOG.md ├── pubspec.yaml ├── pubspec.lock ├── README.md └── LICENSE /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'flutter_responsive' 2 | -------------------------------------------------------------------------------- /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" -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | .idea/workspace.xml 9 | -------------------------------------------------------------------------------- /example/assets/TMNT.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/HEAD/example/assets/TMNT.jpg -------------------------------------------------------------------------------- /example/assets/example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/HEAD/example/assets/example1.png -------------------------------------------------------------------------------- /example/assets/example2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/HEAD/example/assets/example2.png -------------------------------------------------------------------------------- /example/assets/example3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/HEAD/example/assets/example3.png -------------------------------------------------------------------------------- /example/assets/example4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/HEAD/example/assets/example4.png -------------------------------------------------------------------------------- /example/assets/example5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/HEAD/example/assets/example5.png -------------------------------------------------------------------------------- /example/assets/example6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/HEAD/example/assets/example6.png -------------------------------------------------------------------------------- /example/assets/example7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/HEAD/example/assets/example7.png -------------------------------------------------------------------------------- /example/assets/flutter-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/HEAD/example/assets/flutter-512.png -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /ios/Classes/FlutterResponsivePlugin.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface FlutterResponsivePlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelsetragni/flutter_responsive/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/rafaelsetragni/flutter_responsive/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /lib/flutter_responsive.dart: -------------------------------------------------------------------------------- 1 | library flutter_responsive; 2 | 3 | export 'src/responsive_enum.dart'; 4 | export 'src/responsive_row.dart'; 5 | export 'src/responsive_col.dart'; 6 | export 'src/responsive_screen.dart'; 7 | export 'src/responsive_container.dart'; 8 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 6 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_for_Android.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 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: 27321ebbad34b0a3fafe99fac037102196d655ff 8 | channel: @u 9 | 10 | project_type: plugin 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: 27321ebbad34b0a3fafe99fac037102196d655ff 8 | channel: @u 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations/example_lib_main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /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/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/src/responsive_enum.dart: -------------------------------------------------------------------------------- 1 | enum ScreenSize { 2 | /// Smart watches (0.00 >= width > 310.00) 3 | us, 4 | 5 | /// Small phones (5S) (310.00 >= width > 576.00) 6 | xs, 7 | 8 | /// Medium phones (576.00 >= width > 768.00) 9 | sm, 10 | 11 | /// Large phones (iPhone X) (768.00 >= width > 992.00) 12 | md, 13 | 14 | /// Tablets (992.00 >= width > 1200.00) 15 | lg, 16 | 17 | /// Laptops (1200.00 >= width > 2000.00) 18 | xl, 19 | 20 | /// TVs and 4k ( width > 2000.00) 21 | ul, 22 | } 23 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/me/carda/flutter_responsive_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package me.carda.flutter_responsive_example 2 | 3 | import androidx.annotation.NonNull; 4 | import io.flutter.embedding.android.FlutterActivity 5 | import io.flutter.embedding.engine.FlutterEngine 6 | import io.flutter.plugins.GeneratedPluginRegistrant 7 | 8 | class MainActivity: FlutterActivity() { 9 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { 10 | GeneratedPluginRegistrant.registerWith(flutterEngine); 11 | } 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 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /ios/Classes/SwiftFlutterResponsivePlugin.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | 4 | public class SwiftFlutterResponsivePlugin: NSObject, FlutterPlugin { 5 | public static func register(with registrar: FlutterPluginRegistrar) { 6 | let channel = FlutterMethodChannel(name: "flutter_responsive", binaryMessenger: registrar.messenger()) 7 | let instance = SwiftFlutterResponsivePlugin() 8 | registrar.addMethodCallDelegate(instance, channel: channel) 9 | } 10 | 11 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { 12 | result("iOS " + UIDevice.current.systemVersion) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # flutter_responsive_example 2 | 3 | Demonstrates how to use the flutter_responsive plugin. 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 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /ios/Classes/FlutterResponsivePlugin.m: -------------------------------------------------------------------------------- 1 | #import "FlutterResponsivePlugin.h" 2 | #if __has_include() 3 | #import 4 | #else 5 | // Support project import fallback if the generated compatibility header 6 | // is not copied when this plugin is created as a library. 7 | // https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 8 | #import "flutter_responsive-Swift.h" 9 | #endif 10 | 11 | @implementation FlutterResponsivePlugin 12 | + (void)registerWithRegistrar:(NSObject*)registrar { 13 | [SwiftFlutterResponsivePlugin registerWithRegistrar:registrar]; 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_responsive_example/pages/home_page.dart'; 3 | 4 | void main() => runApp(MyApp()); 5 | 6 | class MyApp extends StatefulWidget { 7 | @override 8 | _MyApp createState() => _MyApp(); 9 | } 10 | class _MyApp extends State { 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return MaterialApp( 15 | title: 'Flutter Responsive Example', 16 | theme: ThemeData( 17 | primaryColor: Color.fromARGB(255, 86, 61, 124), 18 | accentColor: Colors.black, 19 | 20 | // Define the default font family. 21 | fontFamily: 'Roboto', 22 | ), 23 | home: HomePage(), 24 | ); 25 | } 26 | } -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 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 | -------------------------------------------------------------------------------- /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 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Exceptions to above rules. 37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 38 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /flutter_responsive.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:flutter_responsive_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => widget is Text && 22 | widget.data.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /ios/flutter_responsive.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint flutter_responsive.podspec' to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'flutter_responsive' 7 | s.version = '0.0.1' 8 | s.summary = 'Responsive grid and texts behaviours for Flutter' 9 | s.description = <<-DESC 10 | Responsive grid and texts behaviours for Flutter 11 | DESC 12 | s.homepage = 'http://example.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Your Company' => 'email@example.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.dependency 'Flutter' 18 | s.platform = :ios, '8.0' 19 | 20 | # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. 21 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } 22 | s.swift_version = '5.0' 23 | end 24 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'me.carda.flutter_responsive' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | ext.kotlin_version = '1.3.50' 6 | repositories { 7 | google() 8 | jcenter() 9 | } 10 | 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:3.5.0' 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | rootProject.allprojects { 18 | repositories { 19 | google() 20 | jcenter() 21 | } 22 | } 23 | 24 | apply plugin: 'com.android.library' 25 | apply plugin: 'kotlin-android' 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | sourceSets { 31 | main.java.srcDirs += 'src/main/kotlin' 32 | } 33 | defaultConfig { 34 | minSdkVersion 16 35 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 36 | } 37 | lintOptions { 38 | disable 'InvalidPackage' 39 | } 40 | } 41 | 42 | dependencies { 43 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 44 | } 45 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_responsive_example 2 | description: Demonstrates how to use the flutter_responsive plugin. 3 | publish_to: 'none' 4 | 5 | environment: 6 | sdk: ">=2.1.0 <3.0.0" 7 | 8 | dependencies: 9 | flutter: 10 | sdk: flutter 11 | 12 | # The following adds the Cupertino Icons font to your application. 13 | # Use with the CupertinoIcons class for iOS style icons. 14 | cupertino_icons: ^0.1.2 15 | 16 | font_awesome_flutter: ^8.5.0 17 | 18 | extended_image: ^0.6.8 19 | 20 | flutter_jsx: ^0.0.1 21 | 22 | dev_dependencies: 23 | flutter_test: 24 | sdk: flutter 25 | 26 | flutter_responsive: 27 | path: ../ 28 | 29 | # For information on the generic Dart part of this file, see the 30 | # following page: https://dart.dev/tools/pub/pubspec 31 | 32 | # The following section is specific to Flutter. 33 | flutter: 34 | 35 | # The following line ensures that the Material Icons font is 36 | # included with your application, so that you can use the icons in 37 | # the material Icons class. 38 | uses-material-design: true 39 | 40 | # To add assets to your application, add an assets section, like this: 41 | assets: 42 | - assets/flutter-512.png 43 | - assets/TMNT.jpg -------------------------------------------------------------------------------- /lib/src/responsive_screen.dart: -------------------------------------------------------------------------------- 1 | import 'responsive_enum.dart'; 2 | 3 | /// Contains all screen size limits and all functions to test those limits 4 | class ResponsiveScreen { 5 | /// Screen width size limits 6 | static Map limits = { 7 | ScreenSize.us: 0.00, 8 | // Smart watches 9 | ScreenSize.xs: 310.00, 10 | // Small phones (5S) 11 | ScreenSize.sm: 576.00, 12 | // Medium phones 13 | ScreenSize.md: 768.00, 14 | // Large phones (iPhone X) 15 | ScreenSize.lg: 992.00, 16 | // Tablets 17 | ScreenSize.xl: 1200.00, 18 | // Laptops 19 | ScreenSize.ul: 2000.00, 20 | // Desktops and TVs 4K 21 | }; 22 | 23 | /// Gets the latest screen limit which contains width size 24 | static getReferenceSize(double width) { 25 | ScreenSize located = limits.keys.first; 26 | for (ScreenSize tag in limits.keys) { 27 | if (limits[tag] > width) return located; 28 | located = tag; 29 | } 30 | return located; 31 | } 32 | 33 | /// Test if screen size limit respects the limit width referenced by tag 34 | static bool isScreenSize(ScreenSize tag, double screenSize) { 35 | return !limits.containsKey(tag) 36 | ? false 37 | : (screenSize < 0 ? 0 : screenSize) >= limits[tag]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /test/responsive_container_test.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter_responsive/src/responsive_enum.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:flutter_responsive/flutter_responsive.dart'; 5 | 6 | void main() { 7 | 8 | String businessRule; 9 | ResponsiveContainer containerTest = ResponsiveContainer(); 10 | 11 | testWidgets('Container behaviour for starndard spaces tests', (WidgetTester tester) async { 12 | 13 | businessRule = 'Container behaviour should be limited to 95% (2,5% for each offset side) if parent container is larger than small limit'; 14 | 15 | double limit = ResponsiveScreen.limits[ScreenSize.md]; 16 | 17 | expect( containerTest.getContainerSize( limit, limit * 0.5 ), limit * 0.5 , reason: businessRule ); 18 | expect( containerTest.getContainerSize( limit, limit * 0.94 ), limit * 0.94, reason: businessRule ); 19 | expect( containerTest.getContainerSize( limit, limit * 0.95 ), limit * 0.95, reason: businessRule ); 20 | expect( containerTest.getContainerSize( limit, limit * 0.96 ), limit * 0.95, reason: businessRule ); 21 | expect( containerTest.getContainerSize( limit, limit * 1 ), limit * 0.95, reason: businessRule ); 22 | expect( containerTest.getContainerSize( limit, limit * 1.5 ), limit * 0.95, reason: businessRule ); 23 | expect( containerTest.getContainerSize( limit, limit * 2.0 ), limit * 0.95, reason: businessRule ); 24 | expect( containerTest.getContainerSize( limit, limit * 10.0 ), limit * 0.95, reason: businessRule ); 25 | 26 | }); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /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 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | flutter_responsive_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | * Final version finally released. 4 | * Screen size tags changed from text to enumerators, to increase performance. 5 | * Documentation updated 6 | 7 | ## 0.0.6 8 | 9 | * The JSX widget was separated in a different project called ```flutter_jsx``` to allow both plugins to be used and improved separately. 10 | 11 | ## 0.0.5+1 12 | 13 | * Implemented hashcode comparision methods to JSX_node_text and JSX_node_element classes. 14 | 15 | ## 0.0.5 16 | 17 | * Flutter HTML parser was successfully replaced by an new JSX parser, implemented on this plugin, to fix self-closed HTML tags node's construction. 18 | 19 | ## 0.0.4 20 | 21 | * Added widget's HTML tag, to allow developers to include any Flutter's widget inside the text. 22 | 23 | ## 0.0.3+3 24 | 25 | * Dartdoc finished for all classes 26 | 27 | ## 0.0.3+2 28 | 29 | * Class JSXStylesheet fully documented using Dartdoc 30 | 31 | ## 0.0.3+1 32 | 33 | * Starting to use Dartdoc to generate respective documentation about the project Classes 34 | 35 | ## 0.0.3 36 | 37 | * Sandbox page implemented to test visual properties. 38 | * Shrink property removed from JSX due to not be intuitive enough. 39 | * Display property adopted as global plugin standard to define if JSX should occupy all line or not, copying the display Html div property. 40 | * Case tests to Cascade Stylesheet implemented 41 | 42 | ## 0.0.2+2 43 | 44 | * Improvements on source to increase Pub Dev score. Also the README file was completed. 45 | 46 | ## 0.0.2+1 47 | 48 | * Improvements on source to increase Pub Dev score, such as format source and @immutable objects with non-final variables 49 | 50 | ## 0.0.2 51 | 52 | * Fixed english errors on example app. 53 | * Established standard values for Container and Row bool variables. 54 | 55 | ## 0.0.1 56 | 57 | * TODO: Describe initial release. -------------------------------------------------------------------------------- /example/lib/layouts/fullscreen_image.dart: -------------------------------------------------------------------------------- 1 | import 'package:extended_image/extended_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_jsx/flutter_jsx.dart'; 4 | import 'package:flutter_responsive/flutter_responsive.dart'; 5 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 6 | 7 | class FullscreenImageView extends StatelessWidget { 8 | 9 | final ImageProvider imageProvider; 10 | 11 | const FullscreenImageView(this.imageProvider); 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | 16 | MediaQueryData mediaQuery = MediaQuery.of(context); 17 | 18 | return Stack( 19 | children: [ 20 | ExtendedImage( 21 | image: imageProvider, 22 | width: mediaQuery.size.width, 23 | height: mediaQuery.size.height, 24 | fit: BoxFit.fitWidth, 25 | mode: ExtendedImageMode.gesture 26 | //cancelToken: cancellationToken, 27 | ), 28 | Positioned( 29 | top: 5 + mediaQuery.padding.top, 30 | right: 5, 31 | child: Container( 32 | width: 50, 33 | child: FlatButton( 34 | padding: EdgeInsets.all(10), 35 | color: Colors.black54, 36 | onPressed: () => Navigator.of(context).pop(), 37 | child: JSX( 38 | '', 39 | display: DisplayLine.inline, 40 | stylesheet: { 41 | 'Close': JSXStylesheet( 42 | padding: EdgeInsets.only(bottom: 5) 43 | ) 44 | }, 45 | widgets: { 46 | 'Close': Icon(FontAwesomeIcons.times, color: Colors.white, size: 26) 47 | }, 48 | ) 49 | ) 50 | ), 51 | ), 52 | ] 53 | ); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /lib/src/responsive_container.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | import 'responsive_widget.dart'; 5 | 6 | /// Responsive container who center his content elements and limits his own widget based on [ResponsiveScreen] limits 7 | class ResponsiveContainer extends ResponsiveWidget { 8 | ResponsiveContainer({ 9 | Key key, 10 | Color backgroundColor, 11 | List children, 12 | BoxDecoration decoration, 13 | EdgeInsets padding, 14 | EdgeInsets margin, 15 | double width, 16 | double maxWidth = double.infinity, 17 | double minWidth, 18 | double height, 19 | double maxHeight, 20 | double minHeight, 21 | }) : super( 22 | key: key, 23 | backgroundColor: backgroundColor, 24 | decoration: decoration, 25 | padding: padding, 26 | margin: margin, 27 | width: width, 28 | maxWidth: maxWidth, 29 | minWidth: minWidth, 30 | height: height, 31 | maxHeight: maxHeight, 32 | minHeight: minHeight, 33 | children: children); 34 | 35 | @visibleForTesting 36 | double getContainerSize(double widthLimit, double parentSize) { 37 | double limitSize = widthLimit * 0.95; 38 | return min(parentSize, limitSize); 39 | } 40 | 41 | @override 42 | Widget buildWidget(BuildContext context) { 43 | return LayoutBuilder( 44 | builder: (BuildContext context, BoxConstraints constraints) { 45 | return Align( 46 | alignment: Alignment.topCenter, 47 | child: Container( 48 | width: min(maxWidth, constraints.maxWidth), 49 | height: getWidgetHeight(constraints.maxHeight), 50 | padding: padding, 51 | margin: margin, 52 | color: backgroundColor, 53 | child: children != null ? Wrap(children: children) : null, 54 | ), 55 | ); 56 | }); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/src/responsive_row.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'responsive_widget.dart'; 3 | 4 | /// Responsive row which occupies all line by default and contains 12 columns, used by [ResponsiveCol] as layout reference. 5 | class ResponsiveRow extends ResponsiveWidget { 6 | /// number of columns on each line 7 | final int columns = 12; 8 | 9 | ResponsiveRow({ 10 | Key key, 11 | Color backgroundColor, 12 | List children, 13 | Alignment alignment, 14 | BoxDecoration decoration, 15 | EdgeInsets padding, 16 | EdgeInsets margin, 17 | double width, 18 | double maxWidth, 19 | double minWidth, 20 | double height, 21 | double maxHeight, 22 | double minHeight, 23 | }) : super( 24 | key: key, 25 | alignment: alignment, 26 | backgroundColor: backgroundColor, 27 | decoration: decoration, 28 | padding: padding, 29 | margin: margin, 30 | width: width, 31 | maxWidth: maxWidth, 32 | minWidth: minWidth, 33 | height: height, 34 | maxHeight: maxHeight, 35 | minHeight: minHeight, 36 | children: children); 37 | 38 | @override 39 | buildWidget(BuildContext context) { 40 | // Just rebuild objects if its necessary 41 | return LayoutBuilder( 42 | builder: (BuildContext context, BoxConstraints constraints) { 43 | return Container( 44 | alignment: alignment ?? Alignment.topLeft, 45 | width: (width != null && width < 0) 46 | ? null 47 | : getWidgetWidth(constraints.maxWidth), 48 | height: getWidgetHeight(constraints.maxHeight), 49 | decoration: decoration, 50 | padding: padding, 51 | margin: margin, 52 | color: backgroundColor, 53 | child: children != null ? Wrap(children: children) : null); 54 | }); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_responsive 2 | description: Responsive Layout widgets for Flutter. This plugin was inspired on Bootstrap web project. 3 | version: 1.0.0 4 | homepage: https://github.com/rafaelsetragni/flutter_responsive 5 | 6 | environment: 7 | sdk: ">=2.1.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | dev_dependencies: 14 | flutter_test: 15 | sdk: flutter 16 | 17 | # For information on the generic Dart part of this file, see the 18 | # following page: https://dart.dev/tools/pub/pubspec 19 | 20 | # The following section is specific to Flutter. 21 | flutter: 22 | # This section identifies this Flutter project as a plugin project. 23 | # The androidPackage and pluginClass identifiers should not ordinarily 24 | # be modified. They are used by the tooling to maintain consistency when 25 | # adding or updating assets for this project. 26 | plugin: 27 | androidPackage: me.carda.flutter_responsive 28 | pluginClass: FlutterResponsivePlugin 29 | 30 | # To add assets to your plugin package, add an assets section, like this: 31 | # assets: 32 | # - images/a_dot_burr.jpeg 33 | # - images/a_dot_ham.jpeg 34 | # 35 | # For details regarding assets in packages, see 36 | # https://flutter.dev/assets-and-images/#from-packages 37 | # 38 | # An image asset can refer to one or more resolution-specific "variants", see 39 | # https://flutter.dev/assets-and-images/#resolution-aware. 40 | 41 | # To add custom fonts to your plugin package, add a fonts section here, 42 | # in this "flutter" section. Each entry in this list should have a 43 | # "family" key with the font family name, and a "fonts" key with a 44 | # list giving the asset and other descriptors for the font. For 45 | # example: 46 | # fonts: 47 | # - family: Schyler 48 | # fonts: 49 | # - asset: fonts/Schyler-Regular.ttf 50 | # - asset: fonts/Schyler-Italic.ttf 51 | # style: italic 52 | # - family: Trajan Pro 53 | # fonts: 54 | # - asset: fonts/TrajanPro.ttf 55 | # - asset: fonts/TrajanPro_Bold.ttf 56 | # weight: 700 57 | # 58 | # For details regarding fonts in packages, see 59 | # https://flutter.dev/custom-fonts/#from-packages 60 | -------------------------------------------------------------------------------- /android/src/main/kotlin/me/carda/flutter_responsive/FlutterResponsivePlugin.kt: -------------------------------------------------------------------------------- 1 | package me.carda.flutter_responsive 2 | 3 | import androidx.annotation.NonNull; 4 | import io.flutter.embedding.engine.plugins.FlutterPlugin 5 | import io.flutter.plugin.common.MethodCall 6 | import io.flutter.plugin.common.MethodChannel 7 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler 8 | import io.flutter.plugin.common.MethodChannel.Result 9 | import io.flutter.plugin.common.PluginRegistry.Registrar 10 | 11 | /** FlutterResponsivePlugin */ 12 | public class FlutterResponsivePlugin: FlutterPlugin, MethodCallHandler { 13 | override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { 14 | val channel = MethodChannel(flutterPluginBinding.getFlutterEngine().getDartExecutor(), "flutter_responsive") 15 | channel.setMethodCallHandler(FlutterResponsivePlugin()); 16 | } 17 | 18 | // This static function is optional and equivalent to onAttachedToEngine. It supports the old 19 | // pre-Flutter-1.12 Android projects. You are encouraged to continue supporting 20 | // plugin registration via this function while apps migrate to use the new Android APIs 21 | // post-flutter-1.12 via https://flutter.dev/go/android-project-migration. 22 | // 23 | // It is encouraged to share logic between onAttachedToEngine and registerWith to keep 24 | // them functionally equivalent. Only one of onAttachedToEngine or registerWith will be called 25 | // depending on the user's project. onAttachedToEngine or registerWith must both be defined 26 | // in the same class. 27 | companion object { 28 | @JvmStatic 29 | fun registerWith(registrar: Registrar) { 30 | val channel = MethodChannel(registrar.messenger(), "flutter_responsive") 31 | channel.setMethodCallHandler(FlutterResponsivePlugin()) 32 | } 33 | } 34 | 35 | override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { 36 | if (call.method == "getPlatformVersion") { 37 | result.success("Android ${android.os.Build.VERSION.RELEASE}") 38 | } else { 39 | result.notImplemented() 40 | } 41 | } 42 | 43 | override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /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 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "me.carda.flutter_responsive_example" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 47 | } 48 | 49 | buildTypes { 50 | release { 51 | // TODO: Add your own signing config for the release build. 52 | // Signing with the debug keys for now, so `flutter run --release` works. 53 | signingConfig signingConfigs.debug 54 | } 55 | } 56 | } 57 | 58 | flutter { 59 | source '../..' 60 | } 61 | 62 | dependencies { 63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 64 | testImplementation 'junit:junit:4.12' 65 | androidTestImplementation 'androidx.test:runner:1.1.1' 66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' 67 | } 68 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /test/responsive_screen_test.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:flutter_responsive/src/responsive_enum.dart'; 3 | import 'package:flutter_test/flutter_test.dart'; 4 | import 'package:flutter_responsive/flutter_responsive.dart'; 5 | 6 | void main() { 7 | 8 | // Function to automate border limit tests 9 | bool testLimitTag( Function testFunction, double limit, ScreenSize expected1, ScreenSize expected2, ScreenSize expected3 ){ 10 | return (testFunction(limit - 1.0) == expected1) 11 | && (testFunction(limit + 0.0) == expected2) 12 | && (testFunction(limit + 1.0) == expected3); 13 | } 14 | 15 | testWidgets('Tests for check flexible limits', (WidgetTester tester) async { 16 | String businessRule; 17 | 18 | ResponsiveScreen.limits = { 19 | ScreenSize.us: 0.00, 20 | // smart watches 21 | ScreenSize.xs: 310.00, 22 | // small phones (5S) 23 | ScreenSize.sm: 576.00, 24 | // medium phones 25 | ScreenSize.md: 768.00, 26 | // large phones 27 | ScreenSize.lg: 992.00, 28 | // tablets 29 | ScreenSize.xl: 1200.00, 30 | // laptops 31 | ScreenSize.ul: 1900.00, 32 | // desktops and TVs 4K 33 | }; 34 | 35 | businessRule = 'Ultra small validation should return US'; 36 | expect( testLimitTag( ResponsiveScreen.getReferenceSize, ResponsiveScreen.limits[ScreenSize.us], ScreenSize.us, ScreenSize.us, ScreenSize.us ), true, reason: businessRule ); 37 | businessRule = 'Extra small validation should return XS'; 38 | expect( testLimitTag( ResponsiveScreen.getReferenceSize, ResponsiveScreen.limits[ScreenSize.xs], ScreenSize.us, ScreenSize.xs, ScreenSize.xs ), true, reason: businessRule ); 39 | businessRule = 'Small validation should return SM'; 40 | expect( testLimitTag( ResponsiveScreen.getReferenceSize, ResponsiveScreen.limits[ScreenSize.sm], ScreenSize.xs, ScreenSize.sm, ScreenSize.sm ), true, reason: businessRule ); 41 | businessRule = 'Medium validation should return MD'; 42 | expect( testLimitTag( ResponsiveScreen.getReferenceSize, ResponsiveScreen.limits[ScreenSize.md], ScreenSize.sm, ScreenSize.md, ScreenSize.md ), true, reason: businessRule ); 43 | businessRule = 'Large validation should return LG'; 44 | expect( testLimitTag( ResponsiveScreen.getReferenceSize, ResponsiveScreen.limits[ScreenSize.lg], ScreenSize.md, ScreenSize.lg, ScreenSize.lg ), true, reason: businessRule ); 45 | businessRule = 'Extra large validation should return XL'; 46 | expect( testLimitTag( ResponsiveScreen.getReferenceSize, ResponsiveScreen.limits[ScreenSize.xl], ScreenSize.lg, ScreenSize.xl, ScreenSize.xl ), true, reason: businessRule ); 47 | businessRule = 'Ultra large validation should return UL'; 48 | expect( testLimitTag( ResponsiveScreen.getReferenceSize, ResponsiveScreen.limits[ScreenSize.ul], ScreenSize.xl, ScreenSize.ul, ScreenSize.ul ), true, reason: businessRule ); 49 | businessRule = 'Largest than ultra large validation should return UL'; 50 | expect( testLimitTag( ResponsiveScreen.getReferenceSize, 999999, ScreenSize.ul, ScreenSize.ul, ScreenSize.ul ), true, reason: businessRule ); 51 | 52 | }); 53 | 54 | } 55 | -------------------------------------------------------------------------------- /lib/src/responsive_col.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'responsive_enum.dart'; 4 | import 'responsive_widget.dart'; 5 | 6 | /// Responsive column which change his own width based on parent width 7 | class ResponsiveCol extends ResponsiveWidget { 8 | /// List of column sizes for all screen limits defined on [ResponsiveScreen] 9 | final Map gridSizes; 10 | 11 | /// List of column offset sizes for all screen limits defined on [ResponsiveScreen] 12 | final Map gridOffsetSizes; 13 | 14 | ResponsiveCol({ 15 | Key key, 16 | this.gridSizes, 17 | this.gridOffsetSizes, 18 | Alignment alignment = Alignment.topLeft, 19 | Color backgroundColor, 20 | List children, 21 | BoxDecoration decoration, 22 | EdgeInsets padding, 23 | EdgeInsets margin, 24 | double width, 25 | double maxWidth, 26 | double minWidth, 27 | double height, 28 | double maxHeight, 29 | double minHeight, 30 | }) : super( 31 | key: key, 32 | alignment: alignment, 33 | backgroundColor: backgroundColor, 34 | decoration: decoration, 35 | padding: padding, 36 | margin: margin, 37 | width: width, 38 | maxWidth: maxWidth, 39 | minWidth: minWidth, 40 | height: height, 41 | maxHeight: maxHeight, 42 | minHeight: minHeight, 43 | children: children); 44 | 45 | @override 46 | buildWidget(BuildContext context) { 47 | // Just rebuild objects if its necessary 48 | return LayoutBuilder( 49 | builder: (BuildContext context, BoxConstraints constraints) { 50 | EdgeInsets localMargin; 51 | MediaQueryData mediaQuery = MediaQuery.of(context); 52 | 53 | if (gridOffsetSizes != null) { 54 | double offset = getColumnSize(gridOffsetSizes, mediaQuery.size.width); 55 | 56 | if (offset != 1) { 57 | offset *= constraints.maxWidth; 58 | 59 | if (alignment == Alignment.topLeft || 60 | alignment == Alignment.centerLeft || 61 | alignment == Alignment.bottomLeft) { 62 | localMargin = 63 | EdgeInsets.only(left: offset).add(margin ?? EdgeInsets.zero); 64 | } 65 | if (alignment == Alignment.topRight || 66 | alignment == Alignment.centerRight || 67 | alignment == Alignment.bottomRight) { 68 | localMargin = 69 | EdgeInsets.only(left: offset).add(margin ?? EdgeInsets.zero); 70 | } 71 | } 72 | } 73 | 74 | return Container( 75 | alignment: alignment ?? Alignment.topLeft, 76 | decoration: decoration, 77 | width: getColumnSize(gridSizes, mediaQuery.size.width) * 78 | constraints.maxWidth, 79 | height: getWidgetHeight(constraints.maxHeight), 80 | padding: padding, 81 | margin: localMargin ?? margin, 82 | color: backgroundColor, 83 | child: children != null ? Wrap(children: children) : null, 84 | ); 85 | }); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/src/responsive_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter_responsive/src/responsive_screen.dart'; 3 | 4 | import 'responsive_enum.dart'; 5 | 6 | /// Base widget which contains all common responsive behaviours 7 | abstract class ResponsiveWidget extends StatelessWidget { 8 | final Alignment alignment; 9 | 10 | final Color backgroundColor; 11 | final List children; 12 | 13 | final BoxDecoration decoration; 14 | final EdgeInsets padding; 15 | final EdgeInsets margin; 16 | 17 | final double width; 18 | final double maxWidth; 19 | final double minWidth; 20 | 21 | final double height; 22 | final double maxHeight; 23 | final double minHeight; 24 | 25 | static final double _preCalculatedFraction = 1 / 12; 26 | 27 | ResponsiveWidget( 28 | {Key key, 29 | this.alignment = Alignment.topLeft, 30 | this.backgroundColor, 31 | this.decoration, 32 | this.padding, 33 | this.margin, 34 | this.width, 35 | this.maxWidth, 36 | this.minWidth, 37 | this.height, 38 | this.maxHeight, 39 | this.minHeight, 40 | this.children}); 41 | 42 | @protected 43 | double getColumnSize(Map gridSizes, double screenSize) { 44 | double 45 | /* 1/12 columns */ 46 | fraction = _preCalculatedFraction, 47 | calculatedWidthPercentage = 1; 48 | 49 | if ((ResponsiveScreen.limits?.isNotEmpty ?? false) && 50 | (gridSizes?.isNotEmpty ?? false)) { 51 | for (ScreenSize gridTag in gridSizes.keys) { 52 | if (ResponsiveScreen.isScreenSize(gridTag, screenSize)) { 53 | calculatedWidthPercentage = gridSizes.containsKey(gridTag) 54 | ? (fraction * gridSizes[gridTag]) 55 | : 1; 56 | } else { 57 | break; 58 | } 59 | } 60 | } 61 | 62 | return calculatedWidthPercentage; 63 | } 64 | 65 | @protected 66 | double getWidgetWidth(double parentWidth) { 67 | double widgetWidth = width ?? parentWidth; 68 | if (maxWidth != null && parentWidth > maxWidth) { 69 | widgetWidth = maxWidth; 70 | } 71 | if (minWidth != null && parentWidth < minWidth) { 72 | widgetWidth = minWidth; 73 | } 74 | return widgetWidth; 75 | } 76 | 77 | @protected 78 | double getWidgetHeight(double parentHeight) { 79 | double widgetHeight = height != null ? height : parentHeight; 80 | if (maxHeight != null && parentHeight > maxHeight) { 81 | widgetHeight = maxWidth; 82 | } 83 | if (minHeight != null && parentHeight < minHeight) { 84 | widgetHeight = minHeight; 85 | } 86 | return widgetHeight == double.infinity ? null : widgetHeight; 87 | } 88 | 89 | /* 90 | @protected 91 | Widget lastWidget; 92 | 93 | @protected 94 | Size lastSize; 95 | */ 96 | buildWidget(BuildContext context); 97 | 98 | @override 99 | Widget build(BuildContext context) { 100 | //MediaQueryData mediaQuery = MediaQuery.of(context); 101 | 102 | // Just rebuild objects if its necessary. 103 | // Was necessary to use mutable object into imutable class due to Flutter redo all the 104 | // calculations on each frame. 105 | // Using a temporary variable to store the already calculated object improves performance 106 | /*if(lastWidget == null || lastSize != mediaQuery.size){ 107 | lastSize = mediaQuery.size; 108 | lastWidget = buildWidget(context); 109 | } 110 | 111 | return lastWidget;*/ 112 | return buildWidget(context); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | xmlns:android 14 | 15 | ^$ 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | xmlns:.* 25 | 26 | ^$ 27 | 28 | 29 | BY_NAME 30 | 31 |
32 |
33 | 34 | 35 | 36 | .*:id 37 | 38 | http://schemas.android.com/apk/res/android 39 | 40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 | .*:name 48 | 49 | http://schemas.android.com/apk/res/android 50 | 51 | 52 | 53 |
54 |
55 | 56 | 57 | 58 | name 59 | 60 | ^$ 61 | 62 | 63 | 64 |
65 |
66 | 67 | 68 | 69 | style 70 | 71 | ^$ 72 | 73 | 74 | 75 |
76 |
77 | 78 | 79 | 80 | .* 81 | 82 | ^$ 83 | 84 | 85 | BY_NAME 86 | 87 |
88 |
89 | 90 | 91 | 92 | .* 93 | 94 | http://schemas.android.com/apk/res/android 95 | 96 | 97 | ANDROID_ATTRIBUTE_ORDER 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | .* 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 |
114 |
115 |
116 |
-------------------------------------------------------------------------------- /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.5.0-nullsafety.3" 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-nullsafety.3" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.0-nullsafety.5" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.2.0-nullsafety.3" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.0-nullsafety.3" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.15.0-nullsafety.5" 46 | fake_async: 47 | dependency: transitive 48 | description: 49 | name: fake_async 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.2.0-nullsafety.3" 53 | flutter: 54 | dependency: "direct main" 55 | description: flutter 56 | source: sdk 57 | version: "0.0.0" 58 | flutter_test: 59 | dependency: "direct dev" 60 | description: flutter 61 | source: sdk 62 | version: "0.0.0" 63 | matcher: 64 | dependency: transitive 65 | description: 66 | name: matcher 67 | url: "https://pub.dartlang.org" 68 | source: hosted 69 | version: "0.12.10-nullsafety.3" 70 | meta: 71 | dependency: transitive 72 | description: 73 | name: meta 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "1.3.0-nullsafety.6" 77 | path: 78 | dependency: transitive 79 | description: 80 | name: path 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "1.8.0-nullsafety.3" 84 | sky_engine: 85 | dependency: transitive 86 | description: flutter 87 | source: sdk 88 | version: "0.0.99" 89 | source_span: 90 | dependency: transitive 91 | description: 92 | name: source_span 93 | url: "https://pub.dartlang.org" 94 | source: hosted 95 | version: "1.8.0-nullsafety.4" 96 | stack_trace: 97 | dependency: transitive 98 | description: 99 | name: stack_trace 100 | url: "https://pub.dartlang.org" 101 | source: hosted 102 | version: "1.10.0-nullsafety.6" 103 | stream_channel: 104 | dependency: transitive 105 | description: 106 | name: stream_channel 107 | url: "https://pub.dartlang.org" 108 | source: hosted 109 | version: "2.1.0-nullsafety.3" 110 | string_scanner: 111 | dependency: transitive 112 | description: 113 | name: string_scanner 114 | url: "https://pub.dartlang.org" 115 | source: hosted 116 | version: "1.1.0-nullsafety.3" 117 | term_glyph: 118 | dependency: transitive 119 | description: 120 | name: term_glyph 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "1.2.0-nullsafety.3" 124 | test_api: 125 | dependency: transitive 126 | description: 127 | name: test_api 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "0.2.19-nullsafety.6" 131 | typed_data: 132 | dependency: transitive 133 | description: 134 | name: typed_data 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "1.3.0-nullsafety.5" 138 | vector_math: 139 | dependency: transitive 140 | description: 141 | name: vector_math 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "2.1.0-nullsafety.5" 145 | sdks: 146 | dart: ">=2.12.0-0.0 <3.0.0" 147 | -------------------------------------------------------------------------------- /example/lib/pages/home_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_jsx/flutter_jsx.dart'; 3 | import 'package:flutter_responsive/flutter_responsive.dart'; 4 | import 'package:flutter_responsive_example/layouts/sidebar.dart'; 5 | 6 | class HomePage extends StatefulWidget { 7 | @override 8 | _HomePage createState() => _HomePage(); 9 | } 10 | 11 | class _HomePage extends State { 12 | 13 | @override 14 | void initState() { 15 | super.initState(); 16 | } 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | 21 | /*create 12 columns*/ 22 | List responsiveGridExampe = 23 | 24 | /*repeat 12 times*/ 25 | List.generate(12, (index) => index).map((colIndex) => 26 | ResponsiveCol( 27 | padding: EdgeInsets.all(10), 28 | backgroundColor: Colors.blue, 29 | gridSizes: { 30 | ScreenSize.xs : 4, 31 | ScreenSize.sm : 3, 32 | ScreenSize.lg : 2, 33 | ScreenSize.xl : 1, 34 | }, 35 | children: [ 36 | Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit') 37 | ] 38 | ) 39 | ).toList(); 40 | 41 | ThemeData themeData = Theme.of(context); 42 | MediaQueryData mediaQueryData = MediaQuery.of(context); 43 | 44 | return Scaffold( 45 | appBar: AppBar( 46 | title: const Text('Home', overflow: TextOverflow.ellipsis), 47 | ), 48 | drawer: Sidebar(), 49 | body: Container( //background 50 | width: mediaQueryData.size.width, 51 | height: mediaQueryData.size.height, 52 | color: Color(0xFFCCCCCC), 53 | child: SingleChildScrollView( 54 | child: ResponsiveContainer( 55 | padding: EdgeInsets.symmetric(horizontal: 10), 56 | backgroundColor: Colors.white, 57 | maxWidth: ResponsiveScreen.limits[ScreenSize.lg],//mediaQuery.size.width * 0.95, 58 | children: [ 59 | ResponsiveRow( 60 | margin: EdgeInsets.symmetric(vertical: 10), 61 | children: [ 62 | 63 | ResponsiveCol( 64 | padding: EdgeInsets.all(10), 65 | margin: EdgeInsets.only(bottom: 20), 66 | backgroundColor: Colors.blueGrey, 67 | children: [ 68 | Text('Flutter Responsive Layout', style: JSXTypography.h4.merge(TextStyle(color: Colors.white))) 69 | ] 70 | ), 71 | ] 72 | ), 73 | ResponsiveRow( 74 | margin: EdgeInsets.symmetric(vertical: 10), 75 | children: [ 76 | 77 | // By default, the column occupies the entire row, always 78 | ResponsiveCol( 79 | children: [ 80 | JSX( 81 | '
' 82 | '

Responsive Layouts

' 83 | '
for Flutter
' 84 | '

' 85 | '

Bellow there is an example of 12 columns, which changes the amount of each line depending of his father\'s widget size.

' 86 | '
', 87 | display: DisplayLine.block, 88 | padding: EdgeInsets.only(bottom: 20), 89 | stylesheet: { 90 | 'h3': JSXStylesheet( 91 | textStyle: TextStyle(color: themeData.primaryColor), 92 | displayLine: DisplayLine.block 93 | ), 94 | 'h6': JSXStylesheet( 95 | textStyle: TextStyle(color: themeData.primaryColor), 96 | displayLine: DisplayLine.block 97 | ) 98 | }, 99 | margin: EdgeInsets.symmetric(horizontal: 10, vertical: 20), 100 | ) 101 | ] 102 | ) 103 | 104 | ]..addAll( 105 | responsiveGridExampe 106 | ) 107 | ) 108 | ], 109 | ) 110 | ), 111 | ) 112 | ); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /example/lib/layouts/sidebar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_jsx/flutter_jsx.dart'; 3 | import 'package:flutter_responsive_example/pages/grids_page.dart'; 4 | import 'package:flutter_responsive_example/pages/grids_performance.dart'; 5 | import 'package:flutter_responsive_example/pages/home_page.dart'; 6 | import 'package:flutter_responsive_example/pages/sandbox_page.dart'; 7 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 8 | import 'package:flutter_responsive/flutter_responsive.dart'; 9 | 10 | class Sidebar extends StatelessWidget { 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | MediaQueryData mediaQuery = MediaQuery.of(context); 15 | 16 | return Drawer( 17 | child: ListView( 18 | padding: EdgeInsets.zero, 19 | children: [ 20 | ResponsiveContainer( 21 | padding: EdgeInsets.all(10).add(EdgeInsets.only(top: mediaQuery.padding.top)), 22 | width: mediaQuery.size.width, 23 | backgroundColor: Theme.of(context).primaryColor, 24 | height: 200, 25 | children: [ 26 | ResponsiveRow( 27 | children: [ 28 | Container( 29 | decoration: BoxDecoration( 30 | borderRadius: BorderRadius.all(Radius.circular(10)), 31 | border: Border.all(width: 2.0, color: Colors.white), 32 | ), 33 | width: 60, 34 | height: 60, 35 | padding: EdgeInsets.all(5), 36 | margin: EdgeInsets.all(10), 37 | alignment: Alignment.center, 38 | child: Image.asset('assets/flutter-512.png', color: Colors.white,) 39 | ) 40 | ] 41 | ), 42 | ResponsiveRow( 43 | children: [ 44 | Text('Responsive Layouts', style: JSXTypography.h4.apply(color: Colors.white)), 45 | ], 46 | ), 47 | ResponsiveRow( 48 | children: [ 49 | JSX( 50 | 'for Flutter', 51 | textStyle: TextStyle(color: Colors.white, fontSize: 12), 52 | ) 53 | ], 54 | ) 55 | ] 56 | ), 57 | ListTile( 58 | contentPadding: EdgeInsets.only(left: 20, right: 20), 59 | title: Text('Home'), 60 | trailing: Icon(FontAwesomeIcons.home), 61 | onTap: () { 62 | Navigator.of(context).pop(); 63 | Navigator.pushReplacement(context, MaterialPageRoute( builder: (BuildContext context) => HomePage() )); 64 | }, 65 | ), 66 | ExpansionTile( 67 | title: Row( 68 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 69 | children: [ 70 | Text("Grid"), 71 | Icon(FontAwesomeIcons.th) 72 | ], 73 | ), 74 | children: [ 75 | ListTile( 76 | contentPadding: EdgeInsets.only(left: 30, right: 20), 77 | title: Text('Single Cases Tests'), 78 | trailing: Icon(FontAwesomeIcons.flask), 79 | onTap: () { 80 | Navigator.of(context).pop(); 81 | Navigator.pushReplacement(context, MaterialPageRoute( builder: (BuildContext context) => GridPage() )); 82 | }, 83 | ), 84 | ListTile( 85 | contentPadding: EdgeInsets.only(left: 30, right: 20), 86 | title: Text('Performance Test'), 87 | trailing: Icon(FontAwesomeIcons.chartLine), 88 | onTap: () { 89 | Navigator.of(context).pop(); 90 | Navigator.pushReplacement(context, MaterialPageRoute( builder: (BuildContext context) => GridPerformancePage() )); 91 | }, 92 | ) 93 | ], 94 | ), 95 | Divider(height: 2.0, indent: 16.0, endIndent: 10), 96 | ListTile( 97 | contentPadding: EdgeInsets.only(left: 15, right: 20), 98 | title: Text('Sandbox'), 99 | trailing: Icon(FontAwesomeIcons.fortAwesome), 100 | onTap: () { 101 | Navigator.of(context).pop(); 102 | Navigator.pushReplacement(context, MaterialPageRoute( builder: (BuildContext context) => SandboxPage() )); 103 | }, 104 | ), 105 | ], 106 | ), 107 | ); 108 | } 109 | } -------------------------------------------------------------------------------- /example/lib/pages/sandbox_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_jsx/flutter_jsx.dart'; 3 | import 'package:flutter_responsive/flutter_responsive.dart'; 4 | import 'package:flutter_responsive_example/layouts/sidebar.dart'; 5 | 6 | class SandboxPage extends StatefulWidget { 7 | @override 8 | _SandboxPage createState() => new _SandboxPage(); 9 | } 10 | 11 | class _SandboxPage extends State { 12 | 13 | bool highlight, displayInline; 14 | DisplayLine displayLine; 15 | 16 | @override 17 | void initState() { 18 | highlight = false; 19 | displayInline = false; 20 | displayLine = DisplayLine.block; 21 | super.initState(); 22 | } 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | 27 | Color 28 | hilightedColor = Colors.yellowAccent, 29 | hilightColor = highlight ? hilightedColor : Colors.transparent; 30 | 31 | TextStyle defaultStyle = TextStyle( 32 | inherit: true, 33 | color: Colors.black 34 | ); 35 | 36 | return Scaffold( 37 | appBar: AppBar( 38 | title: const Text( 39 | 'SandBox', overflow: TextOverflow.ellipsis), 40 | ), 41 | drawer: Sidebar(), 42 | body: DefaultTextStyle( 43 | style: defaultStyle, 44 | child: ListView( 45 | children: [ 46 | ResponsiveContainer( 47 | padding: EdgeInsets.all(10), 48 | children: [ 49 | 50 | /* *************************************************** 51 | Options 52 | */ 53 | ResponsiveRow( 54 | padding: EdgeInsets.symmetric(vertical: 10), 55 | children: [ 56 | SwitchListTile( 57 | title: Text('Hilight text boxes'), 58 | value: highlight, 59 | activeColor: hilightedColor, 60 | onChanged: (selected){ 61 | setState(() { 62 | highlight = selected; 63 | }); 64 | } 65 | ), 66 | SwitchListTile( 67 | title: Text('Textbox displays inline'), 68 | value: displayInline, 69 | activeColor: hilightedColor, 70 | onChanged: (selected){ 71 | setState(() { 72 | displayInline = selected; 73 | displayLine = selected ? DisplayLine.inline : DisplayLine.block; 74 | }); 75 | } 76 | ), 77 | ] 78 | ), 79 | 80 | /* *************************************************** 81 | Divider 82 | */ 83 | ResponsiveRow( 84 | margin: EdgeInsets.only(bottom: 40), 85 | children: [ 86 | Divider(height: 5, color: Color.fromARGB(255, 86, 61, 124)) 87 | ], 88 | ), 89 | 90 | /* *************************************************** 91 | Examples 92 | */ 93 | ResponsiveRow( 94 | alignment: Alignment.topRight, 95 | padding: EdgeInsets.only(bottom: 20), 96 | children: [ 97 | 98 | JSX( 99 | 'R\$ 99,00', 100 | stylesheet: { 101 | 'b': JSXStylesheet( 102 | margin: EdgeInsets.only(left: 10), 103 | textAlign: TextAlign.right, 104 | textStyle: TextStyle( fontSize: 30, color: Colors.white, backgroundColor: Colors.blue ) 105 | ) 106 | }, 107 | margin: EdgeInsets.all(10.0), 108 | backgroundColor: hilightColor, 109 | display: displayLine, 110 | ), 111 | 112 | JSX( 113 | 'R\$ 99,00', 114 | stylesheet: { 115 | 'b': JSXStylesheet( 116 | margin: EdgeInsets.only(left: 10), 117 | textAlign: TextAlign.right, 118 | textStyle: TextStyle( fontSize: 30, color: Colors.white, backgroundColor: Colors.blue ) 119 | ) 120 | }, 121 | margin: EdgeInsets.all(10.0), 122 | backgroundColor: hilightColor, 123 | display: displayLine, 124 | ), 125 | 126 | ], 127 | ), 128 | 129 | ], 130 | ) 131 | ], 132 | ), 133 | ) 134 | ); 135 | } 136 | } -------------------------------------------------------------------------------- /example/lib/pages/grids_performance.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_responsive/flutter_responsive.dart'; 3 | import 'package:flutter_responsive_example/layouts/sidebar.dart'; 4 | import 'dart:math'; 5 | 6 | class GridPerformancePage extends StatefulWidget { 7 | 8 | @override 9 | _GridPerformancePage createState() => new _GridPerformancePage(); 10 | } 11 | 12 | class _GridPerformancePage extends State { 13 | 14 | double displayLines = 10; 15 | double amountLines, heightBoxes, seed; 16 | bool switchTest; 17 | int columns; 18 | 19 | void updateSeed(){ 20 | seed = Random().nextDouble(); 21 | } 22 | 23 | @override 24 | void initState() { 25 | switchTest = true; 26 | amountLines = displayLines; 27 | heightBoxes = 150; 28 | columns = 2; 29 | 30 | updateSeed(); 31 | super.initState(); 32 | } 33 | 34 | var _letterStyle = TextStyle(fontWeight: FontWeight.bold, color: Colors.white); 35 | 36 | @override 37 | Widget build(BuildContext context) { 38 | 39 | return Scaffold( 40 | appBar: AppBar( 41 | title: const Text( 42 | 'Grid Performance', overflow: TextOverflow.ellipsis), 43 | ), 44 | drawer: Sidebar(), 45 | body: Scrollbar( 46 | child: ListView( 47 | children: [ 48 | SwitchListTile( 49 | value: switchTest, 50 | onChanged: (bool value) => setState(() => switchTest = value), 51 | title: Text('Switch to Responsive cols', style: TextStyle(fontWeight: FontWeight.bold, color: Colors.red)), 52 | ), 53 | Slider( 54 | min: 0.0, 55 | max: 100.0, 56 | divisions: 20, 57 | value: displayLines, 58 | label: '${displayLines.round()}', 59 | onChanged: (double value) { 60 | setState(() { 61 | displayLines = value; 62 | }); 63 | }, 64 | onChangeEnd: (double value) { 65 | setState(() { 66 | amountLines = value; 67 | updateSeed(); 68 | }); 69 | }, 70 | ), 71 | Slider( 72 | min: 0.0, 73 | max: 12.0, 74 | divisions: 12, 75 | value: columns.toDouble(), 76 | label: columns.toString(), 77 | onChanged: (double value) { 78 | setState(() { 79 | columns = value.toInt(); 80 | }); 81 | } 82 | ), 83 | ]..addAll( 84 | switchTest ? 85 | List.generate(amountLines.toInt(), (index) => index).map((rowIndex) => 86 | ResponsiveRow( 87 | backgroundColor: Colors.red, 88 | margin: EdgeInsets.symmetric(horizontal: 20, vertical: 10), 89 | children: List.generate(columns, (index) => index).map((colIndex) => 90 | ResponsiveCol( 91 | alignment: Alignment.center, 92 | backgroundColor: Color((seed * (rowIndex * 12 + colIndex) * 0xFFFFFF).toInt() << 0), 93 | height: heightBoxes, 94 | gridSizes: { ScreenSize.us : 1 }, 95 | children: [ 96 | Text('R', style: _letterStyle) 97 | ], 98 | ) 99 | ).toList(), 100 | ) 101 | ) : 102 | List.generate(amountLines.toInt(), (index) => index).map((rowIndex) => 103 | Container( 104 | alignment: Alignment.topLeft, 105 | margin: EdgeInsets.symmetric(horizontal: 20, vertical: 10), 106 | color: Colors.red, 107 | child: Wrap( 108 | children: List.generate(columns, (index) => index).map((colIndex) => 109 | FractionallySizedBox( 110 | widthFactor: 0.08332333333,//1.0/12.0 - 0.00001, 111 | //heightFactor: 1.0, 112 | child: Container( 113 | alignment: Alignment.center, 114 | height: heightBoxes, 115 | color: Color((seed * (rowIndex * 12 + colIndex) * 0xFFFFFF).toInt() << 0), 116 | child: Text('B', style: _letterStyle), 117 | ), 118 | ) 119 | ).toList() 120 | ) 121 | //), 122 | ) 123 | ).toList() 124 | ) 125 | /* 126 | ResponsiveContainer( 127 | children: List.generate(1, (index) => index).map((index) => 128 | ResponsiveRow( 129 | backgroundColor: Colors.red, 130 | margin: EdgeInsets.symmetric(horizontal: 20, vertical: 10), 131 | children: List.generate(12, (index) => index).map((index) => 132 | ResponsiveCol( 133 | alignment: Alignment.center, 134 | backgroundColor: Color((Random().nextDouble() * 0xFFFFFF).toInt() << 0).withOpacity(1.0), 135 | height: 50, 136 | gridSizes: [ GridSize.xs_1 ], 137 | children: [ 138 | Text('B', style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white)) 139 | ], 140 | ) 141 | ).toList(), 142 | ) 143 | ).toList(), 144 | ) 145 | */ 146 | ) 147 | ), 148 | ); 149 | } 150 | } -------------------------------------------------------------------------------- /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.5.0-nullsafety.3" 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-nullsafety.3" 18 | characters: 19 | dependency: transitive 20 | description: 21 | name: characters 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.0-nullsafety.5" 25 | charcode: 26 | dependency: transitive 27 | description: 28 | name: charcode 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.2.0-nullsafety.3" 32 | clock: 33 | dependency: transitive 34 | description: 35 | name: clock 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.0-nullsafety.3" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.15.0-nullsafety.5" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.3" 60 | cupertino_icons: 61 | dependency: "direct main" 62 | description: 63 | name: cupertino_icons 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "0.1.3" 67 | extended_image: 68 | dependency: "direct main" 69 | description: 70 | name: extended_image 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "0.6.8" 74 | extended_image_library: 75 | dependency: transitive 76 | description: 77 | name: extended_image_library 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "0.1.9" 81 | fake_async: 82 | dependency: transitive 83 | description: 84 | name: fake_async 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "1.2.0-nullsafety.3" 88 | flutter: 89 | dependency: "direct main" 90 | description: flutter 91 | source: sdk 92 | version: "0.0.0" 93 | flutter_jsx: 94 | dependency: "direct main" 95 | description: 96 | name: flutter_jsx 97 | url: "https://pub.dartlang.org" 98 | source: hosted 99 | version: "0.0.1" 100 | flutter_responsive: 101 | dependency: "direct dev" 102 | description: 103 | path: ".." 104 | relative: true 105 | source: path 106 | version: "1.0.0" 107 | flutter_test: 108 | dependency: "direct dev" 109 | description: flutter 110 | source: sdk 111 | version: "0.0.0" 112 | font_awesome_flutter: 113 | dependency: "direct main" 114 | description: 115 | name: font_awesome_flutter 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "8.5.0" 119 | http: 120 | dependency: transitive 121 | description: 122 | name: http 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "0.12.0+2" 126 | http_client_helper: 127 | dependency: transitive 128 | description: 129 | name: http_client_helper 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "0.2.1" 133 | http_parser: 134 | dependency: transitive 135 | description: 136 | name: http_parser 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "3.1.3" 140 | matcher: 141 | dependency: transitive 142 | description: 143 | name: matcher 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "0.12.10-nullsafety.3" 147 | meta: 148 | dependency: transitive 149 | description: 150 | name: meta 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "1.3.0-nullsafety.6" 154 | path: 155 | dependency: transitive 156 | description: 157 | name: path 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "1.8.0-nullsafety.3" 161 | path_provider: 162 | dependency: transitive 163 | description: 164 | name: path_provider 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "1.5.1" 168 | pedantic: 169 | dependency: transitive 170 | description: 171 | name: pedantic 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "1.8.0+1" 175 | platform: 176 | dependency: transitive 177 | description: 178 | name: platform 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "2.2.1" 182 | sky_engine: 183 | dependency: transitive 184 | description: flutter 185 | source: sdk 186 | version: "0.0.99" 187 | source_span: 188 | dependency: transitive 189 | description: 190 | name: source_span 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "1.8.0-nullsafety.4" 194 | stack_trace: 195 | dependency: transitive 196 | description: 197 | name: stack_trace 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "1.10.0-nullsafety.6" 201 | stream_channel: 202 | dependency: transitive 203 | description: 204 | name: stream_channel 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "2.1.0-nullsafety.3" 208 | string_scanner: 209 | dependency: transitive 210 | description: 211 | name: string_scanner 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "1.1.0-nullsafety.3" 215 | term_glyph: 216 | dependency: transitive 217 | description: 218 | name: term_glyph 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "1.2.0-nullsafety.3" 222 | test_api: 223 | dependency: transitive 224 | description: 225 | name: test_api 226 | url: "https://pub.dartlang.org" 227 | source: hosted 228 | version: "0.2.19-nullsafety.6" 229 | typed_data: 230 | dependency: transitive 231 | description: 232 | name: typed_data 233 | url: "https://pub.dartlang.org" 234 | source: hosted 235 | version: "1.3.0-nullsafety.5" 236 | vector_math: 237 | dependency: transitive 238 | description: 239 | name: vector_math 240 | url: "https://pub.dartlang.org" 241 | source: hosted 242 | version: "2.1.0-nullsafety.5" 243 | sdks: 244 | dart: ">=2.12.0-0.0 <3.0.0" 245 | flutter: ">=1.10.0 <2.0.0" 246 | -------------------------------------------------------------------------------- /test/responsive_col_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_responsive/src/responsive_enum.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:flutter_responsive/flutter_responsive.dart'; 4 | 5 | void main() { 6 | 7 | String businessRule; 8 | 9 | // Function to automate border limit tests 10 | bool testLimitSize( ScreenSize tagSize, double limit, bool expected1, bool expected2, bool expected3 ){ 11 | 12 | return ResponsiveScreen.isScreenSize(tagSize, limit - 1) == expected1 13 | && ResponsiveScreen.isScreenSize(tagSize, limit + 0) == expected2 14 | && ResponsiveScreen.isScreenSize(tagSize, limit + 1) == expected3; 15 | } 16 | 17 | testWidgets('Ultra small grid tests', (WidgetTester tester) async { 18 | 19 | businessRule = 'Ultra small grid should be fractionated for every screen size'; 20 | expect( testLimitSize( ScreenSize.us, ResponsiveScreen.limits[ScreenSize.us], true, true, true ), true, reason: businessRule); 21 | expect( testLimitSize( ScreenSize.us, ResponsiveScreen.limits[ScreenSize.xs], true, true, true ), true, reason: businessRule); 22 | expect( testLimitSize( ScreenSize.us, ResponsiveScreen.limits[ScreenSize.sm], true, true, true ), true, reason: businessRule); 23 | expect( testLimitSize( ScreenSize.us, ResponsiveScreen.limits[ScreenSize.md], true, true, true ), true, reason: businessRule); 24 | expect( testLimitSize( ScreenSize.us, ResponsiveScreen.limits[ScreenSize.lg], true, true, true ), true, reason: businessRule); 25 | expect( testLimitSize( ScreenSize.us, ResponsiveScreen.limits[ScreenSize.xl], true, true, true ), true, reason: businessRule); 26 | expect( testLimitSize( ScreenSize.us, ResponsiveScreen.limits[ScreenSize.ul], true, true, true ), true, reason: businessRule); 27 | 28 | }); 29 | 30 | testWidgets('Extra small grid tests', (WidgetTester tester) async { 31 | 32 | businessRule = 'Extra small grid should be fractionated only for screens equal or greater than extra small limit. Otherwise should get full parent width.'; 33 | expect( testLimitSize( ScreenSize.xs, ResponsiveScreen.limits[ScreenSize.us], false, false, false ), true, reason: businessRule); 34 | expect( testLimitSize( ScreenSize.xs, ResponsiveScreen.limits[ScreenSize.xs], false, true, true ), true, reason: businessRule); 35 | expect( testLimitSize( ScreenSize.xs, ResponsiveScreen.limits[ScreenSize.sm], true, true, true ), true, reason: businessRule); 36 | expect( testLimitSize( ScreenSize.xs, ResponsiveScreen.limits[ScreenSize.md], true, true, true ), true, reason: businessRule); 37 | expect( testLimitSize( ScreenSize.xs, ResponsiveScreen.limits[ScreenSize.lg], true, true, true ), true, reason: businessRule); 38 | expect( testLimitSize( ScreenSize.xs, ResponsiveScreen.limits[ScreenSize.xl], true, true, true ), true, reason: businessRule); 39 | expect( testLimitSize( ScreenSize.xs, ResponsiveScreen.limits[ScreenSize.ul], true, true, true ), true, reason: businessRule); 40 | 41 | }); 42 | 43 | testWidgets('Small grid tests', (WidgetTester tester) async { 44 | 45 | businessRule = 'Small grid should be fractionated only for screens equal or greater than small limit. Otherwise should get full parent width.'; 46 | expect( testLimitSize( ScreenSize.sm, ResponsiveScreen.limits[ScreenSize.us], false, false, false ), true, reason: businessRule); 47 | expect( testLimitSize( ScreenSize.sm, ResponsiveScreen.limits[ScreenSize.xs], false, false, false ), true, reason: businessRule); 48 | expect( testLimitSize( ScreenSize.sm, ResponsiveScreen.limits[ScreenSize.sm], false, true, true ), true, reason: businessRule); 49 | expect( testLimitSize( ScreenSize.sm, ResponsiveScreen.limits[ScreenSize.md], true, true, true ), true, reason: businessRule); 50 | expect( testLimitSize( ScreenSize.sm, ResponsiveScreen.limits[ScreenSize.lg], true, true, true ), true, reason: businessRule); 51 | expect( testLimitSize( ScreenSize.sm, ResponsiveScreen.limits[ScreenSize.xl], true, true, true ), true, reason: businessRule); 52 | expect( testLimitSize( ScreenSize.sm, ResponsiveScreen.limits[ScreenSize.ul], true, true, true ), true, reason: businessRule); 53 | 54 | }); 55 | 56 | testWidgets('Medium grid tests', (WidgetTester tester) async { 57 | 58 | businessRule = 'Medium grid should be fractionated only for screens equal or greater than medium limit. Otherwise should get full parent width.'; 59 | expect( testLimitSize( ScreenSize.md, ResponsiveScreen.limits[ScreenSize.us], false, false, false ), true, reason: businessRule); 60 | expect( testLimitSize( ScreenSize.md, ResponsiveScreen.limits[ScreenSize.xs], false, false, false ), true, reason: businessRule); 61 | expect( testLimitSize( ScreenSize.md, ResponsiveScreen.limits[ScreenSize.sm], false, false, false ), true, reason: businessRule); 62 | expect( testLimitSize( ScreenSize.md, ResponsiveScreen.limits[ScreenSize.md], false, true, true ), true, reason: businessRule); 63 | expect( testLimitSize( ScreenSize.md, ResponsiveScreen.limits[ScreenSize.lg], true, true, true ), true, reason: businessRule); 64 | expect( testLimitSize( ScreenSize.md, ResponsiveScreen.limits[ScreenSize.xl], true, true, true ), true, reason: businessRule); 65 | expect( testLimitSize( ScreenSize.md, ResponsiveScreen.limits[ScreenSize.ul], true, true, true ), true, reason: businessRule); 66 | 67 | }); 68 | 69 | testWidgets('Large grid tests', (WidgetTester tester) async { 70 | 71 | businessRule = 'Large grid should be fractionated only for screens equal or greater than large limit. Otherwise should get full parent width.'; 72 | expect( testLimitSize( ScreenSize.lg, ResponsiveScreen.limits[ScreenSize.us], false, false, false ), true, reason: businessRule); 73 | expect( testLimitSize( ScreenSize.lg, ResponsiveScreen.limits[ScreenSize.xs], false, false, false ), true, reason: businessRule); 74 | expect( testLimitSize( ScreenSize.lg, ResponsiveScreen.limits[ScreenSize.sm], false, false, false ), true, reason: businessRule); 75 | expect( testLimitSize( ScreenSize.lg, ResponsiveScreen.limits[ScreenSize.md], false, false, false ), true, reason: businessRule); 76 | expect( testLimitSize( ScreenSize.lg, ResponsiveScreen.limits[ScreenSize.lg], false, true, true ), true, reason: businessRule); 77 | expect( testLimitSize( ScreenSize.lg, ResponsiveScreen.limits[ScreenSize.xl], true, true, true ), true, reason: businessRule); 78 | expect( testLimitSize( ScreenSize.lg, ResponsiveScreen.limits[ScreenSize.ul], true, true, true ), true, reason: businessRule); 79 | 80 | }); 81 | 82 | testWidgets('Extra large grid tests', (WidgetTester tester) async { 83 | 84 | businessRule = 'Extra large grid should be fractionated only for screens equal or greater than extra large limit. Otherwise should get full parent width.'; 85 | expect( testLimitSize( ScreenSize.xl, ResponsiveScreen.limits[ScreenSize.us], false, false, false ), true, reason: businessRule); 86 | expect( testLimitSize( ScreenSize.xl, ResponsiveScreen.limits[ScreenSize.xs], false, false, false ), true, reason: businessRule); 87 | expect( testLimitSize( ScreenSize.xl, ResponsiveScreen.limits[ScreenSize.sm], false, false, false ), true, reason: businessRule); 88 | expect( testLimitSize( ScreenSize.xl, ResponsiveScreen.limits[ScreenSize.md], false, false, false ), true, reason: businessRule); 89 | expect( testLimitSize( ScreenSize.xl, ResponsiveScreen.limits[ScreenSize.lg], false, false, false ), true, reason: businessRule); 90 | expect( testLimitSize( ScreenSize.xl, ResponsiveScreen.limits[ScreenSize.xl], false, true, true ), true, reason: businessRule); 91 | expect( testLimitSize( ScreenSize.xl, ResponsiveScreen.limits[ScreenSize.ul], true, true, true ), true, reason: businessRule); 92 | 93 | }); 94 | 95 | testWidgets('Ultra large grid tests', (WidgetTester tester) async { 96 | 97 | businessRule = 'Ultra large grid should be fractionated only for screens equal or greater than extra large limit. Otherwise should get full parent width.'; 98 | expect( testLimitSize( ScreenSize.ul, ResponsiveScreen.limits[ScreenSize.us], false, false, false ), true, reason: businessRule); 99 | expect( testLimitSize( ScreenSize.ul, ResponsiveScreen.limits[ScreenSize.xs], false, false, false ), true, reason: businessRule); 100 | expect( testLimitSize( ScreenSize.ul, ResponsiveScreen.limits[ScreenSize.sm], false, false, false ), true, reason: businessRule); 101 | expect( testLimitSize( ScreenSize.ul, ResponsiveScreen.limits[ScreenSize.md], false, false, false ), true, reason: businessRule); 102 | expect( testLimitSize( ScreenSize.ul, ResponsiveScreen.limits[ScreenSize.lg], false, false, false ), true, reason: businessRule); 103 | expect( testLimitSize( ScreenSize.ul, ResponsiveScreen.limits[ScreenSize.xl], false, false, false ), true, reason: businessRule); 104 | expect( testLimitSize( ScreenSize.ul, ResponsiveScreen.limits[ScreenSize.ul], false, true, true ), true, reason: businessRule); 105 | 106 | }); 107 | 108 | } 109 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # About ```flutter_responsive``` plugin 2 | 3 | ![example_6](example/assets/example6.png "Responsive grid tests") 4 | ![example_7](example/assets/example7.png "Responsive text tests") 5 | 6 | This plugin provides a easy and productive way to work with responsive layouts for Flutter Applications in mobile, desktop and web, allowing your layout to adapt and wrap widgets ( Container, Rows, Columns and RichText ) referent to the size of his parent element. 7 | 8 | Made by [Rafael Setragni](https://br.linkedin.com/in/rafael-setragni-55702823) to all Flutter's Community. 9 | 10 | ## Licensing 11 | 12 | This project follows the GNU General Public License V3, wich means you can change the entire project the way as you want to, but you need to share your improvements back to the community. 13 | 14 | To share your improvements, please first do a Fork of this project, change what you need to and finally do a pull request. And don´t let to share your ideas and needs on "Issues" page, even before to start your changes. 15 | 16 | 17 | # IMPORTANT NOTES: 18 | 19 | * This plugin was based on [Bootstrap Web Project](https://getbootstrap.com/), but do not implement all its features (not yet). 20 | * The column's layer responsiveness is based on the size of the global screen, such as Bootstrap does. 21 | * All the widgets contains margin, padding, width, height (maximum and minimum edges), such as ```div``` Html element. 22 | * Fell free to improve and change this project. 23 | 24 | 25 | # How to Use 26 | 27 | Add the dependency bellow into your ```pubspec.yaml``` file. 28 | 29 | ```yaml 30 | dependencies: 31 | flutter_responsive: ^0.0.6 #Please, ensure to use the most updated version 32 | ``` 33 | Add the reference into your ```.dart``` files 34 | ```dart 35 | import 'package:flutter_responsive/flutter_responsive.dart'; 36 | ``` 37 | Use the Widgets ```ResponsiveContainer```, ```ResponsiveRow```, ```ResponsiveCol``` and ```JSX``` as the way you want to. 38 | 39 | ## Screen Sizes 40 | 41 | This plugin was based on Bootstrap web project and split the screen in 12 columns, considering 7 screen sizes: 42 | 43 | * US - Ultra Small Screens - 0px to 309px 44 | * XS - Extra Small Screens - 310px to 575px 45 | * SM - Small Screens - 576px to 767px 46 | * MD - Medium Screens - 768px to 991px 47 | * LG - Large Small Screens - 992px to 1199px 48 | * XL - Extra Large Screens - 1200px to 1999px 49 | * UL - Ultra Large Screens - 2000px and beyond 50 | 51 | ![example_1](example/assets/example1.png "Screen size test") 52 | ![example_2](example/assets/example2.png "Screen size test") 53 | ![example_3](example/assets/example3.png "Screen size test") 54 | ![example_4](example/assets/example4.png "Screen size test") 55 | 56 | 57 | ## Personalizing limits (Optional) 58 | 59 | All the limits could be personalized as you need, changing the limit Hashmap into ResponsiveScreen class. 60 | 61 | ```dart 62 | /* Map */ 63 | ResponsiveScreen.limits = { 64 | ScreenSize.us: 0.00, 65 | // Smart watches 66 | ScreenSize.xs: 310.00, 67 | // Small phones (5c) 68 | ScreenSize.sm: 576.00, 69 | // Medium phones 70 | ScreenSize.md: 768.00, 71 | // Large phones (iPhone X) 72 | ScreenSize.lg: 992.00, 73 | // Tablets 74 | ScreenSize.xl: 1200.00, 75 | // Laptops 76 | ScreenSize.ul: 2000.00, 77 | // Desktops and TVs 4K 78 | }; 79 | ``` 80 | 81 | ## Grid Usage 82 | 83 | This plugin have 3 major grid elements: 84 | 85 | * ResponsiveContainer: Container to all page elements, such as Rows and Columns, centralizing the content and beeing limited to a maximum width size 86 | ```dart 87 | ResponsiveContainer( 88 | 89 | // Determines the container's limit size 90 | widthLimit: ResponsiveScreen.limits[ScreenSize.lg], 91 | margin: EdgeInsets.symmetric(horizontal: 10), 92 | 93 | children: [ 94 | 95 | ResponsiveRow(), 96 | ResponsiveRow(), 97 | ResponsiveRow(), 98 | 99 | ] 100 | ) 101 | ``` 102 | 103 | * ResponsiveRow: Container wich contains many columns or even other widget. 104 | OBS: Its not necessary to wrap inner widgets into a ResponsiveCol object. 105 | ```dart 106 | ResponsiveRow( 107 | 108 | margin: EdgeInsets.only(top: 20, bottom: 5), 109 | 110 | children: [ 111 | 112 | ResponsiveCol(), 113 | ResponsiveCol(), 114 | ResponsiveCol(), 115 | 116 | Text('It´s fine to use another widget directly inside a ResponsiveRow') 117 | ] 118 | ), 119 | ``` 120 | 121 | * ResponsiveCol: 122 | ```dart 123 | ResponsiveCol( 124 | margin: EdgeInsets.all(10), 125 | padding: EdgeInsets.all(10), 126 | backgroundColor: Colors.blue, 127 | gridSizes: { 128 | ScreenSize.xs : 4, 129 | ScreenSize.sm : 3, 130 | ScreenSize.lg : 2, 131 | ScreenSize.xl : 1, 132 | }, 133 | children: [ 134 | Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit') 135 | ] 136 | ) 137 | ``` 138 | 139 | ## Full Example 140 | 141 | ```dart 142 | import 'package:flutter/material.dart'; 143 | import 'package:flutter_responsive/flutter_responsive.dart'; 144 | 145 | class HomePage extends StatefulWidget { 146 | @override 147 | _HomePage createState() => _HomePage(); 148 | } 149 | 150 | class _HomePage extends State { 151 | 152 | @override 153 | void initState() { 154 | super.initState(); 155 | } 156 | 157 | @override 158 | Widget build(BuildContext context) { 159 | 160 | /*create 12 columns*/ 161 | List responsiveGridExample = 162 | 163 | /*repeat 12 times*/ 164 | List.generate(12, (index) => index).map((colIndex) => 165 | ResponsiveCol( 166 | padding: EdgeInsets.all(10), 167 | backgroundColor: Colors.blue, 168 | gridSizes: { 169 | ScreenSize.xs : 4, 170 | ScreenSize.sm : 3, 171 | ScreenSize.lg : 2, 172 | ScreenSize.xl : 1, 173 | }, 174 | children: [ 175 | Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit') 176 | ] 177 | ) 178 | ).toList(); 179 | 180 | MediaQueryData mediaQuery = MediaQuery.of(context); 181 | 182 | return Scaffold( 183 | appBar: AppBar( 184 | title: const Text('Home', overflow: TextOverflow.ellipsis), 185 | ), 186 | body: Container( 187 | color: Color(0xFFCCCCCC), 188 | child: ListView( 189 | children: [ 190 | ResponsiveContainer( 191 | margin: EdgeInsets.symmetric(vertical: 10), 192 | padding: EdgeInsets.symmetric(horizontal: 10), 193 | backgroundColor: Colors.white, 194 | widthLimit: mediaQuery.size.width * 0.95, 195 | children: [ 196 | ResponsiveRow( 197 | margin: EdgeInsets.symmetric(vertical: 10), 198 | children: [ 199 | 200 | ResponsiveCol( 201 | padding: EdgeInsets.all(10), 202 | margin: EdgeInsets.only(bottom: 20), 203 | backgroundColor: Colors.blueGrey, 204 | children: [ 205 | Text('Flutter Responsive Layout', style: JSXTypography.h4.merge(TextStyle(color: Colors.white))) 206 | ] 207 | ), 208 | ] 209 | ), 210 | ResponsiveRow( 211 | margin: EdgeInsets.symmetric(vertical: 10), 212 | children: [ 213 | 214 | // By default, the column occupies the entire row, always 215 | ResponsiveCol( 216 | children: [ 217 | JSX( 218 | shrinkToFit: true, 219 | padding: EdgeInsets.only(bottom: 20), 220 | stylesheet: { 221 | 'h3': JSXStylesheet( 222 | textStyle: TextStyle(color: Theme.of(context).primaryColor), 223 | displayLine: DisplayLine.block 224 | ), 225 | 'h6': JSXStylesheet( 226 | textStyle: TextStyle(color: Theme.of(context).primaryColor), 227 | displayLine: DisplayLine.block 228 | ) 229 | }, 230 | margin: EdgeInsets.symmetric(horizontal: 10, vertical: 20), 231 | text: 232 | '
' 233 | '

Responsive Layouts

for Flutter
' 234 | '

' 235 | '

This RichText was easily produced and personalized using pure HTML

' 236 | '

Bellow there is an example of 12 columns, wich changes the amount of each line depending of his father´s widget size.

' 237 | '
', 238 | ) 239 | ] 240 | ) 241 | 242 | ]..addAll( 243 | responsiveGridExample 244 | ) 245 | ) 246 | ], 247 | ) 248 | ], 249 | ), 250 | ) 251 | ); 252 | } 253 | } 254 | ``` 255 | 256 | ### Final result: 257 | ![example_9](example/assets/example7.png "Final result") 258 | 259 | # How to run the plugin example 260 | 261 | This project is a starting point for a Flutter 262 | [plug-in package](https://flutter.dev/developing-packages/), 263 | a specialized package that includes platform-specific implementation code for 264 | Android and/or iOS. 265 | 266 | For help getting started with Flutter, view our 267 | [online documentation](https://flutter.dev/docs), which offers tutorials, 268 | samples, guidance on mobile development, and a full API reference. 269 | 270 | To run the full example App, wich contains performance and case tests, do the steps bellow: 271 | 272 | * Clone this project into your local machine using Github Desktop or any other git program of your preference. 273 | * Download Android Studio and the last Flutter SDK into your local machine. Configure they to works properly such as [this article here](https://flutter.dev/docs/get-started/editor?tab=vscode) 274 | * Run ```flutter pub get``` to update all the dependencies 275 | * Debug the file ```example/lib/main.dart``` or any of the unity case tests located on ```test``` folder on emulator or real device. 276 | * To run properly the performance tests, please run the app using ```flutter run --release``` -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 38 | 39 | 41 | 42 | 44 | 45 | 46 | 47 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 78 | 79 | 82 | 83 | 86 | 87 | 90 | 91 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 1576519272251 111 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | localStylesheet.textStyle.color != Colors.red 169 | Dart 170 | EXPRESSION 171 | 172 | 173 | newStylesheet.textStyle.color == Colors.red 174 | Dart 175 | EXPRESSION 176 | 177 | 178 | 179 | 180 | newStylesheet.textStyle.color 181 | Dart 182 | EXPRESSION 183 | 184 | 185 | localStylesheet.textStyle.color 186 | Dart 187 | EXPRESSION 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /example/lib/pages/grids_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_jsx/flutter_jsx.dart'; 3 | import 'package:flutter_responsive/flutter_responsive.dart'; 4 | import 'package:flutter_responsive_example/layouts/sidebar.dart'; 5 | 6 | class GridPage extends StatefulWidget { 7 | @override 8 | _GridPage createState() => _GridPage(); 9 | } 10 | 11 | class _GridPage extends State { 12 | 13 | List _aLotOfText = [ 14 | Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim' 15 | ' veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate' 16 | ' velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit ' 17 | 'anim id est laborum.') 18 | ], 19 | _smallText = [ 20 | Text('Lorem ipsum dolor sit amet, consectetur adipiscing elit') 21 | ]; 22 | 23 | @override 24 | void initState() { 25 | super.initState(); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | 31 | MediaQueryData mediaQuery = MediaQuery.of(context); 32 | double screenSize = mediaQuery.size.width; 33 | 34 | return Scaffold( 35 | appBar: AppBar( 36 | title: const Text('Grid Examples', overflow: TextOverflow.ellipsis), 37 | ), 38 | drawer: Sidebar(), 39 | body: ListView( 40 | children: [ 41 | ResponsiveContainer( 42 | 43 | // Determines the container's limit size 44 | maxWidth: ResponsiveScreen.limits[ScreenSize.lg], 45 | 46 | margin: EdgeInsets.symmetric(horizontal: 10), 47 | 48 | children: [ 49 | 50 | ResponsiveRow( 51 | margin: EdgeInsets.symmetric(vertical: 10), 52 | children: [ 53 | 54 | ResponsiveCol( 55 | padding: EdgeInsets.all(10), 56 | margin: EdgeInsets.only(bottom: 20), 57 | backgroundColor: Colors.blueGrey, 58 | children: [ 59 | Text('Actual Screen Size: '+mediaQuery.size.width.toString()+'px', style: JSXTypography.h4) 60 | ] 61 | ), 62 | ResponsiveCol( 63 | padding: EdgeInsets.all(10), 64 | gridSizes: { 65 | ScreenSize.xs: 12 66 | }, 67 | backgroundColor: ResponsiveScreen.isScreenSize(ScreenSize.us, screenSize) ? Colors.green : Colors.red, 68 | children: [ 69 | Text('Is Ultra Small Screen:\n('+ResponsiveScreen.limits[ScreenSize.us].toString()+'px)', style: JSXTypography.h4), 70 | Text( ResponsiveScreen.isScreenSize(ScreenSize.us, screenSize) ? 'true' : 'false') 71 | ] 72 | ), 73 | ResponsiveCol( 74 | padding: EdgeInsets.all(10), 75 | gridSizes: { 76 | ScreenSize.xs: 12 77 | }, 78 | backgroundColor: ResponsiveScreen.isScreenSize(ScreenSize.xs, screenSize) ? Colors.green : Colors.red, 79 | children: [ 80 | Text('Is Extra Small Screen:\n('+ResponsiveScreen.limits[ScreenSize.xs].toString()+'px)', style: JSXTypography.h4), 81 | Text( ResponsiveScreen.isScreenSize(ScreenSize.xs, screenSize) ? 'true' : 'false') 82 | ] 83 | ), 84 | ResponsiveCol( 85 | padding: EdgeInsets.all(10), 86 | backgroundColor: ResponsiveScreen.isScreenSize(ScreenSize.sm, screenSize) ? Colors.green : Colors.red, 87 | gridSizes: { 88 | ScreenSize.xs: 12 89 | }, 90 | children: [ 91 | Text('Is Small Screen:\n('+ResponsiveScreen.limits[ScreenSize.sm].toString()+'px)', style: JSXTypography.h4), 92 | Text( ResponsiveScreen.isScreenSize(ScreenSize.sm, screenSize) ? 'true' : 'false') 93 | ] 94 | ), 95 | ResponsiveCol( 96 | padding: EdgeInsets.all(10), 97 | backgroundColor: ResponsiveScreen.isScreenSize(ScreenSize.md, screenSize) ? Colors.green : Colors.red, 98 | gridSizes: { 99 | ScreenSize.xs: 12 100 | }, 101 | children: [ 102 | Text('Is Medium Screen:\n('+ResponsiveScreen.limits[ScreenSize.md].toString()+'px)', style: JSXTypography.h4), 103 | Text( ResponsiveScreen.isScreenSize(ScreenSize.md, screenSize) ? 'true' : 'false') 104 | ] 105 | ), 106 | ResponsiveCol( 107 | padding: EdgeInsets.all(10), 108 | backgroundColor: ResponsiveScreen.isScreenSize(ScreenSize.lg, screenSize) ? Colors.green : Colors.red, 109 | gridSizes: { 110 | ScreenSize.xs: 12 111 | }, 112 | children: [ 113 | Text('Is Large Screen:\n('+ResponsiveScreen.limits[ScreenSize.lg].toString()+'px)', style: JSXTypography.h4), 114 | Text( ResponsiveScreen.isScreenSize(ScreenSize.lg, screenSize) ? 'true' : 'false') 115 | ] 116 | ), 117 | ResponsiveCol( 118 | padding: EdgeInsets.all(10), 119 | backgroundColor: ResponsiveScreen.isScreenSize(ScreenSize.xl, screenSize) ? Colors.green : Colors.red, 120 | gridSizes: { 121 | ScreenSize.xs: 12 122 | }, 123 | children: [ 124 | Text('Is Extra Large Screen:\n('+ResponsiveScreen.limits[ScreenSize.xl].toString()+'px)', style: JSXTypography.h4), 125 | Text( ResponsiveScreen.isScreenSize(ScreenSize.xl, screenSize) ? 'true' : 'false') 126 | ] 127 | ), 128 | ResponsiveCol( 129 | padding: EdgeInsets.all(10), 130 | backgroundColor: ResponsiveScreen.isScreenSize(ScreenSize.ul, screenSize) ? Colors.green : Colors.red, 131 | gridSizes: { 132 | ScreenSize.ul: 12 133 | }, 134 | children: [ 135 | Text('Is Ultra Large Screen:\n('+ResponsiveScreen.limits[ScreenSize.ul].toString()+'px)', style: JSXTypography.h4), 136 | Text( ResponsiveScreen.isScreenSize(ScreenSize.ul, screenSize) ? 'true' : 'false') 137 | ] 138 | ), 139 | 140 | ] 141 | ), 142 | 143 | ResponsiveRow( 144 | margin: EdgeInsets.only(top: 20, bottom: 5), 145 | children: [ 146 | Text('Grid Test', style: JSXTypography.h2) 147 | ] 148 | ), 149 | ResponsiveRow( 150 | margin: EdgeInsets.only(bottom: 20), 151 | children: [ 152 | Text('Open this page on different devices and different orientations.') 153 | ] 154 | ), 155 | 156 | ResponsiveRow( 157 | margin: EdgeInsets.only(bottom: 10), 158 | children: [ 159 | 160 | ResponsiveCol( 161 | padding: EdgeInsets.all(10), 162 | backgroundColor: Colors.orange, 163 | gridSizes: { ScreenSize.xs : 4 }, 164 | children: [ 165 | Text('XS-4', style: JSXTypography.h4), 166 | Text('\n\n') 167 | ]..addAll(_aLotOfText) 168 | ), 169 | ResponsiveCol( 170 | padding: EdgeInsets.all(10), 171 | backgroundColor: Colors.green, 172 | gridSizes: { ScreenSize.xs : 4 }, 173 | children: [ 174 | Text('XS-4', style: JSXTypography.h4), 175 | Text('\n\n') 176 | ]..addAll(_aLotOfText) 177 | ), 178 | ResponsiveCol( 179 | padding: EdgeInsets.all(10), 180 | backgroundColor: Colors.blue, 181 | gridSizes: { ScreenSize.xs : 4 }, 182 | children: [ 183 | Text('XS-4', style: JSXTypography.h4), 184 | Text('\n\n') 185 | ]..addAll(_aLotOfText) 186 | ), 187 | 188 | 189 | ResponsiveCol( 190 | padding: EdgeInsets.all(10), 191 | backgroundColor: Colors.orange, 192 | gridSizes: { ScreenSize.sm : 4 }, 193 | children: [ 194 | Text('SM-4', style: JSXTypography.h4), 195 | Text('\n\n') 196 | ]..addAll(_aLotOfText) 197 | ), 198 | ResponsiveCol( 199 | padding: EdgeInsets.all(10), 200 | backgroundColor: Colors.green, 201 | gridSizes: { ScreenSize.sm : 4 }, 202 | children: [ 203 | Text('SM-4', style: JSXTypography.h4), 204 | Text('\n\n') 205 | ]..addAll(_aLotOfText) 206 | ), 207 | ResponsiveCol( 208 | padding: EdgeInsets.all(10), 209 | backgroundColor: Colors.blue, 210 | gridSizes: { ScreenSize.sm : 4 }, 211 | children: [ 212 | Text('SM-4', style: JSXTypography.h4), 213 | Text('\n\n') 214 | ]..addAll(_aLotOfText) 215 | ), 216 | 217 | 218 | ResponsiveCol( 219 | padding: EdgeInsets.all(10), 220 | backgroundColor: Colors.orange, 221 | gridSizes: { ScreenSize.md : 4 }, 222 | children: [ 223 | Text('MD-4', style: JSXTypography.h4), 224 | Text('\n\n') 225 | ]..addAll(_aLotOfText) 226 | ), 227 | ResponsiveCol( 228 | padding: EdgeInsets.all(10), 229 | backgroundColor: Colors.green, 230 | gridSizes: { ScreenSize.md : 4 }, 231 | children: [ 232 | Text('MD-4', style: JSXTypography.h4), 233 | Text('\n\n') 234 | ]..addAll(_aLotOfText) 235 | ), 236 | ResponsiveCol( 237 | padding: EdgeInsets.all(10), 238 | backgroundColor: Colors.blue, 239 | gridSizes: { ScreenSize.md : 4 }, 240 | children: [ 241 | Text('MD-4', style: JSXTypography.h4), 242 | Text('\n\n') 243 | ]..addAll(_aLotOfText) 244 | ), 245 | 246 | 247 | ResponsiveCol( 248 | padding: EdgeInsets.all(10), 249 | backgroundColor: Colors.orange, 250 | gridSizes: { ScreenSize.lg : 4 }, 251 | children: [ 252 | Text('LG-4', style: JSXTypography.h4), 253 | Text('\n\n') 254 | ]..addAll(_aLotOfText) 255 | ), 256 | ResponsiveCol( 257 | padding: EdgeInsets.all(10), 258 | backgroundColor: Colors.green, 259 | gridSizes: { ScreenSize.lg : 4 }, 260 | children: [ 261 | Text('LG-4', style: JSXTypography.h4), 262 | Text('\n\n') 263 | ]..addAll(_aLotOfText) 264 | ), 265 | ResponsiveCol( 266 | padding: EdgeInsets.all(10), 267 | backgroundColor: Colors.blue, 268 | gridSizes: { ScreenSize.lg : 4 }, 269 | children: [ 270 | Text('LG-4', style: JSXTypography.h4), 271 | Text('\n\n') 272 | ]..addAll(_aLotOfText) 273 | ), 274 | 275 | 276 | ResponsiveCol( 277 | padding: EdgeInsets.all(10), 278 | backgroundColor: Colors.orange, 279 | gridSizes: { ScreenSize.xl : 4 }, 280 | children: [ 281 | Text('XL-4', style: JSXTypography.h4), 282 | Text('\n\n') 283 | ]..addAll(_aLotOfText) 284 | ), 285 | ResponsiveCol( 286 | padding: EdgeInsets.all(10), 287 | backgroundColor: Colors.green, 288 | gridSizes: { ScreenSize.xl : 4 }, 289 | children: [ 290 | Text('XL-4', style: JSXTypography.h4), 291 | Text('\n\n') 292 | ]..addAll(_aLotOfText) 293 | ), 294 | ResponsiveCol( 295 | padding: EdgeInsets.all(10), 296 | backgroundColor: Colors.blue, 297 | gridSizes: { ScreenSize.xl : 4 }, 298 | children: [ 299 | Text('XL-4', style: JSXTypography.h4), 300 | Text('\n\n') 301 | ]..addAll(_aLotOfText) 302 | ), 303 | 304 | 305 | ResponsiveRow( 306 | margin: EdgeInsets.only(top: 20, bottom: 5), 307 | children: [ 308 | Text('Grid Offset Test', style: JSXTypography.h2) 309 | ] 310 | ), 311 | ResponsiveRow( 312 | margin: EdgeInsets.only(bottom: 20), 313 | children: [ 314 | Text('Offset Elements') 315 | ] 316 | ), 317 | 318 | ResponsiveCol( 319 | padding: EdgeInsets.all(10), 320 | backgroundColor: Colors.green, 321 | gridSizes: { ScreenSize.xs : 4 }, 322 | gridOffsetSizes: { ScreenSize.xs : 4 }, 323 | children: _aLotOfText 324 | ), 325 | ResponsiveCol( 326 | padding: EdgeInsets.all(10), 327 | backgroundColor: Colors.blue, 328 | gridSizes: { ScreenSize.xs : 4 }, 329 | children: _aLotOfText 330 | ), 331 | 332 | 333 | ResponsiveRow( 334 | margin: EdgeInsets.only(top: 20, bottom: 25), 335 | children: [ 336 | Text('Grid Multiple Screen Resizing', style: JSXTypography.h2) 337 | ] 338 | ), 339 | 340 | ResponsiveCol( 341 | padding: EdgeInsets.all(10), 342 | backgroundColor: Colors.green, 343 | gridSizes: { ScreenSize.xs : 12 }, 344 | children: _smallText 345 | ), 346 | 347 | ]..addAll( 348 | List.generate(12, (index) => index).map((colIndex) => 349 | ResponsiveCol( 350 | padding: EdgeInsets.all(10), 351 | backgroundColor: Colors.blue, 352 | gridSizes: { 353 | ScreenSize.xs : 4, 354 | ScreenSize.sm : 3, 355 | ScreenSize.lg : 2, 356 | ScreenSize.xl : 1, 357 | }, 358 | children: _smallText 359 | ) 360 | ).toList() 361 | ), 362 | ), 363 | ], 364 | ), 365 | ], 366 | ) 367 | ); 368 | } 369 | } 370 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 18 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 19 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXCopyFilesBuildPhase section */ 23 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 24 | isa = PBXCopyFilesBuildPhase; 25 | buildActionMask = 2147483647; 26 | dstPath = ""; 27 | dstSubfolderSpec = 10; 28 | files = ( 29 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 30 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 31 | ); 32 | name = "Embed Frameworks"; 33 | runOnlyForDeploymentPostprocessing = 0; 34 | }; 35 | /* End PBXCopyFilesBuildPhase section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 39 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 40 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 41 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 42 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 43 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 46 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 47 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 48 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 51 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 52 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | /* End PBXFileReference section */ 54 | 55 | /* Begin PBXFrameworksBuildPhase section */ 56 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 57 | isa = PBXFrameworksBuildPhase; 58 | buildActionMask = 2147483647; 59 | files = ( 60 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 61 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 9740EEB11CF90186004384FC /* Flutter */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 3B80C3931E831B6300D905FE /* App.framework */, 72 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 73 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 74 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 75 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 76 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 77 | ); 78 | name = Flutter; 79 | sourceTree = ""; 80 | }; 81 | 97C146E51CF9000F007C117D = { 82 | isa = PBXGroup; 83 | children = ( 84 | 9740EEB11CF90186004384FC /* Flutter */, 85 | 97C146F01CF9000F007C117D /* Runner */, 86 | 97C146EF1CF9000F007C117D /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | 97C146EF1CF9000F007C117D /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 97C146EE1CF9000F007C117D /* Runner.app */, 94 | ); 95 | name = Products; 96 | sourceTree = ""; 97 | }; 98 | 97C146F01CF9000F007C117D /* Runner */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 102 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 103 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 104 | 97C147021CF9000F007C117D /* Info.plist */, 105 | 97C146F11CF9000F007C117D /* Supporting Files */, 106 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 107 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 108 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 109 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 110 | ); 111 | path = Runner; 112 | sourceTree = ""; 113 | }; 114 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | ); 118 | name = "Supporting Files"; 119 | sourceTree = ""; 120 | }; 121 | /* End PBXGroup section */ 122 | 123 | /* Begin PBXNativeTarget section */ 124 | 97C146ED1CF9000F007C117D /* Runner */ = { 125 | isa = PBXNativeTarget; 126 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 127 | buildPhases = ( 128 | 9740EEB61CF901F6004384FC /* Run Script */, 129 | 97C146EA1CF9000F007C117D /* Sources */, 130 | 97C146EB1CF9000F007C117D /* Frameworks */, 131 | 97C146EC1CF9000F007C117D /* Resources */, 132 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 133 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 134 | ); 135 | buildRules = ( 136 | ); 137 | dependencies = ( 138 | ); 139 | name = Runner; 140 | productName = Runner; 141 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 142 | productType = "com.apple.product-type.application"; 143 | }; 144 | /* End PBXNativeTarget section */ 145 | 146 | /* Begin PBXProject section */ 147 | 97C146E61CF9000F007C117D /* Project object */ = { 148 | isa = PBXProject; 149 | attributes = { 150 | LastUpgradeCheck = 1020; 151 | ORGANIZATIONNAME = "The Chromium Authors"; 152 | TargetAttributes = { 153 | 97C146ED1CF9000F007C117D = { 154 | CreatedOnToolsVersion = 7.3.1; 155 | LastSwiftMigration = 1100; 156 | }; 157 | }; 158 | }; 159 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 160 | compatibilityVersion = "Xcode 3.2"; 161 | developmentRegion = en; 162 | hasScannedForEncodings = 0; 163 | knownRegions = ( 164 | en, 165 | Base, 166 | ); 167 | mainGroup = 97C146E51CF9000F007C117D; 168 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 169 | projectDirPath = ""; 170 | projectRoot = ""; 171 | targets = ( 172 | 97C146ED1CF9000F007C117D /* Runner */, 173 | ); 174 | }; 175 | /* End PBXProject section */ 176 | 177 | /* Begin PBXResourcesBuildPhase section */ 178 | 97C146EC1CF9000F007C117D /* Resources */ = { 179 | isa = PBXResourcesBuildPhase; 180 | buildActionMask = 2147483647; 181 | files = ( 182 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 183 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 184 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 185 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | /* End PBXResourcesBuildPhase section */ 190 | 191 | /* Begin PBXShellScriptBuildPhase section */ 192 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 193 | isa = PBXShellScriptBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | ); 197 | inputPaths = ( 198 | ); 199 | name = "Thin Binary"; 200 | outputPaths = ( 201 | ); 202 | runOnlyForDeploymentPostprocessing = 0; 203 | shellPath = /bin/sh; 204 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 205 | }; 206 | 9740EEB61CF901F6004384FC /* Run Script */ = { 207 | isa = PBXShellScriptBuildPhase; 208 | buildActionMask = 2147483647; 209 | files = ( 210 | ); 211 | inputPaths = ( 212 | ); 213 | name = "Run Script"; 214 | outputPaths = ( 215 | ); 216 | runOnlyForDeploymentPostprocessing = 0; 217 | shellPath = /bin/sh; 218 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 219 | }; 220 | /* End PBXShellScriptBuildPhase section */ 221 | 222 | /* Begin PBXSourcesBuildPhase section */ 223 | 97C146EA1CF9000F007C117D /* Sources */ = { 224 | isa = PBXSourcesBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 228 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | }; 232 | /* End PBXSourcesBuildPhase section */ 233 | 234 | /* Begin PBXVariantGroup section */ 235 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 236 | isa = PBXVariantGroup; 237 | children = ( 238 | 97C146FB1CF9000F007C117D /* Base */, 239 | ); 240 | name = Main.storyboard; 241 | sourceTree = ""; 242 | }; 243 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 244 | isa = PBXVariantGroup; 245 | children = ( 246 | 97C147001CF9000F007C117D /* Base */, 247 | ); 248 | name = LaunchScreen.storyboard; 249 | sourceTree = ""; 250 | }; 251 | /* End PBXVariantGroup section */ 252 | 253 | /* Begin XCBuildConfiguration section */ 254 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 255 | isa = XCBuildConfiguration; 256 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 257 | buildSettings = { 258 | ALWAYS_SEARCH_USER_PATHS = NO; 259 | CLANG_ANALYZER_NONNULL = YES; 260 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 261 | CLANG_CXX_LIBRARY = "libc++"; 262 | CLANG_ENABLE_MODULES = YES; 263 | CLANG_ENABLE_OBJC_ARC = YES; 264 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 265 | CLANG_WARN_BOOL_CONVERSION = YES; 266 | CLANG_WARN_COMMA = YES; 267 | CLANG_WARN_CONSTANT_CONVERSION = YES; 268 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 269 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 270 | CLANG_WARN_EMPTY_BODY = YES; 271 | CLANG_WARN_ENUM_CONVERSION = YES; 272 | CLANG_WARN_INFINITE_RECURSION = YES; 273 | CLANG_WARN_INT_CONVERSION = YES; 274 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 275 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 276 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 277 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 278 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 279 | CLANG_WARN_STRICT_PROTOTYPES = YES; 280 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 281 | CLANG_WARN_UNREACHABLE_CODE = YES; 282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 283 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 284 | COPY_PHASE_STRIP = NO; 285 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 286 | ENABLE_NS_ASSERTIONS = NO; 287 | ENABLE_STRICT_OBJC_MSGSEND = YES; 288 | GCC_C_LANGUAGE_STANDARD = gnu99; 289 | GCC_NO_COMMON_BLOCKS = YES; 290 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 292 | GCC_WARN_UNDECLARED_SELECTOR = YES; 293 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 294 | GCC_WARN_UNUSED_FUNCTION = YES; 295 | GCC_WARN_UNUSED_VARIABLE = YES; 296 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 297 | MTL_ENABLE_DEBUG_INFO = NO; 298 | SDKROOT = iphoneos; 299 | SUPPORTED_PLATFORMS = iphoneos; 300 | TARGETED_DEVICE_FAMILY = "1,2"; 301 | VALIDATE_PRODUCT = YES; 302 | }; 303 | name = Profile; 304 | }; 305 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 306 | isa = XCBuildConfiguration; 307 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 308 | buildSettings = { 309 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 310 | CLANG_ENABLE_MODULES = YES; 311 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 312 | ENABLE_BITCODE = NO; 313 | FRAMEWORK_SEARCH_PATHS = ( 314 | "$(inherited)", 315 | "$(PROJECT_DIR)/Flutter", 316 | ); 317 | INFOPLIST_FILE = Runner/Info.plist; 318 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 319 | LIBRARY_SEARCH_PATHS = ( 320 | "$(inherited)", 321 | "$(PROJECT_DIR)/Flutter", 322 | ); 323 | PRODUCT_BUNDLE_IDENTIFIER = me.carda.flutterResponsiveExample; 324 | PRODUCT_NAME = "$(TARGET_NAME)"; 325 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 326 | SWIFT_VERSION = 5.0; 327 | VERSIONING_SYSTEM = "apple-generic"; 328 | }; 329 | name = Profile; 330 | }; 331 | 97C147031CF9000F007C117D /* Debug */ = { 332 | isa = XCBuildConfiguration; 333 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 334 | buildSettings = { 335 | ALWAYS_SEARCH_USER_PATHS = NO; 336 | CLANG_ANALYZER_NONNULL = YES; 337 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 338 | CLANG_CXX_LIBRARY = "libc++"; 339 | CLANG_ENABLE_MODULES = YES; 340 | CLANG_ENABLE_OBJC_ARC = YES; 341 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 342 | CLANG_WARN_BOOL_CONVERSION = YES; 343 | CLANG_WARN_COMMA = YES; 344 | CLANG_WARN_CONSTANT_CONVERSION = YES; 345 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 353 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 355 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 356 | CLANG_WARN_STRICT_PROTOTYPES = YES; 357 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 358 | CLANG_WARN_UNREACHABLE_CODE = YES; 359 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 360 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 361 | COPY_PHASE_STRIP = NO; 362 | DEBUG_INFORMATION_FORMAT = dwarf; 363 | ENABLE_STRICT_OBJC_MSGSEND = YES; 364 | ENABLE_TESTABILITY = YES; 365 | GCC_C_LANGUAGE_STANDARD = gnu99; 366 | GCC_DYNAMIC_NO_PIC = NO; 367 | GCC_NO_COMMON_BLOCKS = YES; 368 | GCC_OPTIMIZATION_LEVEL = 0; 369 | GCC_PREPROCESSOR_DEFINITIONS = ( 370 | "DEBUG=1", 371 | "$(inherited)", 372 | ); 373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 375 | GCC_WARN_UNDECLARED_SELECTOR = YES; 376 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 377 | GCC_WARN_UNUSED_FUNCTION = YES; 378 | GCC_WARN_UNUSED_VARIABLE = YES; 379 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 380 | MTL_ENABLE_DEBUG_INFO = YES; 381 | ONLY_ACTIVE_ARCH = YES; 382 | SDKROOT = iphoneos; 383 | TARGETED_DEVICE_FAMILY = "1,2"; 384 | }; 385 | name = Debug; 386 | }; 387 | 97C147041CF9000F007C117D /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 390 | buildSettings = { 391 | ALWAYS_SEARCH_USER_PATHS = NO; 392 | CLANG_ANALYZER_NONNULL = YES; 393 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 394 | CLANG_CXX_LIBRARY = "libc++"; 395 | CLANG_ENABLE_MODULES = YES; 396 | CLANG_ENABLE_OBJC_ARC = YES; 397 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 398 | CLANG_WARN_BOOL_CONVERSION = YES; 399 | CLANG_WARN_COMMA = YES; 400 | CLANG_WARN_CONSTANT_CONVERSION = YES; 401 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 402 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 403 | CLANG_WARN_EMPTY_BODY = YES; 404 | CLANG_WARN_ENUM_CONVERSION = YES; 405 | CLANG_WARN_INFINITE_RECURSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 408 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 409 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 410 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 411 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 412 | CLANG_WARN_STRICT_PROTOTYPES = YES; 413 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 414 | CLANG_WARN_UNREACHABLE_CODE = YES; 415 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 416 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 417 | COPY_PHASE_STRIP = NO; 418 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 419 | ENABLE_NS_ASSERTIONS = NO; 420 | ENABLE_STRICT_OBJC_MSGSEND = YES; 421 | GCC_C_LANGUAGE_STANDARD = gnu99; 422 | GCC_NO_COMMON_BLOCKS = YES; 423 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 424 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 425 | GCC_WARN_UNDECLARED_SELECTOR = YES; 426 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 427 | GCC_WARN_UNUSED_FUNCTION = YES; 428 | GCC_WARN_UNUSED_VARIABLE = YES; 429 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 430 | MTL_ENABLE_DEBUG_INFO = NO; 431 | SDKROOT = iphoneos; 432 | SUPPORTED_PLATFORMS = iphoneos; 433 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 434 | TARGETED_DEVICE_FAMILY = "1,2"; 435 | VALIDATE_PRODUCT = YES; 436 | }; 437 | name = Release; 438 | }; 439 | 97C147061CF9000F007C117D /* Debug */ = { 440 | isa = XCBuildConfiguration; 441 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 442 | buildSettings = { 443 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 444 | CLANG_ENABLE_MODULES = YES; 445 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 446 | ENABLE_BITCODE = NO; 447 | FRAMEWORK_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | INFOPLIST_FILE = Runner/Info.plist; 452 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 453 | LIBRARY_SEARCH_PATHS = ( 454 | "$(inherited)", 455 | "$(PROJECT_DIR)/Flutter", 456 | ); 457 | PRODUCT_BUNDLE_IDENTIFIER = me.carda.flutterResponsiveExample; 458 | PRODUCT_NAME = "$(TARGET_NAME)"; 459 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 460 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 461 | SWIFT_VERSION = 5.0; 462 | VERSIONING_SYSTEM = "apple-generic"; 463 | }; 464 | name = Debug; 465 | }; 466 | 97C147071CF9000F007C117D /* Release */ = { 467 | isa = XCBuildConfiguration; 468 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 469 | buildSettings = { 470 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 471 | CLANG_ENABLE_MODULES = YES; 472 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 473 | ENABLE_BITCODE = NO; 474 | FRAMEWORK_SEARCH_PATHS = ( 475 | "$(inherited)", 476 | "$(PROJECT_DIR)/Flutter", 477 | ); 478 | INFOPLIST_FILE = Runner/Info.plist; 479 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 480 | LIBRARY_SEARCH_PATHS = ( 481 | "$(inherited)", 482 | "$(PROJECT_DIR)/Flutter", 483 | ); 484 | PRODUCT_BUNDLE_IDENTIFIER = me.carda.flutterResponsiveExample; 485 | PRODUCT_NAME = "$(TARGET_NAME)"; 486 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 487 | SWIFT_VERSION = 5.0; 488 | VERSIONING_SYSTEM = "apple-generic"; 489 | }; 490 | name = Release; 491 | }; 492 | /* End XCBuildConfiguration section */ 493 | 494 | /* Begin XCConfigurationList section */ 495 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | 97C147031CF9000F007C117D /* Debug */, 499 | 97C147041CF9000F007C117D /* Release */, 500 | 249021D3217E4FDB00AE95B9 /* Profile */, 501 | ); 502 | defaultConfigurationIsVisible = 0; 503 | defaultConfigurationName = Release; 504 | }; 505 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 506 | isa = XCConfigurationList; 507 | buildConfigurations = ( 508 | 97C147061CF9000F007C117D /* Debug */, 509 | 97C147071CF9000F007C117D /* Release */, 510 | 249021D4217E4FDB00AE95B9 /* Profile */, 511 | ); 512 | defaultConfigurationIsVisible = 0; 513 | defaultConfigurationName = Release; 514 | }; 515 | /* End XCConfigurationList section */ 516 | }; 517 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 518 | } 519 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------