├── .DS_Store ├── .dart_tool ├── dartpad │ └── web_plugin_registrant.dart ├── package_config.json ├── package_config_subset └── version ├── README.md ├── analysis_options.yaml ├── android ├── .gitignore ├── app │ ├── build.gradle │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── kotlin │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── the_widgets │ │ │ │ └── MainActivity.kt │ │ └── res │ │ │ ├── drawable-v21 │ │ │ └── launch_background.xml │ │ │ ├── drawable │ │ │ └── launch_background.xml │ │ │ ├── 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-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ └── styles.xml │ │ └── profile │ │ └── AndroidManifest.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── the_widgets_android.iml ├── ios ├── .gitignore ├── Flutter │ ├── AppFrameworkInfo.plist │ ├── Debug.xcconfig │ └── Release.xcconfig ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-1024x1024@1x.png │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ └── Icon-App-83.5x83.5@2x.png │ └── LaunchImage.imageset │ │ ├── Contents.json │ │ ├── LaunchImage.png │ │ ├── LaunchImage@2x.png │ │ ├── LaunchImage@3x.png │ │ └── README.md │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── Runner-Bridging-Header.h ├── lib ├── .DS_Store ├── every_widgets │ ├── about_dialog.dart │ ├── about_list_tile.dart │ ├── absorb_pointer.dart │ ├── alert_dialog.dart │ ├── align.dart │ ├── animated_align.dart │ ├── animated_builder.dart │ ├── animated_container.dart │ ├── animated_cross_fade.dart │ ├── animated_default_text_style.dart │ ├── animated_icon.dart │ ├── animated_list.dart │ ├── animated_modal_barrier.dart │ ├── animated_opacity.dart │ ├── animated_padding.dart │ ├── animated_physical_model.dart │ ├── animated_positioned.dart │ ├── animated_rotation.dart │ ├── animated_size.dart │ ├── animated_switcher.dart │ ├── animated_widget.dart │ ├── app_bar.dart │ ├── aspect_ratio.dart │ ├── autocomplete.dart │ ├── backdrop_filter.dart │ ├── badge.dart │ ├── banner.dart │ ├── baseline.dart │ ├── block_semantics.dart │ ├── bottom_navigation_bar.dart │ ├── bottom_sheet.dart │ ├── builder.dart │ ├── card.dart │ ├── center.dart │ ├── checkbox.dart │ ├── checkbox_list_tile.dart │ ├── chip.dart │ ├── choice_chip.dart │ ├── circle_avatar.dart │ ├── circular_progress_indicator.dart │ ├── clip_oval.dart │ ├── clip_path.dart │ ├── clip_r_rect.dart │ ├── clip_rect.dart │ ├── close_button.dart │ ├── color_filtered.dart │ ├── colored_box.dart │ ├── column.dart │ ├── constrained_box.dart │ ├── container.dart │ ├── cupertino_action_sheet_action.dart │ ├── cupertino_activity_indicator.dart │ ├── cupertino_alert_dialog.dart │ ├── cupertino_app.dart │ ├── cupertino_button.dart │ ├── cupertino_context_menu.dart │ ├── cupertino_date_picker.dart │ ├── cupertino_page_route.dart │ ├── cupertino_page_scaffold.dart │ ├── cupertino_picker.dart │ ├── cupertino_popup_surface.dart │ ├── cupertino_scrollbar.dart │ ├── cupertino_search_text_field.dart │ ├── cupertino_segmented_control.dart │ ├── cupertino_slider.dart │ ├── cupertino_sliding_segmented_control.dart │ ├── cupertino_switch.dart │ ├── cupertino_tab_bar.dart │ ├── cupertino_tab_scaffold.dart │ ├── cupertino_tab_view.dart │ ├── cupertino_text_field.dart │ ├── custom_paint.dart │ ├── custom_scroll_view.dart │ ├── data_table.dart │ ├── date_picker.dart │ ├── date_range_picker.dart │ ├── decorated_box.dart │ ├── decorated_box_transition.dart │ ├── default_text_style.dart │ ├── dismissible.dart │ ├── divider.dart │ ├── drag_target.dart │ ├── draggable.dart │ ├── draggable_scrollable_sheet.dart │ ├── drawer.dart │ ├── drawer_header.dart │ ├── dropdown_button.dart │ ├── elevated_button.dart │ ├── error_widget.dart │ ├── expand_icon.dart │ ├── expanded.dart │ ├── expansion_panel_list.dart │ ├── expansion_tile.dart │ ├── fade_in_image.dart │ ├── fade_transition.dart │ ├── filled_button.dart │ ├── filter_chip.dart │ ├── fitted_box.dart │ ├── flexible.dart │ ├── floating_action_button.dart │ ├── flow.dart │ ├── flutter_error_details.dart │ ├── flutter_logo.dart │ ├── form.dart │ ├── fractional_translation.dart │ ├── fractionnally_sized_box.dart │ ├── future_builder.dart │ ├── gesture_detector.dart │ ├── grid_paper.dart │ ├── grid_tile.dart │ ├── grid_tile_bar.dart │ ├── grid_view.dart │ ├── hero.dart │ ├── icon.dart │ ├── icon_button.dart │ ├── ignore_pointer.dart │ ├── image.dart │ ├── image_network.dart │ ├── indexed_stack.dart │ ├── ink_well.dart │ ├── input_chip.dart │ ├── interactive_viewer.dart │ ├── layout_builder.dart │ ├── limited_box.dart │ ├── linear_progress_indicator.dart │ ├── list_body.dart │ ├── list_tile.dart │ ├── list_view.dart │ ├── list_wheel_scroll_view.dart │ ├── listener.dart │ ├── long_press_draggable.dart │ ├── material_app.dart │ ├── material_banner.dart │ ├── material_button.dart │ ├── merge_semantics.dart │ ├── modal_barrier.dart │ ├── mouse_cursor.dart │ ├── mouse_region.dart │ ├── navigation_bar.dart │ ├── navigation_drawer.dart │ ├── navigation_drawer_destination.dart │ ├── notification_listener.dart │ ├── offstage.dart │ ├── opacity.dart │ ├── orientation_builder.dart │ ├── outlined_button.dart │ ├── overflow_bar.dart │ ├── overflow_box.dart │ ├── padding.dart │ ├── page_view.dart │ ├── physical_model.dart │ ├── physical_shape.dart │ ├── placeholder.dart │ ├── platform_menu.dart │ ├── popup_menu_button.dart │ ├── positioned.dart │ ├── positioned_transition.dart │ ├── preferred_size.dart │ ├── radio.dart │ ├── radio_list_tile.dart │ ├── range_slider.dart │ ├── raw_autocomplete.dart │ ├── raw_chip.dart │ ├── refresh_indicator.dart │ ├── reorderable_list_view.dart │ ├── rich_text.dart │ ├── rotated_box.dart │ ├── rotation_transition.dart │ ├── row.dart │ ├── scaffold.dart │ ├── scale_transition.dart │ ├── scrollbar.dart │ ├── search_bar.dart │ ├── selectable_text.dart │ ├── semantics.dart │ ├── shader_mask.dart │ ├── shortcuts.dart │ ├── simple_dialog.dart │ ├── single_child_scroll_view.dart │ ├── size_transition.dart │ ├── sized_box.dart │ ├── sized_overflow_box.dart │ ├── slide_transition.dart │ ├── slider.dart │ ├── sliver_app_bar.dart │ ├── sliver_fixed_extent_list.dart │ ├── sliver_grid.dart │ ├── sliver_list.dart │ ├── sliver_opacity.dart │ ├── sliver_padding.dart │ ├── sliver_to_box_adapter.dart │ ├── snack_bar.dart │ ├── spacer.dart │ ├── stack.dart │ ├── stepper.dart │ ├── stream_builder.dart │ ├── switch.dart │ ├── switch_list_tile.dart │ ├── tab_bar.dart │ ├── tab_page_selector.dart │ ├── table.dart │ ├── text.dart │ ├── text_button.dart │ ├── text_field.dart │ ├── text_form_field.dart │ ├── text_span.dart │ ├── theme.dart │ ├── toggle_buttons.dart │ ├── tooltip.dart │ ├── transform.dart │ ├── tween_animation_builder.dart │ ├── value_listenable_builder.dart │ ├── vertical_divider.dart │ ├── visibility.dart │ ├── will_pop_scope.dart │ └── wrap.dart └── main.dart ├── linux ├── .gitignore ├── CMakeLists.txt ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake ├── main.cc ├── my_application.cc └── my_application.h ├── macos ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── app_icon_1024.png │ │ ├── app_icon_128.png │ │ ├── app_icon_16.png │ │ ├── app_icon_256.png │ │ ├── app_icon_32.png │ │ ├── app_icon_512.png │ │ └── app_icon_64.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Configs │ ├── AppInfo.xcconfig │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── Warnings.xcconfig │ ├── DebugProfile.entitlements │ ├── Info.plist │ ├── MainFlutterWindow.swift │ └── Release.entitlements ├── pubspec.lock ├── pubspec.yaml ├── test └── widget_test.dart ├── the_widgets.iml ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── index.html └── manifest.json └── windows ├── .gitignore ├── CMakeLists.txt ├── flutter ├── CMakeLists.txt ├── generated_plugin_registrant.cc ├── generated_plugin_registrant.h └── generated_plugins.cmake └── runner ├── CMakeLists.txt ├── Runner.rc ├── flutter_window.cpp ├── flutter_window.h ├── main.cpp ├── resource.h ├── resources └── app_icon.ico ├── runner.exe.manifest ├── utils.cpp ├── utils.h ├── win32_window.cpp └── win32_window.h /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/.DS_Store -------------------------------------------------------------------------------- /.dart_tool/dartpad/web_plugin_registrant.dart: -------------------------------------------------------------------------------- 1 | // Flutter web plugin registrant file. 2 | // 3 | // Generated file. Do not edit. 4 | // 5 | 6 | // ignore_for_file: type=lint 7 | 8 | void registerPlugins() {} 9 | -------------------------------------------------------------------------------- /.dart_tool/version: -------------------------------------------------------------------------------- 1 | 3.7.0 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Credit 2 | Flutter Team and the Widget catalog. 3 | 4 | ## Widgets 5 | Save this ressource in your browser: https://fluttermapp.com/widgets 6 | 7 | ## Every Flutter Widget explained 8 | Available on YouTube: https://www.youtube.com/watch?v=kj_tldMmu4w 9 | 10 | ## The best 70 widgets for this list 11 | Available on YouTube: https://www.youtube.com/watch?v=G1LGOH424lo 12 | 13 | ## Give it a start 14 | Thank you for the support! 15 | I like you! 16 | Best regards, 17 | Flutter Mapp -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/com/example/the_widgets/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.the_widgets 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.1.2' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /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-7.4-all.zip 7 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 9.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /lib/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/lib/.DS_Store -------------------------------------------------------------------------------- /lib/every_widgets/about_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //!AboutDialog 4 | 5 | class Widget001 extends StatefulWidget { 6 | const Widget001({ 7 | Key? key, 8 | }) : super(key: key); 9 | 10 | @override 11 | State createState() => _Widget001State(); 12 | } 13 | 14 | class _Widget001State extends State { 15 | @override 16 | Widget build(BuildContext context) { 17 | return Center( 18 | child: ElevatedButton( 19 | child: const Text('Show About Dialog'), 20 | onPressed: () { 21 | showDialog( 22 | context: context, 23 | builder: (context) => const AboutDialog( 24 | applicationIcon: FlutterLogo(), 25 | applicationLegalese: 'Legalese', 26 | applicationName: 'Flutter App', 27 | applicationVersion: 'version 1.0.0', 28 | children: [ 29 | Text('This is a text created by Flutter Mapp'), 30 | ], 31 | ), 32 | ); 33 | }, 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/every_widgets/about_list_tile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //! AboutListTile 4 | class Widget002 extends StatelessWidget { 5 | const Widget002({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return const Center( 10 | child: AboutListTile( 11 | icon: Icon(Icons.info), 12 | applicationIcon: FlutterLogo(), 13 | applicationLegalese: 'Legalese', 14 | applicationName: 'Flutter App', 15 | applicationVersion: 'version 1.0.0', 16 | aboutBoxChildren: [ 17 | Text('This is a text created by Flutter Mapp'), 18 | ], 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/every_widgets/absorb_pointer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //!AbsorbPointer 4 | 5 | class Widget003 extends StatelessWidget { 6 | const Widget003({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Stack( 12 | alignment: AlignmentDirectional.center, 13 | children: [ 14 | SizedBox( 15 | width: 200.0, 16 | height: 100.0, 17 | child: ElevatedButton( 18 | onPressed: () {}, 19 | child: null, 20 | ), 21 | ), 22 | SizedBox( 23 | width: 100.0, 24 | height: 200.0, 25 | child: AbsorbPointer( 26 | child: ElevatedButton( 27 | style: ElevatedButton.styleFrom( 28 | primary: Colors.blue.shade200, 29 | ), 30 | onPressed: () {}, 31 | child: null, 32 | ), 33 | ), 34 | ), 35 | ], 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/every_widgets/alert_dialog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //! AlertDialog 4 | 5 | class Widget004 extends StatefulWidget { 6 | const Widget004({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget004State(); 10 | } 11 | 12 | class _Widget004State extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return Center( 16 | child: ElevatedButton( 17 | child: const Text('Show Alert Dialog'), 18 | onPressed: () { 19 | showDialog( 20 | context: context, 21 | builder: (context) => AlertDialog( 22 | actions: [ 23 | TextButton( 24 | onPressed: () { 25 | Navigator.of(context).pop(); 26 | }, 27 | child: const Text('Close'), 28 | ), 29 | ], 30 | title: const Text('Flutter Mapp'), 31 | contentPadding: const EdgeInsets.all(20.0), 32 | content: const Text('This is the Alert Dialog'), 33 | ), 34 | ); 35 | }, 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/every_widgets/align.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //! Align 4 | 5 | class Widget005 extends StatelessWidget { 6 | const Widget005({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Container( 12 | height: 120.0, 13 | width: double.infinity, 14 | color: Colors.blueGrey, 15 | child: const Align( 16 | alignment: Alignment.bottomLeft, 17 | child: FlutterLogo( 18 | size: 60, 19 | ), 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/every_widgets/animated_align.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //! AnimatedAlign 4 | 5 | class Widget006 extends StatefulWidget { 6 | const Widget006({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget006State(); 10 | } 11 | 12 | class _Widget006State extends State { 13 | bool selected = false; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return GestureDetector( 18 | onTap: () { 19 | setState(() { 20 | selected = !selected; 21 | }); 22 | }, 23 | child: Center( 24 | child: Container( 25 | width: double.infinity, 26 | height: 250.0, 27 | color: Colors.blueGrey, 28 | child: AnimatedAlign( 29 | alignment: selected ? Alignment.topRight : Alignment.bottomLeft, 30 | duration: const Duration(seconds: 1), 31 | curve: Curves.fastOutSlowIn, 32 | child: const FlutterLogo(size: 50.0), 33 | ), 34 | ), 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/every_widgets/animated_builder.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' as math; 2 | 3 | //!AnimatedBuilder 4 | 5 | import 'package:flutter/material.dart'; 6 | 7 | class Widget007 extends StatefulWidget { 8 | const Widget007({Key? key}) : super(key: key); 9 | 10 | @override 11 | State createState() => _Widget007State(); 12 | } 13 | 14 | class _Widget007State extends State with TickerProviderStateMixin { 15 | late final AnimationController _controller = AnimationController( 16 | duration: const Duration(seconds: 10), 17 | vsync: this, 18 | )..repeat(); 19 | 20 | @override 21 | void dispose() { 22 | _controller.dispose(); 23 | super.dispose(); 24 | } 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | return Center( 29 | child: AnimatedBuilder( 30 | animation: _controller, 31 | child: const FlutterLogo( 32 | size: 100, 33 | ), 34 | builder: (BuildContext context, Widget? child) { 35 | return Transform.rotate( 36 | angle: _controller.value * 2.0 * math.pi, 37 | child: child, 38 | ); 39 | }, 40 | ), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/every_widgets/animated_container.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //!AnimatedContainer 4 | 5 | class Widget008 extends StatefulWidget { 6 | const Widget008({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget008State(); 10 | } 11 | 12 | class _Widget008State extends State { 13 | bool selected = false; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return GestureDetector( 18 | onTap: () { 19 | setState(() { 20 | selected = !selected; 21 | }); 22 | }, 23 | child: Center( 24 | child: AnimatedContainer( 25 | width: selected ? 200.0 : 100.0, 26 | height: selected ? 100.0 : 200.0, 27 | color: selected ? Colors.blueGrey : Colors.white, 28 | alignment: 29 | selected ? Alignment.center : AlignmentDirectional.topCenter, 30 | duration: const Duration(seconds: 2), 31 | curve: Curves.fastOutSlowIn, 32 | child: const FlutterLogo(size: 75), 33 | ), 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/every_widgets/animated_icon.dart: -------------------------------------------------------------------------------- 1 | //! Animated Icon 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget011 extends StatefulWidget { 6 | const Widget011({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget11State(); 10 | } 11 | 12 | class _Widget11State extends State with TickerProviderStateMixin { 13 | bool _isPlay = false; 14 | late AnimationController _controller; 15 | 16 | @override 17 | void initState() { 18 | _controller = AnimationController( 19 | duration: const Duration(seconds: 1), 20 | vsync: this, 21 | ); 22 | super.initState(); 23 | } 24 | 25 | @override 26 | void dispose() { 27 | _controller.dispose(); 28 | super.dispose(); 29 | } 30 | 31 | @override 32 | Widget build(BuildContext context) { 33 | return Center( 34 | child: GestureDetector( 35 | onTap: () { 36 | if (_isPlay == false) { 37 | _controller.forward(); 38 | _isPlay = true; 39 | } else { 40 | _controller.reverse(); 41 | _isPlay = false; 42 | } 43 | }, 44 | child: AnimatedIcon( 45 | icon: AnimatedIcons.play_pause, 46 | progress: _controller, 47 | size: 100, 48 | ), 49 | ), 50 | ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/every_widgets/animated_opacity.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //! AnimatedOpacity 4 | 5 | class Widget014 extends StatefulWidget { 6 | const Widget014({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => Widget014State(); 10 | } 11 | 12 | class Widget014State extends State { 13 | double opacityLevel = 1.0; 14 | @override 15 | Widget build(BuildContext context) { 16 | return Center( 17 | child: Column( 18 | mainAxisAlignment: MainAxisAlignment.center, 19 | crossAxisAlignment: CrossAxisAlignment.center, 20 | children: [ 21 | AnimatedOpacity( 22 | opacity: opacityLevel, 23 | duration: const Duration(seconds: 2), 24 | child: const FlutterLogo( 25 | size: 50, 26 | ), 27 | ), 28 | ElevatedButton( 29 | child: const Text('Fade Logo'), 30 | onPressed: () { 31 | setState( 32 | () => opacityLevel = opacityLevel == 0 ? 1.0 : 0.0, 33 | ); 34 | }, 35 | ), 36 | ], 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/every_widgets/animated_padding.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //!AnimatedPadding 4 | 5 | class Widget015 extends StatefulWidget { 6 | const Widget015({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget015State(); 10 | } 11 | 12 | class _Widget015State extends State { 13 | double padValue = 0.0; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Column( 18 | mainAxisAlignment: MainAxisAlignment.center, 19 | children: [ 20 | ElevatedButton( 21 | style: ElevatedButton.styleFrom( 22 | primary: Colors.orangeAccent, 23 | ), 24 | child: const Text('Change padding'), 25 | onPressed: () { 26 | setState(() { 27 | padValue = padValue == 0.0 ? 100.0 : 0.0; 28 | }); 29 | }, 30 | ), 31 | Text('Padding = $padValue'), 32 | AnimatedPadding( 33 | padding: EdgeInsets.all(padValue), 34 | duration: const Duration(seconds: 2), 35 | curve: Curves.easeInOut, 36 | child: Container( 37 | width: MediaQuery.of(context).size.width, 38 | height: MediaQuery.of(context).size.height / 4, 39 | color: Colors.orangeAccent, 40 | ), 41 | ), 42 | ], 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/every_widgets/animated_positioned.dart: -------------------------------------------------------------------------------- 1 | //!AnimatedPositioned 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget017 extends StatefulWidget { 6 | const Widget017({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget017State(); 10 | } 11 | 12 | class _Widget017State extends State { 13 | bool selected = false; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return SizedBox( 18 | width: 200, 19 | height: 350, 20 | child: Stack( 21 | children: [ 22 | AnimatedPositioned( 23 | width: selected ? 200.0 : 50.0, 24 | height: selected ? 50.0 : 200.0, 25 | top: selected ? 50.0 : 150.0, 26 | duration: const Duration(seconds: 2), 27 | curve: Curves.fastOutSlowIn, 28 | child: GestureDetector( 29 | onTap: () { 30 | setState(() { 31 | selected = !selected; 32 | }); 33 | }, 34 | child: Container( 35 | decoration: BoxDecoration( 36 | color: Colors.orangeAccent, 37 | borderRadius: BorderRadius.circular(25), 38 | ), 39 | ), 40 | ), 41 | ), 42 | ], 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/every_widgets/animated_rotation.dart: -------------------------------------------------------------------------------- 1 | //! AnimatedRotation 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget018 extends StatefulWidget { 6 | const Widget018({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => Widget018State(); 10 | } 11 | 12 | class Widget018State extends State { 13 | double turns = 0.0; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Center( 18 | child: Column( 19 | mainAxisAlignment: MainAxisAlignment.center, 20 | children: [ 21 | Padding( 22 | padding: const EdgeInsets.all(50), 23 | child: AnimatedRotation( 24 | turns: turns, 25 | duration: const Duration(seconds: 1), 26 | child: const FlutterLogo( 27 | size: 100, 28 | ), 29 | ), 30 | ), 31 | ElevatedButton( 32 | child: const Text('Rotate Logo'), 33 | style: ElevatedButton.styleFrom( 34 | primary: Colors.orangeAccent, 35 | ), 36 | onPressed: () { 37 | setState(() => turns += 1 / 4); 38 | }, 39 | ), 40 | ], 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/every_widgets/animated_size.dart: -------------------------------------------------------------------------------- 1 | //! AnimatedSize 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget019 extends StatefulWidget { 6 | const Widget019({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget019State(); 10 | } 11 | 12 | class _Widget019State extends State { 13 | double _size = 300; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return GestureDetector( 18 | onTap: () { 19 | setState(() { 20 | _size = _size == 300 ? 100 : 300; 21 | }); 22 | }, 23 | child: Container( 24 | color: Colors.white, 25 | child: AnimatedSize( 26 | curve: Curves.easeIn, 27 | duration: const Duration(seconds: 1), 28 | child: FlutterLogo(size: _size), 29 | ), 30 | ), 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/every_widgets/animated_switcher.dart: -------------------------------------------------------------------------------- 1 | //! AnimatedSwitcher 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget020 extends StatefulWidget { 6 | const Widget020({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget020State(); 10 | } 11 | 12 | class _Widget020State extends State { 13 | int _count = 0; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Center( 18 | child: Column( 19 | mainAxisAlignment: MainAxisAlignment.center, 20 | children: [ 21 | AnimatedSwitcher( 22 | duration: const Duration(milliseconds: 500), 23 | child: Text( 24 | '$_count', 25 | style: const TextStyle(fontSize: 40), 26 | key: ValueKey(_count), 27 | ), 28 | transitionBuilder: (Widget child, Animation animation) { 29 | return ScaleTransition(scale: animation, child: child); 30 | }, 31 | ), 32 | ElevatedButton( 33 | child: const Text('Add'), 34 | onPressed: () { 35 | setState(() { 36 | _count += 1; 37 | }); 38 | }, 39 | ), 40 | ], 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/every_widgets/app_bar.dart: -------------------------------------------------------------------------------- 1 | //! AppBar 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget021 extends StatelessWidget { 6 | const Widget021({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | appBar: AppBar( 12 | title: const Text('Flutter Mapp'), 13 | centerTitle: true, 14 | actions: [ 15 | IconButton( 16 | icon: const Icon(Icons.notifications), 17 | onPressed: () {}, 18 | ), 19 | ], 20 | backgroundColor: Colors.orangeAccent, 21 | leading: IconButton( 22 | onPressed: () {}, 23 | icon: IconButton( 24 | icon: const Icon(Icons.menu), 25 | onPressed: () {}, 26 | ), 27 | ), 28 | shape: const RoundedRectangleBorder( 29 | borderRadius: BorderRadius.only( 30 | bottomLeft: Radius.circular(25), 31 | bottomRight: Radius.circular(25), 32 | ), 33 | ), 34 | ), 35 | body: const Center( 36 | child: Text( 37 | 'Body', 38 | style: TextStyle(fontSize: 24), 39 | ), 40 | ), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/every_widgets/aspect_ratio.dart: -------------------------------------------------------------------------------- 1 | //! AspectRatio 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget022 extends StatelessWidget { 6 | const Widget022({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | color: Colors.orangeAccent, 12 | alignment: Alignment.center, 13 | width: double.infinity, 14 | height: 300, 15 | child: AspectRatio( 16 | aspectRatio: 16 / 9, 17 | child: Container( 18 | color: Colors.blueGrey, 19 | ), 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/every_widgets/autocomplete.dart: -------------------------------------------------------------------------------- 1 | //! Autocomplete 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget023 extends StatelessWidget { 6 | const Widget023({Key? key}) : super(key: key); 7 | 8 | static const List listItems = [ 9 | 'apple', 10 | 'banana', 11 | 'melon', 12 | ]; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Autocomplete( 17 | optionsBuilder: (TextEditingValue textEditingValue) { 18 | if (textEditingValue.text == '') { 19 | return const Iterable.empty(); 20 | } 21 | return listItems.where((String item) { 22 | return item.contains(textEditingValue.text.toLowerCase()); 23 | }); 24 | }, 25 | onSelected: (String item) { 26 | print('The $item was selected'); 27 | }, 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/every_widgets/backdrop_filter.dart: -------------------------------------------------------------------------------- 1 | //! BackdropFilter 2 | 3 | import 'dart:ui'; 4 | 5 | import 'package:flutter/material.dart'; 6 | 7 | class Widget024 extends StatelessWidget { 8 | const Widget024({Key? key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Stack( 13 | children: [ 14 | Text( 15 | '0' * 10000, 16 | style: const TextStyle( 17 | color: Colors.green, 18 | ), 19 | ), 20 | Center( 21 | child: ClipRect( 22 | child: BackdropFilter( 23 | filter: ImageFilter.blur( 24 | sigmaX: 4.0, 25 | sigmaY: 4.0, 26 | ), 27 | child: Container( 28 | alignment: Alignment.center, 29 | width: 250, 30 | height: 250, 31 | child: const Text('Blur'), 32 | ), 33 | ), 34 | ), 35 | ), 36 | ], 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/every_widgets/badge.dart: -------------------------------------------------------------------------------- 1 | //! Badge 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget024B extends StatelessWidget { 6 | const Widget024B({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const Badge( 11 | backgroundColor: Colors.red, 12 | alignment: AlignmentDirectional.topEnd, 13 | largeSize: 20, 14 | label: Text( 15 | '45', 16 | style: TextStyle( 17 | color: Colors.white, 18 | fontWeight: FontWeight.bold, 19 | ), 20 | ), 21 | child: Icon( 22 | Icons.notifications_active_rounded, 23 | size: 50, 24 | ), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/every_widgets/baseline.dart: -------------------------------------------------------------------------------- 1 | //! Baseline 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget026 extends StatelessWidget { 6 | const Widget026({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Container( 12 | width: 200, 13 | height: 200, 14 | color: Colors.orange, 15 | child: const Baseline( 16 | baseline: 50, 17 | baselineType: TextBaseline.alphabetic, 18 | child: FlutterLogo(size: 50), 19 | ), 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/every_widgets/bottom_navigation_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //! BottomNavigationBar 4 | 5 | class Widget028 extends StatefulWidget { 6 | const Widget028({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget028State(); 10 | } 11 | 12 | class _Widget028State extends State { 13 | int _currentIndex = 0; 14 | List body = const [ 15 | Icon(Icons.home), 16 | Icon(Icons.menu), 17 | Icon(Icons.person), 18 | ]; 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | body: Center( 24 | child: body[_currentIndex], 25 | ), 26 | bottomNavigationBar: BottomNavigationBar( 27 | currentIndex: _currentIndex, 28 | onTap: (int newIndex) { 29 | setState(() { 30 | _currentIndex = newIndex; 31 | }); 32 | }, 33 | items: const [ 34 | BottomNavigationBarItem( 35 | label: 'Home', 36 | icon: Icon(Icons.home), 37 | ), 38 | BottomNavigationBarItem( 39 | label: 'Menu', 40 | icon: Icon(Icons.menu), 41 | ), 42 | BottomNavigationBarItem( 43 | label: 'Profile', 44 | icon: Icon(Icons.person), 45 | ) 46 | ], 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/every_widgets/bottom_sheet.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | //! Center 4 | 5 | class Widget029 extends StatefulWidget { 6 | const Widget029({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget029State(); 10 | } 11 | 12 | class _Widget029State extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return Center( 16 | child: ElevatedButton( 17 | child: const Text('Modal Bottom Sheet'), 18 | onPressed: () { 19 | showModalBottomSheet( 20 | context: context, 21 | builder: (BuildContext context) { 22 | return SizedBox( 23 | height: 400, 24 | child: Center( 25 | child: ElevatedButton( 26 | child: const Text('Close'), 27 | onPressed: () { 28 | Navigator.pop(context); 29 | }, 30 | ), 31 | ), 32 | ); 33 | }, 34 | ); 35 | }, 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/every_widgets/builder.dart: -------------------------------------------------------------------------------- 1 | //! builder 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget030 extends StatelessWidget { 6 | const Widget030({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | body: myWidget(), 12 | ); 13 | } 14 | } 15 | 16 | myWidget() => Builder( 17 | builder: (BuildContext context) { 18 | return Text( 19 | 'Text with Theme', 20 | style: Theme.of(context).textTheme.displayLarge, 21 | ); 22 | }, 23 | ); 24 | -------------------------------------------------------------------------------- /lib/every_widgets/card.dart: -------------------------------------------------------------------------------- 1 | //! Card 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget031 extends StatelessWidget { 6 | const Widget031({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Card( 12 | elevation: 20, 13 | color: Colors.orangeAccent, 14 | child: Padding( 15 | padding: const EdgeInsets.all(15.0), 16 | child: Column( 17 | mainAxisSize: MainAxisSize.min, 18 | children: [ 19 | const SizedBox(height: 8), 20 | const Text('This is a Flutter card'), 21 | TextButton( 22 | child: const Text('Press'), 23 | onPressed: () {}, 24 | ), 25 | ], 26 | ), 27 | ), 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/every_widgets/center.dart: -------------------------------------------------------------------------------- 1 | //! Center 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget032 extends StatelessWidget { 6 | const Widget032({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Column( 11 | mainAxisAlignment: MainAxisAlignment.center, 12 | children: [ 13 | Container( 14 | color: Colors.orangeAccent, 15 | child: const Center( 16 | heightFactor: 5, 17 | child: Text('Flutter Mapp'), 18 | ), 19 | ), 20 | ], 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/every_widgets/checkbox.dart: -------------------------------------------------------------------------------- 1 | //! Checkbox 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget033 extends StatefulWidget { 5 | const Widget033({Key? key}) : super(key: key); 6 | 7 | @override 8 | State createState() => _Widget033State(); 9 | } 10 | 11 | class _Widget033State extends State { 12 | bool? isChecked = false; 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return Center( 17 | child: Checkbox( 18 | value: isChecked, 19 | activeColor: Colors.orangeAccent, 20 | tristate: true, 21 | onChanged: (newBool) { 22 | setState(() { 23 | isChecked = newBool; 24 | }); 25 | }, 26 | ), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/every_widgets/checkbox_list_tile.dart: -------------------------------------------------------------------------------- 1 | //!CheckboxListTile 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget034 extends StatefulWidget { 6 | const Widget034({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget034State(); 10 | } 11 | 12 | class _Widget034State extends State { 13 | bool? _isChecked = false; 14 | @override 15 | Widget build(BuildContext context) { 16 | return Center( 17 | child: CheckboxListTile( 18 | title: const Text('Checkbox List Tile'), 19 | value: _isChecked, 20 | onChanged: (bool? newValue) { 21 | setState(() { 22 | _isChecked = newValue; 23 | }); 24 | }, 25 | activeColor: Colors.orangeAccent, 26 | checkColor: Colors.white, 27 | tileColor: Colors.black12, 28 | subtitle: const Text('This is a subtitle'), 29 | controlAffinity: ListTileControlAffinity.leading, 30 | tristate: true, 31 | ), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/every_widgets/chip.dart: -------------------------------------------------------------------------------- 1 | //! Chip 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget035 extends StatelessWidget { 5 | const Widget035({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Center( 10 | child: Chip( 11 | label: const Text("This is a Flutter chip"), 12 | onDeleted: () { 13 | debugPrint("Do something"); 14 | }, 15 | ), 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/every_widgets/choice_chip.dart: -------------------------------------------------------------------------------- 1 | //! ChoiceChip 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget036 extends StatefulWidget { 5 | const Widget036({Key? key}) : super(key: key); 6 | 7 | @override 8 | State createState() => _Widget036State(); 9 | } 10 | 11 | class _Widget036State extends State { 12 | bool isSelected = false; 13 | @override 14 | Widget build(BuildContext context) { 15 | return Center( 16 | child: ChoiceChip( 17 | label: const Text("Choice Chip"), 18 | selected: isSelected, 19 | selectedColor: Colors.orangeAccent, 20 | onSelected: (newState) { 21 | setState(() { 22 | isSelected = newState; 23 | }); 24 | }, 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/every_widgets/circle_avatar.dart: -------------------------------------------------------------------------------- 1 | //! CircleAvatar 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget037 extends StatelessWidget { 5 | const Widget037({Key? key}) : super(key: key); 6 | @override 7 | Widget build(BuildContext context) { 8 | return const Center( 9 | child: CircleAvatar( 10 | backgroundColor: Colors.orangeAccent, 11 | radius: 55, 12 | backgroundImage: AssetImage('assets/icon/blue.jpg'), 13 | child: Text('Hi'), 14 | ), 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/every_widgets/circular_progress_indicator.dart: -------------------------------------------------------------------------------- 1 | //! CircularProgressIndicator 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget038 extends StatelessWidget { 5 | const Widget038({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return const Center( 10 | child: CircularProgressIndicator( 11 | color: Colors.orangeAccent, 12 | backgroundColor: Colors.blueGrey, 13 | value: 0.50, 14 | ), 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/every_widgets/clip_oval.dart: -------------------------------------------------------------------------------- 1 | //! ClipOval 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget039 extends StatelessWidget { 5 | const Widget039({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Center( 10 | child: ClipOval( 11 | clipper: CustomClip(), 12 | child: Container( 13 | width: 80, 14 | height: 80, 15 | color: Colors.orangeAccent, 16 | ), 17 | ), 18 | ); 19 | } 20 | } 21 | 22 | class CustomClip extends CustomClipper { 23 | @override 24 | Rect getClip(Size size) { 25 | return Rect.fromLTWH(0, 0, size.width - 15, size.height); 26 | } 27 | 28 | @override 29 | bool shouldReclip(covariant CustomClipper oldClipper) { 30 | return false; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/every_widgets/clip_path.dart: -------------------------------------------------------------------------------- 1 | //! ClipPath 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget040 extends StatelessWidget { 5 | const Widget040({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return ClipPath( 10 | clipper: MyClipper(), 11 | child: Container( 12 | width: double.infinity, 13 | height: 300, 14 | color: const Color(0xFF142B46), 15 | ), 16 | ); 17 | } 18 | } 19 | 20 | class MyClipper extends CustomClipper { 21 | @override 22 | Path getClip(Size size) { 23 | return Path() 24 | ..lineTo(0, size.height) 25 | ..quadraticBezierTo( 26 | size.width / 4, 27 | size.height - 40, 28 | size.width / 2, 29 | size.height - 20, 30 | ) 31 | ..quadraticBezierTo( 32 | 3 / 4 * size.width, 33 | size.height, 34 | size.width, 35 | size.height - 30, 36 | ) 37 | ..lineTo(size.width, 0); 38 | } 39 | 40 | @override 41 | bool shouldReclip(covariant CustomClipper oldClipper) { 42 | return false; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/every_widgets/clip_r_rect.dart: -------------------------------------------------------------------------------- 1 | //! ClipRRect 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget042 extends StatefulWidget { 5 | const Widget042({Key? key}) : super(key: key); 6 | 7 | @override 8 | State createState() => _Widget042State(); 9 | } 10 | 11 | class _Widget042State extends State { 12 | @override 13 | Widget build(BuildContext context) { 14 | return Center( 15 | child: ClipRRect( 16 | borderRadius: BorderRadius.circular(30), 17 | child: Image.asset( 18 | 'assets/icon/ocean.jpg', 19 | width: 350, 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/every_widgets/clip_rect.dart: -------------------------------------------------------------------------------- 1 | //! ClipRect 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget041 extends StatelessWidget { 5 | const Widget041({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Center( 10 | child: ClipRect( 11 | clipper: MyClipper(), 12 | child: Container( 13 | width: 3000, 14 | height: 3000, 15 | color: Colors.orangeAccent, 16 | ), 17 | ), 18 | ); 19 | } 20 | } 21 | 22 | class MyClipper extends CustomClipper { 23 | @override 24 | Rect getClip(Size size) { 25 | return const Rect.fromLTWH(50, 0, 80, 80); 26 | } 27 | 28 | @override 29 | bool shouldReclip(covariant CustomClipper oldClipper) { 30 | return false; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/every_widgets/close_button.dart: -------------------------------------------------------------------------------- 1 | //! CloseButton 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget043 extends StatelessWidget { 5 | const Widget043({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Center( 10 | child: CloseButton( 11 | color: Colors.red, 12 | onPressed: () { 13 | debugPrint("Do something"); 14 | }, 15 | ), 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/every_widgets/color_filtered.dart: -------------------------------------------------------------------------------- 1 | //! ColorFiltered 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget045 extends StatelessWidget { 5 | const Widget045({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return ColorFiltered( 10 | colorFilter: const ColorFilter.mode( 11 | Colors.white, 12 | BlendMode.color, 13 | ), 14 | child: Image.asset('assets/icon/blue.jpg'), 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/every_widgets/colored_box.dart: -------------------------------------------------------------------------------- 1 | //! ColoredBox 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget044 extends StatelessWidget { 5 | const Widget044({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return const Center( 10 | child: ColoredBox( 11 | color: Colors.orangeAccent, 12 | child: SizedBox( 13 | width: 100, 14 | height: 100, 15 | ), 16 | ), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/every_widgets/column.dart: -------------------------------------------------------------------------------- 1 | //!Column 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget048 extends StatelessWidget { 6 | const Widget048({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Column( 11 | crossAxisAlignment: CrossAxisAlignment.end, 12 | mainAxisAlignment: MainAxisAlignment.end, 13 | mainAxisSize: MainAxisSize.min, 14 | children: const [ 15 | Text('Row 1'), 16 | Text('Row 2'), 17 | Text('Row 3'), 18 | Text('Row 4'), 19 | Text('Row 5'), 20 | Text('Flutter Mapp'), 21 | ], 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/every_widgets/constrained_box.dart: -------------------------------------------------------------------------------- 1 | //! ConstrainedBox 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget046 extends StatelessWidget { 5 | const Widget046({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Center( 10 | child: ConstrainedBox( 11 | constraints: const BoxConstraints( 12 | maxWidth: 900, 13 | maxHeight: 350, 14 | 15 | ), 16 | child: Container( 17 | color: Colors.orangeAccent, 18 | width: double.infinity, 19 | ), 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/every_widgets/container.dart: -------------------------------------------------------------------------------- 1 | //!Container 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget047 extends StatelessWidget { 6 | const Widget047({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | padding: const EdgeInsets.all(8.0), 12 | color: Colors.orangeAccent, 13 | alignment: Alignment.center, 14 | child: const Text('Flutter Mapp'), 15 | constraints: const BoxConstraints.expand(height: 200), 16 | transform: Matrix4.rotationZ(0.2), 17 | ); 18 | } 19 | } -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_activity_indicator.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoActivityIndicator 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class Widget052 extends StatefulWidget { 7 | const Widget052({Key? key}) : super(key: key); 8 | 9 | @override 10 | State createState() => _Widget052State(); 11 | } 12 | 13 | class _Widget052State extends State { 14 | @override 15 | Widget build(BuildContext context) { 16 | return const CupertinoPageScaffold( 17 | child: Center( 18 | child: CupertinoActivityIndicator( 19 | radius: 50, 20 | color: Colors.orangeAccent, 21 | ), 22 | ), 23 | ); 24 | } 25 | } -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_app.dart: -------------------------------------------------------------------------------- 1 | //! CupertinoApp 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | 5 | class Widget050 extends StatelessWidget { 6 | const Widget050({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const CupertinoApp( 11 | debugShowCheckedModeBanner: false, 12 | theme: CupertinoThemeData( 13 | brightness: Brightness.dark, 14 | scaffoldBackgroundColor: Color.fromARGB(255, 18, 32, 47), 15 | primaryColor: CupertinoColors.systemOrange, 16 | ), 17 | home: CupertinoPageScaffold( 18 | navigationBar: CupertinoNavigationBar( 19 | middle: Text('Flutter Mapp'), 20 | ), 21 | child: Center( 22 | child: Icon(CupertinoIcons.share), 23 | ), 24 | ), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_button.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoButton 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | 5 | class Widget054 extends StatelessWidget { 6 | const Widget054({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Column( 12 | mainAxisSize: MainAxisSize.min, 13 | children: const [ 14 | CupertinoButton( 15 | onPressed: null, 16 | child: Text('Enabled'), 17 | ), 18 | SizedBox(height: 30), 19 | CupertinoButton.filled( 20 | onPressed: null, 21 | child: Text('Enabled'), 22 | ), 23 | ], 24 | ), 25 | ); 26 | } 27 | } -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_context_menu.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoContextMenu 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class Widget055 extends StatelessWidget { 7 | const Widget055({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Scaffold( 12 | body: Center( 13 | child: SizedBox( 14 | width: 100, 15 | height: 100, 16 | child: CupertinoContextMenu( 17 | child: Image.network( 18 | 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/09/YouTube_full-color_icon_%282017%29.svg/800px-YouTube_full-color_icon_%282017%29.svg.png', 19 | ), 20 | actions: [ 21 | CupertinoContextMenuAction( 22 | child: const Text('Action one'), 23 | onPressed: () { 24 | Navigator.pop(context); 25 | }, 26 | ), 27 | CupertinoContextMenuAction( 28 | child: const Text('Action two'), 29 | onPressed: () { 30 | Navigator.pop(context); 31 | }, 32 | ), 33 | ], 34 | ), 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_date_picker.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoDatePicker 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | import 'package:flutter/material.dart'; 5 | 6 | class Widget056 extends StatefulWidget { 7 | const Widget056({Key? key}) : super(key: key); 8 | 9 | @override 10 | State createState() => _Widget056State(); 11 | } 12 | 13 | class _Widget056State extends State { 14 | Duration duration = const Duration(seconds: 1); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return CupertinoPageScaffold( 19 | child: Center( 20 | child: CupertinoButton( 21 | child: Text( 22 | '${duration.inHours}-${duration.inMinutes}-${duration.inSeconds}'), 23 | onPressed: () { 24 | showCupertinoModalPopup( 25 | context: context, 26 | builder: (BuildContext context) => SizedBox( 27 | height: 250, 28 | child: CupertinoTimerPicker( 29 | backgroundColor: Colors.orangeAccent, 30 | onTimerDurationChanged: (Duration newTime) { 31 | setState(() => duration = newTime); 32 | }, 33 | ), 34 | ), 35 | ); 36 | }, 37 | ), 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_page_route.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | //!CupertinoPageRoute 5 | 6 | class Widget057 extends StatelessWidget { 7 | const Widget057({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return Center( 12 | child: CupertinoButton.filled( 13 | child: const Text('Click for page 2'), 14 | onPressed: () => Navigator.of(context).push( 15 | CupertinoPageRoute( 16 | builder: (BuildContext context) { 17 | return const PageTwo(); 18 | }, 19 | ), 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | 26 | class PageTwo extends StatelessWidget { 27 | const PageTwo({Key? key}) : super(key: key); 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return const Scaffold( 32 | backgroundColor: Colors.blueGrey, 33 | body: Center( 34 | child: Text('Page Two'), 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_page_scaffold.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoPageScaffold done in 59 also 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | 5 | class Widget058 extends StatelessWidget { 6 | const Widget058({Key? key}) : super(key: key); 7 | @override 8 | Widget build(BuildContext context) { 9 | return CupertinoPageScaffold( 10 | backgroundColor: const Color.fromARGB(255, 18, 32, 47), 11 | navigationBar: CupertinoNavigationBar( 12 | backgroundColor: CupertinoColors.systemGrey.withOpacity(0.6), 13 | middle: const Text('Flutter Mapp'), 14 | ), 15 | child: Stack( 16 | children: [ 17 | Image.network( 18 | 'https://i.pinimg.com/originals/c0/40/7f/c0407fadd8f5db63c3d8e35295fa7941.jpg', 19 | fit: BoxFit.cover, 20 | height: double.infinity, 21 | ), 22 | ], 23 | ), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_popup_surface.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoPopupSurface 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | 5 | class Widget060 extends StatelessWidget { 6 | const Widget060({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return CupertinoPageScaffold( 11 | child: Center( 12 | child: CupertinoButton( 13 | child: const Text("Click Me"), 14 | onPressed: () { 15 | showCupertinoModalPopup( 16 | context: context, 17 | builder: (BuildContext builder) { 18 | return CupertinoPopupSurface( 19 | child: Container( 20 | color: CupertinoColors.white, 21 | alignment: Alignment.center, 22 | width: double.infinity, 23 | height: 400, 24 | child: Center( 25 | child: CupertinoButton( 26 | child: const Text('Close'), 27 | onPressed: () { 28 | Navigator.of(context).pop(); 29 | }, 30 | ), 31 | ), 32 | ), 33 | ); 34 | }, 35 | ); 36 | }, 37 | ), 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_scrollbar.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoScrollbar 2 | import 'package:flutter/cupertino.dart'; 3 | 4 | class Widget061 extends StatelessWidget { 5 | const Widget061({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return CupertinoScrollbar( 10 | thickness: 6.0, 11 | thicknessWhileDragging: 10.0, 12 | radius: const Radius.circular(34.0), 13 | radiusWhileDragging: Radius.zero, 14 | child: ListView.builder( 15 | itemCount: 50, 16 | itemBuilder: (BuildContext context, int index) { 17 | return Center( 18 | child: Text( 19 | '$index', 20 | style: const TextStyle(fontSize: 30), 21 | ), 22 | ); 23 | }, 24 | ), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_search_text_field.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoSearchTextField 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | 5 | class Widget062 extends StatelessWidget { 6 | Widget062({Key? key}) : super(key: key); 7 | final TextEditingController _textController = 8 | TextEditingController(text: 'Flutter Mapp'); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Container( 13 | color: CupertinoColors.systemOrange, 14 | padding: const EdgeInsets.all(10.0), 15 | child: Center( 16 | child: CupertinoSearchTextField( 17 | controller: _textController, 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_slider.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoSlider 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | 5 | class Widget064 extends StatefulWidget { 6 | const Widget064({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget064State createState() => Widget064State(); 10 | } 11 | 12 | class Widget064State extends State { 13 | double _currentValue = 1; 14 | @override 15 | Widget build(BuildContext context) { 16 | return SizedBox( 17 | width: double.infinity, 18 | child: Column( 19 | children: [ 20 | const SizedBox(height: 50), 21 | Text(_currentValue.toString()), 22 | const SizedBox(height: 50), 23 | CupertinoSlider( 24 | value: _currentValue, 25 | min: 0, 26 | max: 10, 27 | divisions: 10, 28 | onChanged: (selectedValue) { 29 | setState(() { 30 | _currentValue = selectedValue; 31 | }); 32 | }, 33 | ), 34 | ], 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_sliding_segmented_control.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoSlidingSegmentedControl 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | 5 | class Widget065 extends StatefulWidget { 6 | const Widget065({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget065State(); 10 | } 11 | 12 | class _Widget065State extends State { 13 | int? _sliding = 0; 14 | @override 15 | Widget build(BuildContext context) { 16 | return Center( 17 | child: CupertinoSlidingSegmentedControl( 18 | children: const { 19 | 0: Text('Text 0'), 20 | 1: Text('Text 1'), 21 | 2: Text('Text 2'), 22 | }, 23 | groupValue: _sliding, 24 | onValueChanged: (int? newValue) { 25 | setState(() { 26 | _sliding = newValue; 27 | }); 28 | }, 29 | ), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_switch.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoSwitch 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget066 extends StatefulWidget { 6 | const Widget066({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget078State(); 10 | } 11 | 12 | class _Widget078State extends State { 13 | bool _lights = false; 14 | @override 15 | Widget build(BuildContext context) { 16 | return Center( 17 | child: Switch.adaptive( 18 | value: _lights, 19 | onChanged: (bool value) { 20 | setState(() { 21 | _lights = value; 22 | }); 23 | }, 24 | ), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_tab_bar.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoTabBar 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | 5 | class Widget069 extends StatefulWidget { 6 | const Widget069({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget069State(); 10 | } 11 | 12 | class _Widget069State extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return CupertinoTabScaffold( 16 | tabBar: CupertinoTabBar( 17 | items: const [ 18 | BottomNavigationBarItem( 19 | icon: Icon(CupertinoIcons.home), 20 | label: 'Home', 21 | ), 22 | BottomNavigationBarItem( 23 | icon: Icon(CupertinoIcons.settings), 24 | label: 'Settings', 25 | ), 26 | ], 27 | ), 28 | tabBuilder: (BuildContext context, int index) { 29 | return CupertinoTabView( 30 | builder: (BuildContext context) { 31 | return Center( 32 | child: Icon( 33 | index == 0 ? CupertinoIcons.home : CupertinoIcons.settings, 34 | ), 35 | ); 36 | }, 37 | ); 38 | }, 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_tab_scaffold.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoTabBar 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | 5 | class Widget069 extends StatefulWidget { 6 | const Widget069({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget069State(); 10 | } 11 | 12 | class _Widget069State extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return CupertinoTabScaffold( 16 | tabBar: CupertinoTabBar( 17 | items: const [ 18 | BottomNavigationBarItem( 19 | icon: Icon(CupertinoIcons.home), 20 | label: 'Home', 21 | ), 22 | BottomNavigationBarItem( 23 | icon: Icon(CupertinoIcons.settings), 24 | label: 'Settings', 25 | ), 26 | ], 27 | ), 28 | tabBuilder: (BuildContext context, int index) { 29 | return CupertinoTabView( 30 | builder: (BuildContext context) { 31 | return Center( 32 | child: Icon( 33 | index == 0 ? CupertinoIcons.home : CupertinoIcons.settings, 34 | ), 35 | ); 36 | }, 37 | ); 38 | }, 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_tab_view.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoTabBar 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | 5 | class Widget069 extends StatefulWidget { 6 | const Widget069({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget069State(); 10 | } 11 | 12 | class _Widget069State extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return CupertinoTabScaffold( 16 | tabBar: CupertinoTabBar( 17 | items: const [ 18 | BottomNavigationBarItem( 19 | icon: Icon(CupertinoIcons.home), 20 | label: 'Home', 21 | ), 22 | BottomNavigationBarItem( 23 | icon: Icon(CupertinoIcons.settings), 24 | label: 'Settings', 25 | ), 26 | ], 27 | ), 28 | tabBuilder: (BuildContext context, int index) { 29 | return CupertinoTabView( 30 | builder: (BuildContext context) { 31 | return Center( 32 | child: Icon( 33 | index == 0 ? CupertinoIcons.home : CupertinoIcons.settings, 34 | ), 35 | ); 36 | }, 37 | ); 38 | }, 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/every_widgets/cupertino_text_field.dart: -------------------------------------------------------------------------------- 1 | //!CupertinoTextField 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | 5 | class Widget070 extends StatelessWidget { 6 | Widget070({Key? key}) : super(key: key); 7 | final TextEditingController _textController = 8 | TextEditingController(text: 'Flutter Mapp'); 9 | @override 10 | Widget build(BuildContext context) { 11 | return CupertinoApp( 12 | debugShowCheckedModeBanner: false, 13 | home: CupertinoPageScaffold( 14 | backgroundColor: CupertinoColors.systemOrange, 15 | child: Padding( 16 | padding: const EdgeInsets.all(10.0), 17 | child: Center( 18 | child: CupertinoTextField( 19 | controller: _textController, 20 | ), 21 | ), 22 | ), 23 | ), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/every_widgets/custom_paint.dart: -------------------------------------------------------------------------------- 1 | //!CustomPaint 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget071 extends StatelessWidget { 5 | const Widget071({Key? key}) : super(key: key); 6 | @override 7 | Widget build(BuildContext context) { 8 | return Padding( 9 | padding: const EdgeInsets.all(20.0), 10 | child: Center( 11 | child: CustomPaint( 12 | painter: DemoPainter(), 13 | child: const Text( 14 | 'This is Pac-Man', 15 | style: TextStyle( 16 | color: Colors.black, 17 | backgroundColor: Colors.white54, 18 | fontSize: 30, 19 | ), 20 | ), 21 | ), 22 | ), 23 | ); 24 | } 25 | } 26 | 27 | class DemoPainter extends CustomPainter { 28 | @override 29 | void paint(Canvas canvas, Size size) { 30 | var center = size / 2; 31 | var paint = Paint()..color = Colors.yellow; 32 | canvas.drawArc( 33 | Rect.fromCenter( 34 | center: Offset(center.width, center.height), 35 | width: 250, 36 | height: 250, 37 | ), 38 | 0.4, 39 | 2 * 3.14 - 0.8, 40 | true, 41 | paint, 42 | ); 43 | } 44 | 45 | @override 46 | bool shouldRepaint(covariant CustomPainter oldDelegate) { 47 | return false; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/every_widgets/custom_scroll_view.dart: -------------------------------------------------------------------------------- 1 | //!CustomScrollView 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget072 extends StatelessWidget { 6 | const Widget072({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return CustomScrollView( 11 | slivers: [ 12 | SliverGrid( 13 | delegate: SliverChildBuilderDelegate( 14 | (BuildContext context, int index) { 15 | return Container( 16 | alignment: Alignment.center, 17 | color: Colors.orange[100 * (index % 9)], 18 | child: Text('Grid Item $index'), 19 | ); 20 | }, 21 | childCount: 50, 22 | ), 23 | gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent( 24 | maxCrossAxisExtent: 200.0, 25 | mainAxisSpacing: 10.0, 26 | crossAxisSpacing: 10.0, 27 | childAspectRatio: 4.0, 28 | ), 29 | ), 30 | ], 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/every_widgets/date_picker.dart: -------------------------------------------------------------------------------- 1 | //! Time Picker &&& Date picker(91) 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget078 extends StatefulWidget { 5 | const Widget078({Key? key}) : super(key: key); 6 | 7 | @override 8 | _Widget078State createState() { 9 | return _Widget078State(); 10 | } 11 | } 12 | 13 | class _Widget078State extends State { 14 | DateTime selectedDate = DateTime.now(); 15 | @override 16 | Widget build(BuildContext context) { 17 | return Center( 18 | child: Column( 19 | mainAxisAlignment: MainAxisAlignment.center, 20 | children: [ 21 | Text( 22 | "${selectedDate.year} - ${selectedDate.month} - ${selectedDate.day}", 23 | ), 24 | ElevatedButton( 25 | child: const Text("Choose Date"), 26 | onPressed: () async { 27 | final DateTime? dateTime = await showDatePicker( 28 | context: context, 29 | initialDate: selectedDate, 30 | firstDate: DateTime(2000), 31 | lastDate: DateTime(3000), 32 | ); 33 | if (dateTime != null) { 34 | setState(() { 35 | selectedDate = dateTime; 36 | }); 37 | } 38 | }, 39 | ), 40 | ], 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/every_widgets/decorated_box.dart: -------------------------------------------------------------------------------- 1 | //!DecoratedBox 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget080 extends StatelessWidget { 6 | const Widget080({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const SizedBox( 11 | height: double.infinity, 12 | width: double.infinity, 13 | child: DecoratedBox( 14 | decoration: BoxDecoration( 15 | gradient: RadialGradient( 16 | colors: [ 17 | Colors.deepOrange, 18 | Colors.red, 19 | ], 20 | ), 21 | ), 22 | ), 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/every_widgets/default_text_style.dart: -------------------------------------------------------------------------------- 1 | //!DefaultTextStyle 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget082 extends StatelessWidget { 6 | const Widget082({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Column( 11 | mainAxisAlignment: MainAxisAlignment.center, 12 | children: [ 13 | const Text( 14 | 'Flutter Mapp', 15 | ), 16 | DefaultTextStyle( 17 | style: const TextStyle( 18 | fontSize: 36, 19 | color: Colors.blue, 20 | ), 21 | child: Center( 22 | child: Column( 23 | mainAxisAlignment: MainAxisAlignment.center, 24 | children: const [ 25 | Text( 26 | 'Flutter Mapp', 27 | ), 28 | Text( 29 | 'Flutter Mapp', 30 | style: TextStyle(fontSize: 24), 31 | ), 32 | Text( 33 | 'Flutter Mapp', 34 | style: TextStyle(color: Colors.red), 35 | ), 36 | ], 37 | ), 38 | ), 39 | ), 40 | ], 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/every_widgets/dismissible.dart: -------------------------------------------------------------------------------- 1 | //!Dismissible 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget083 extends StatefulWidget { 6 | const Widget083({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget083State(); 10 | } 11 | 12 | class _Widget083State extends State { 13 | List items = List.generate(100, (int index) => index); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return ListView.builder( 18 | itemCount: items.length, 19 | padding: const EdgeInsets.symmetric(vertical: 16), 20 | itemBuilder: (BuildContext context, int index) { 21 | return Dismissible( 22 | background: Container( 23 | color: Colors.red, 24 | child: const Icon(Icons.delete), 25 | ), 26 | key: ValueKey(items[index]), 27 | onDismissed: (DismissDirection direction) { 28 | setState(() { 29 | items.removeAt(index); 30 | }); 31 | }, 32 | child: ListTile( 33 | title: Text( 34 | 'Item ${items[index]}', 35 | ), 36 | ), 37 | ); 38 | }, 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/every_widgets/divider.dart: -------------------------------------------------------------------------------- 1 | //!divider 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget084 extends StatelessWidget { 6 | const Widget084({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Column( 12 | children: [ 13 | Container( 14 | height: 200, 15 | width: double.infinity, 16 | color: Colors.orange, 17 | ), 18 | const Divider( 19 | color: Colors.white, 20 | height: 20, 21 | thickness: 5, 22 | indent: 20, 23 | endIndent: 40, 24 | ), 25 | Container( 26 | height: 200, 27 | width: double.infinity, 28 | color: Colors.orange, 29 | ), 30 | ], 31 | ), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/every_widgets/draggable_scrollable_sheet.dart: -------------------------------------------------------------------------------- 1 | //!DraggableScrollableSheet 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget085 extends StatelessWidget { 6 | const Widget085({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return DraggableScrollableSheet( 11 | builder: (BuildContext context, ScrollController scrollController) { 12 | return Container( 13 | color: Colors.orangeAccent, 14 | child: ListView.builder( 15 | controller: scrollController, 16 | itemCount: 25, 17 | itemBuilder: (BuildContext context, int index) { 18 | return ListTile( 19 | title: Text('Item $index'), 20 | ); 21 | }, 22 | ), 23 | ); 24 | }, 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/every_widgets/drawer.dart: -------------------------------------------------------------------------------- 1 | //!Drawer 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget089 extends StatelessWidget { 6 | const Widget089({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | appBar: AppBar( 12 | title: const Text('Flutter Mapp'), 13 | ), 14 | drawer: Drawer( 15 | child: ListView( 16 | children: [ 17 | ListTile( 18 | title: const Text('Item 1'), 19 | onTap: () {}, 20 | ), 21 | ListTile( 22 | title: const Text('Item 2'), 23 | onTap: () {}, 24 | ), 25 | ], 26 | ), 27 | ), 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/every_widgets/drawer_header.dart: -------------------------------------------------------------------------------- 1 | //!DrawerHeader 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget088 extends StatelessWidget { 6 | const Widget088({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | appBar: AppBar( 12 | title: const Text('Flutter Mapp'), 13 | ), 14 | drawer: Drawer( 15 | child: ListView( 16 | children: [ 17 | const DrawerHeader( 18 | decoration: BoxDecoration( 19 | color: Colors.blue, 20 | ), 21 | child: Text('Drawer Header'), 22 | ), 23 | ListTile( 24 | title: const Text('Item 1'), 25 | onTap: () {}, 26 | ), 27 | ListTile( 28 | title: const Text('Item 2'), 29 | onTap: () {}, 30 | ), 31 | ], 32 | ), 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/every_widgets/dropdown_button.dart: -------------------------------------------------------------------------------- 1 | //!DropdownButton 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget090 extends StatefulWidget { 6 | const Widget090({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget090State(); 10 | } 11 | 12 | class _Widget090State extends State { 13 | String dropdownValue = 'One'; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Center( 18 | child: DropdownButton( 19 | value: dropdownValue, 20 | icon: const Icon(Icons.menu), 21 | style: const TextStyle(color: Colors.white), 22 | underline: Container( 23 | height: 2, 24 | color: Colors.white, 25 | ), 26 | onChanged: (String? newValue) { 27 | setState(() { 28 | dropdownValue = newValue!; 29 | }); 30 | }, 31 | items: const [ 32 | DropdownMenuItem( 33 | value: 'One', 34 | child: Text('One'), 35 | ), 36 | DropdownMenuItem( 37 | value: 'Two', 38 | child: Text('Two'), 39 | ), 40 | DropdownMenuItem( 41 | value: 'Three', 42 | child: Text('Three'), 43 | ), 44 | ], 45 | ), 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/every_widgets/elevated_button.dart: -------------------------------------------------------------------------------- 1 | //!ElevatedButton 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget091 extends StatefulWidget { 6 | const Widget091({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget091State(); 10 | } 11 | 12 | class _Widget091State extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return Center( 16 | child: Column( 17 | mainAxisSize: MainAxisSize.min, 18 | children: [ 19 | const ElevatedButton( 20 | onPressed: null, 21 | child: Text('Disabled'), 22 | ), 23 | const SizedBox(height: 30), 24 | ElevatedButton( 25 | onPressed: () {}, 26 | child: const Text('Enabled'), 27 | ), 28 | const SizedBox(height: 30), 29 | ElevatedButton.icon( 30 | onPressed: () {}, 31 | label: const Text('Enabled'), 32 | icon: const Icon(Icons.message), 33 | ), 34 | ], 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/every_widgets/expanded.dart: -------------------------------------------------------------------------------- 1 | //!Expanded 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget094 extends StatefulWidget { 6 | const Widget094({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget094State(); 10 | } 11 | 12 | class _Widget094State extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return Column( 16 | children: [ 17 | Expanded( 18 | flex: 2, 19 | child: Container( 20 | color: Colors.blue, 21 | height: 200, 22 | ), 23 | ), 24 | Expanded( 25 | flex: 1, 26 | child: Container( 27 | color: Colors.orange, 28 | height: 200, 29 | ), 30 | ), 31 | Expanded( 32 | flex: 3, 33 | child: Container( 34 | color: Colors.red, 35 | height: 200, 36 | ), 37 | ), 38 | ], 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/every_widgets/expansion_tile.dart: -------------------------------------------------------------------------------- 1 | //!ExpansionTile 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget098 extends StatefulWidget { 6 | const Widget098({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget098State(); 10 | } 11 | 12 | class _Widget098State extends State { 13 | final bool _customIcon = false; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Column( 18 | children: [ 19 | ExpansionTile( 20 | title: const Text('Expansion Tile'), 21 | children: const [ 22 | ListTile( 23 | title: Text('This is tile number'), 24 | ), 25 | ], 26 | onExpansionChanged: (bool expanded) {}, 27 | controlAffinity: ListTileControlAffinity.leading, 28 | ), 29 | ], 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/every_widgets/fade_in_image.dart: -------------------------------------------------------------------------------- 1 | //!FadeInImage 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget099 extends StatelessWidget { 6 | const Widget099({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: FadeInImage.assetNetwork( 12 | placeholder: 'assets/icon/ocean.jpg', 13 | image: 'https://tinyurl.com/p4475pwh', 14 | ), 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/every_widgets/fade_transition.dart: -------------------------------------------------------------------------------- 1 | //!FadeTransition 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget100 extends StatefulWidget { 6 | const Widget100({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget100State(); 10 | } 11 | 12 | class _Widget100State extends State with TickerProviderStateMixin { 13 | late final AnimationController _controller = AnimationController( 14 | duration: const Duration(seconds: 2), 15 | vsync: this, 16 | )..repeat(reverse: true); 17 | late final Animation _animation = CurvedAnimation( 18 | parent: _controller, 19 | curve: Curves.easeIn, 20 | ); 21 | 22 | @override 23 | void dispose() { 24 | _controller.dispose(); 25 | super.dispose(); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Center( 31 | child: FadeTransition( 32 | opacity: _animation, 33 | child: const FlutterLogo(size: 300), 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/every_widgets/filled_button.dart: -------------------------------------------------------------------------------- 1 | //! FilledButton 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget100B extends StatelessWidget { 6 | const Widget100B({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: FilledButton( 12 | onPressed: () {}, 13 | child: const Text('Filled Button'), 14 | ), 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /lib/every_widgets/filter_chip.dart: -------------------------------------------------------------------------------- 1 | //!FilterChip 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget101 extends StatefulWidget { 6 | const Widget101({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => Widget101State(); 10 | } 11 | 12 | class Widget101State extends State { 13 | bool isSelected = false; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Center( 18 | child: FilterChip( 19 | label: const Text('FilterChip'), 20 | selected: isSelected, 21 | onSelected: (bool value) { 22 | setState(() { 23 | isSelected = !isSelected; 24 | }); 25 | }, 26 | avatar: const Text('F'), 27 | ), 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/every_widgets/fitted_box.dart: -------------------------------------------------------------------------------- 1 | //!FittedBox 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget102 extends StatelessWidget { 6 | const Widget102({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Container( 12 | width: double.infinity, 13 | color: Colors.orangeAccent, 14 | child: const FittedBox( 15 | child: Text( 16 | 'This is a pretty long text', 17 | style: TextStyle(color: Colors.black), 18 | ), 19 | ), 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/every_widgets/floating_action_button.dart: -------------------------------------------------------------------------------- 1 | //!FloatingActionButton 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget104 extends StatelessWidget { 6 | const Widget104({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | appBar: AppBar( 12 | title: const Text('Floating Action Button'), 13 | ), 14 | body: const Center(child: Text('Press the button below!')), 15 | floatingActionButton: FloatingActionButton( 16 | onPressed: () { 17 | }, 18 | backgroundColor: Colors.green, 19 | child: const Icon(Icons.navigation), 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/every_widgets/flutter_error_details.dart: -------------------------------------------------------------------------------- 1 | //!FlutterErrorDetails 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | void main() { 6 | try { 7 | // Try to do something! 8 | } catch (error) { 9 | // Catch & report error. 10 | FlutterError.reportError(FlutterErrorDetails( 11 | exception: error, 12 | library: 'Flutter test framework', 13 | context: ErrorSummary('while running async test code'), 14 | )); 15 | } 16 | } -------------------------------------------------------------------------------- /lib/every_widgets/flutter_logo.dart: -------------------------------------------------------------------------------- 1 | //!FlutterLogo 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget106 extends StatelessWidget { 6 | const Widget106({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const Center( 11 | child: FlutterLogo( 12 | size: 300, 13 | style: FlutterLogoStyle.stacked, 14 | textColor: Colors.blue, 15 | ), 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/every_widgets/fractional_translation.dart: -------------------------------------------------------------------------------- 1 | //!FractionalTranslation 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget108 extends StatelessWidget { 6 | const Widget108({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Column( 11 | children: [ 12 | Container( 13 | color: Colors.blueGrey, 14 | height: 100, 15 | width: 100, 16 | ), 17 | FractionalTranslation( 18 | translation: const Offset(1, -1), 19 | child: Container( 20 | color: Colors.orangeAccent, 21 | height: 100, 22 | width: 100, 23 | ), 24 | ), 25 | FractionalTranslation( 26 | translation: const Offset(1, -1), 27 | child: Container( 28 | color: Colors.redAccent, 29 | height: 100, 30 | width: 100, 31 | ), 32 | ), 33 | ], 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/every_widgets/fractionnally_sized_box.dart: -------------------------------------------------------------------------------- 1 | //!FractionallySizedBox 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget109 extends StatelessWidget { 6 | const Widget109({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: FractionallySizedBox( 12 | widthFactor: 0.5, 13 | heightFactor: 0.5, 14 | child: Container( 15 | color: Colors.amberAccent, 16 | ), 17 | ), 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/every_widgets/gesture_detector.dart: -------------------------------------------------------------------------------- 1 | //! GestureDetector 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget111 extends StatefulWidget { 5 | const Widget111({Key? key}) : super(key: key); 6 | 7 | @override 8 | State createState() => _Widget111State(); 9 | } 10 | 11 | class _Widget111State extends State { 12 | int _counter = 0; 13 | @override 14 | Widget build(BuildContext context) { 15 | return Center( 16 | child: GestureDetector( 17 | onTap: () { 18 | setState(() { 19 | _counter += 1; 20 | }); 21 | }, 22 | child: Container( 23 | height: 200, 24 | width: 200, 25 | color: Colors.orangeAccent, 26 | child: Center( 27 | child: Text( 28 | _counter.toString(), 29 | style: const TextStyle( 30 | fontSize: 50, 31 | ), 32 | ), 33 | ), 34 | ), 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/every_widgets/grid_paper.dart: -------------------------------------------------------------------------------- 1 | //! GridPaper 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget112 extends StatelessWidget { 5 | const Widget112({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return const SizedBox( 10 | height: double.infinity, 11 | width: double.infinity, 12 | child: GridPaper( 13 | color: Colors.pink, 14 | divisions: 1, 15 | interval: 210, 16 | subdivisions: 6, 17 | ), 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/every_widgets/grid_tile.dart: -------------------------------------------------------------------------------- 1 | //!GridTile 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget113 extends StatelessWidget { 6 | const Widget113({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: SizedBox( 12 | height: 400, 13 | width: 300, 14 | child: GridTile( 15 | header: Container( 16 | height: 40, 17 | child: const Center( 18 | child: Text('Header'), 19 | ), 20 | color: Colors.black38, 21 | ), 22 | child: Image.network( 23 | 'https://tinyurl.com/yc4pctt5', 24 | fit: BoxFit.cover, 25 | ), 26 | footer: Container( 27 | height: 40, 28 | child: const Center( 29 | child: Text('Footer'), 30 | ), 31 | color: Colors.black38, 32 | ), 33 | ), 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/every_widgets/grid_tile_bar.dart: -------------------------------------------------------------------------------- 1 | //!GridTileBar 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget114 extends StatelessWidget { 6 | const Widget114({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: SizedBox( 12 | height: 400, 13 | width: 300, 14 | child: GridTile( 15 | header: const GridTileBar( 16 | backgroundColor: Colors.black45, 17 | leading: Icon(Icons.person), 18 | title: Text('Flutter Mapp'), 19 | trailing: Icon( 20 | Icons.menu, 21 | ), 22 | ), 23 | child: Image.network( 24 | 'https://tinyurl.com/yc4pctt5', 25 | fit: BoxFit.cover, 26 | ), 27 | footer: const GridTileBar( 28 | backgroundColor: Colors.black45, 29 | leading: Icon(Icons.favorite), 30 | ), 31 | ), 32 | ), 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/every_widgets/grid_view.dart: -------------------------------------------------------------------------------- 1 | //!GridView 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget115 extends StatelessWidget { 6 | const Widget115({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return GridView.builder( 11 | gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( 12 | crossAxisCount: 2, 13 | ), 14 | itemBuilder: (_, index) => GridTile( 15 | header: const GridTileBar( 16 | backgroundColor: Colors.black45, 17 | leading: Icon(Icons.person), 18 | title: Text('Flutter Mapp'), 19 | trailing: Icon( 20 | Icons.menu, 21 | ), 22 | ), 23 | child: Image.network( 24 | 'https://tinyurl.com/yc4pctt5', 25 | fit: BoxFit.cover, 26 | ), 27 | footer: const GridTileBar( 28 | backgroundColor: Colors.black45, 29 | leading: Icon(Icons.favorite), 30 | ), 31 | ), 32 | itemCount: 10, 33 | ); 34 | } 35 | } 36 | 37 | //You can use this also* 38 | // GridView( 39 | // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2), 40 | // children: [], 41 | // ) 42 | -------------------------------------------------------------------------------- /lib/every_widgets/hero.dart: -------------------------------------------------------------------------------- 1 | //!Hero 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget116 extends StatelessWidget { 6 | const Widget116({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return ListTile( 11 | trailing: const Hero( 12 | tag: 'tag-1', 13 | child: Icon(Icons.person), 14 | ), 15 | onTap: () => Navigator.of(context).push( 16 | MaterialPageRoute( 17 | builder: (context) => const SecondPage(), 18 | ), 19 | ), 20 | title: const Text('Click on me'), 21 | ); 22 | } 23 | } 24 | 25 | class SecondPage extends StatelessWidget { 26 | const SecondPage({Key? key}) : super(key: key); 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Scaffold( 31 | appBar: AppBar( 32 | title: const Text('second Page'), 33 | ), 34 | body: Center( 35 | child: Column( 36 | mainAxisAlignment: MainAxisAlignment.center, 37 | children: [ 38 | Hero( 39 | tag: 'tag-1', 40 | child: Container( 41 | color: Colors.orangeAccent, 42 | height: 100, 43 | width: 100, 44 | ), 45 | ), 46 | ], 47 | ), 48 | ), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/every_widgets/icon.dart: -------------------------------------------------------------------------------- 1 | //! Icon 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget117 extends StatelessWidget { 6 | const Widget117({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const Center( 11 | child: Icon( 12 | Icons.flutter_dash, 13 | color: Colors.orangeAccent, 14 | size: 200, 15 | shadows: [ 16 | BoxShadow( 17 | color: Colors.black, 18 | offset: Offset(8, 8), 19 | spreadRadius: 10, 20 | blurRadius: 10, 21 | ), 22 | ], 23 | ), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/every_widgets/icon_button.dart: -------------------------------------------------------------------------------- 1 | //!IconButton 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget118 extends StatefulWidget { 6 | const Widget118({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget118State(); 10 | } 11 | 12 | class _Widget118State extends State { 13 | int click = 0; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Center( 18 | child: Column( 19 | mainAxisSize: MainAxisSize.min, 20 | children: [ 21 | IconButton( 22 | icon: const Icon(Icons.add_box), 23 | iconSize: 50, 24 | onPressed: () { 25 | setState(() { 26 | click += 1; 27 | }); 28 | }, 29 | //with many other arguments 30 | ), 31 | Text( 32 | 'Click $click', 33 | style: const TextStyle( 34 | fontSize: 40, 35 | ), 36 | ) 37 | ], 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/every_widgets/ignore_pointer.dart: -------------------------------------------------------------------------------- 1 | //!IgnorePointer 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget119 extends StatefulWidget { 6 | const Widget119({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget119State(); 10 | } 11 | 12 | class _Widget119State extends State { 13 | bool ignore = false; 14 | 15 | void setIgnoring(bool newValue) { 16 | setState(() { 17 | ignore = newValue; 18 | }); 19 | } 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | return Center( 24 | child: Column( 25 | mainAxisSize: MainAxisSize.min, 26 | children: [ 27 | ElevatedButton( 28 | onPressed: () { 29 | setIgnoring(!ignore); 30 | }, 31 | child: Text( 32 | ignore ? 'Blocked' : 'All good', 33 | ), 34 | style: ElevatedButton.styleFrom( 35 | primary: ignore ? Colors.red : Colors.green, 36 | ), 37 | ), 38 | IgnorePointer( 39 | ignoring: ignore, 40 | child: ElevatedButton( 41 | onPressed: () {}, 42 | child: const Text('Click me!'), 43 | ), 44 | ), 45 | ], 46 | ), 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/every_widgets/image.dart: -------------------------------------------------------------------------------- 1 | //!Image 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget120 extends StatelessWidget { 6 | const Widget120({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const Center( 11 | child: Image( 12 | image: NetworkImage('https://tinyurl.com/yc4pctt5'), 13 | color: Colors.blue, 14 | colorBlendMode: BlendMode.colorBurn, 15 | ), 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/every_widgets/image_network.dart: -------------------------------------------------------------------------------- 1 | //!Image.network 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | 6 | class Widget189 extends StatelessWidget { 7 | const Widget189({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | var title = 'Web Images'; 12 | 13 | return MaterialApp( 14 | title: title, 15 | home: Scaffold( 16 | appBar: AppBar( 17 | title: Text(title), 18 | ), 19 | body: Image.network('https://picsum.photos/250?image=9'), 20 | ), 21 | ); 22 | } 23 | } -------------------------------------------------------------------------------- /lib/every_widgets/ink_well.dart: -------------------------------------------------------------------------------- 1 | //! InkWell 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget122 extends StatefulWidget { 6 | const Widget122({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget122State(); 10 | } 11 | 12 | class _Widget122State extends State { 13 | Color color = Colors.blue; 14 | @override 15 | Widget build(BuildContext context) { 16 | return Center( 17 | child: InkWell( 18 | onTap: () { 19 | setState(() { 20 | color = Colors.red; 21 | }); 22 | }, 23 | //onDoubleTap: () {}, 24 | //onLongPress: () {}, 25 | child: Ink( 26 | height: 300, 27 | width: 300, 28 | color: color, 29 | child: const Center( 30 | child: Text('Click'), 31 | ), 32 | ), 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/every_widgets/input_chip.dart: -------------------------------------------------------------------------------- 1 | //!InputChip 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget123 extends StatefulWidget { 6 | const Widget123({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget123State(); 10 | } 11 | 12 | class _Widget123State extends State { 13 | bool isSelected = false; 14 | @override 15 | Widget build(BuildContext context) { 16 | return Center( 17 | child: InputChip( 18 | avatar: const CircleAvatar( 19 | backgroundImage: NetworkImage( 20 | 'https://tinyurl.com/5n88rk79', 21 | ), 22 | ), 23 | label: const Text('Einstein'), 24 | onSelected: (bool newBool) { 25 | setState(() { 26 | isSelected = !isSelected; 27 | }); 28 | }, 29 | selected: isSelected, 30 | selectedColor: Colors.white38, 31 | deleteIcon: const Icon(Icons.cancel_outlined), 32 | onDeleted: () {}, 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/every_widgets/interactive_viewer.dart: -------------------------------------------------------------------------------- 1 | //! InteractiveViewer 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget124 extends StatefulWidget { 6 | const Widget124({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget124State(); 10 | } 11 | 12 | class _Widget124State extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return Scaffold( 16 | backgroundColor: Colors.orangeAccent, 17 | body: InteractiveViewer( 18 | boundaryMargin: const EdgeInsets.all( 19 | double.infinity, 20 | ), 21 | child: Scaffold( 22 | appBar: AppBar( 23 | title: const Text( 24 | 'Flutter Mapp', 25 | ), 26 | ), 27 | ), 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/every_widgets/layout_builder.dart: -------------------------------------------------------------------------------- 1 | //!LayoutBuilder 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget125 extends StatelessWidget { 6 | const Widget125({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return LayoutBuilder( 11 | builder: (BuildContext context, BoxConstraints constraints) { 12 | if (constraints.maxWidth > 600) { 13 | return Center( 14 | child: Image.network( 15 | 'https://tinyurl.com/5n97bfvp', 16 | ), 17 | ); 18 | } else { 19 | return const Center( 20 | child: Text('Screen under 600'), 21 | ); 22 | } 23 | }, 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/every_widgets/limited_box.dart: -------------------------------------------------------------------------------- 1 | //!LimitedBox 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget126 extends StatelessWidget { 6 | const Widget126({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const Center( 11 | child: SingleChildScrollView( 12 | scrollDirection: Axis.vertical, 13 | child: LimitedBox( 14 | maxHeight: 50, 15 | //maxWidth: 300, 16 | child: Card( 17 | child: ListTile( 18 | leading: Icon( 19 | Icons.person, 20 | size: 50, 21 | ), 22 | title: Text('Flutter Mapp'), 23 | ), 24 | ), 25 | ), 26 | ), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/every_widgets/linear_progress_indicator.dart: -------------------------------------------------------------------------------- 1 | //!LinearProgressIndicator 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget127 extends StatefulWidget { 6 | const Widget127({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget127State(); 10 | } 11 | 12 | class _Widget127State extends State with TickerProviderStateMixin { 13 | late AnimationController controller; 14 | 15 | @override 16 | void initState() { 17 | controller = AnimationController( 18 | vsync: this, 19 | duration: const Duration(seconds: 5), 20 | )..addListener(() { 21 | setState(() {}); 22 | }); 23 | controller.repeat(reverse: true); 24 | super.initState(); 25 | } 26 | 27 | @override 28 | void dispose() { 29 | controller.dispose(); 30 | super.dispose(); 31 | } 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | return Scaffold( 36 | body: Padding( 37 | padding: const EdgeInsets.all(40.0), 38 | child: Column( 39 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 40 | children: [ 41 | LinearProgressIndicator( 42 | value: controller.value, 43 | ), 44 | const LinearProgressIndicator(), 45 | ], 46 | ), 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /lib/every_widgets/list_body.dart: -------------------------------------------------------------------------------- 1 | //! ListBody 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget128 extends StatelessWidget { 6 | const Widget128({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return ListBody( 11 | children: const [ 12 | Text('Widget 1'), 13 | Text('Widget 2'), 14 | Text('Widget 3'), 15 | ], 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/every_widgets/list_tile.dart: -------------------------------------------------------------------------------- 1 | //!ListTile 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget129 extends StatelessWidget { 6 | const Widget129({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: ListTile( 12 | title: const Text('Flutter Mapp'), 13 | tileColor: Colors.orangeAccent, 14 | onTap: () {}, 15 | leading: const Icon(Icons.person), 16 | trailing: const Icon(Icons.menu), 17 | ), 18 | ); 19 | } 20 | } -------------------------------------------------------------------------------- /lib/every_widgets/list_view.dart: -------------------------------------------------------------------------------- 1 | //!ListView 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget130 extends StatelessWidget { 6 | const Widget130({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return ListView.separated( 11 | itemCount: 5, 12 | itemBuilder: (BuildContext context, int index) { 13 | return ListTile( 14 | title: const Text('Flutter Mapp'), 15 | tileColor: Colors.orangeAccent, 16 | onTap: () {}, 17 | leading: const Icon(Icons.person), 18 | trailing: const Icon(Icons.menu), 19 | ); 20 | }, 21 | separatorBuilder: (BuildContext context, int index) => const Divider( 22 | color: Colors.white, 23 | ), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/every_widgets/list_wheel_scroll_view.dart: -------------------------------------------------------------------------------- 1 | //!ListWheelScrollView 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget131 extends StatefulWidget { 6 | const Widget131({Key? key}) : super(key: key); 7 | 8 | @override 9 | _Widget131State createState() => _Widget131State(); 10 | } 11 | 12 | class _Widget131State extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return ListWheelScrollView( 16 | itemExtent: 100, 17 | // diameterRatio: 2, 18 | // offAxisFraction: 2, 19 | // squeeze: 2, 20 | children: List.generate( 21 | 20, 22 | (index) => ListTile( 23 | title: const Text('Flutter Mapp'), 24 | onTap: () {}, 25 | leading: const Icon(Icons.person), 26 | trailing: const Icon(Icons.menu), 27 | ), 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/every_widgets/material_app.dart: -------------------------------------------------------------------------------- 1 | //!MaterialApp 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget133 extends StatelessWidget { 6 | const Widget133({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return MaterialApp( 11 | theme: ThemeData.light(), 12 | darkTheme: ThemeData.dark(), 13 | themeMode: ThemeMode.dark, 14 | debugShowCheckedModeBanner: false, 15 | // localizationsDelegates: [ 16 | // GlobalMaterialLocalizations.delegate, 17 | // GlobalWidgetsLocalizations.delegate, 18 | // GlobalCupertinoLocalizations.delegate, 19 | // ], 20 | // supportedLocales: [ 21 | // Locale('en', ''), // English, no country code 22 | // Locale('es', ''), // Spanish, no country code 23 | // ], 24 | // https://docs.flutter.dev/development/accessibility-and-localization/internationalization 25 | home: const Scaffold(), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/every_widgets/material_banner.dart: -------------------------------------------------------------------------------- 1 | //!MaterialBanner 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget134 extends StatelessWidget { 6 | const Widget134({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: ElevatedButton( 12 | child: const Text('Open'), 13 | onPressed: () { 14 | ScaffoldMessenger.of(context).showMaterialBanner( 15 | MaterialBanner( 16 | padding: const EdgeInsets.all(20), 17 | content: const Text('Subscribe!'), 18 | leading: const Icon(Icons.notifications_active_outlined), 19 | elevation: 5, 20 | backgroundColor: Colors.white12, 21 | actions: [ 22 | TextButton( 23 | onPressed: () { 24 | ScaffoldMessenger.of(context).hideCurrentMaterialBanner(); 25 | }, 26 | child: const Text('Dismiss'), 27 | ), 28 | ], 29 | ), 30 | ); 31 | }, 32 | ), 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /lib/every_widgets/material_button.dart: -------------------------------------------------------------------------------- 1 | //!MaterialButton 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget135 extends StatelessWidget { 6 | const Widget135({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: MaterialButton( 12 | onPressed: () {}, 13 | child: const Text('Click'), 14 | highlightColor: Colors.orangeAccent, 15 | splashColor: Colors.redAccent, 16 | color: Colors.blueGrey, 17 | ), 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/every_widgets/merge_semantics.dart: -------------------------------------------------------------------------------- 1 | //!MergeSemantics 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget136 extends StatelessWidget { 6 | const Widget136({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return MergeSemantics( 11 | child: Row( 12 | children: const [ 13 | Icon(Icons.person), 14 | Text('Flutter Mapp'), 15 | ], 16 | ), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/every_widgets/modal_barrier.dart: -------------------------------------------------------------------------------- 1 | //!ModalBarrier 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget137 extends StatefulWidget { 6 | const Widget137({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget137State(); 10 | } 11 | 12 | class _Widget137State extends State { 13 | bool activated = true; 14 | @override 15 | Widget build(BuildContext context) { 16 | return Stack( 17 | children: [ 18 | Center( 19 | child: ElevatedButton( 20 | onPressed: () { 21 | setState(() { 22 | activated = !activated; 23 | }); 24 | }, 25 | child: const Text('Reactivate'), 26 | ), 27 | ), 28 | if (activated) 29 | Opacity( 30 | opacity: 0.4, 31 | child: ModalBarrier( 32 | dismissible: false, 33 | onDismiss: () { 34 | setState(() { 35 | activated = !activated; 36 | }); 37 | }, 38 | color: Colors.orangeAccent, 39 | ), 40 | ), 41 | ], 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /lib/every_widgets/mouse_cursor.dart: -------------------------------------------------------------------------------- 1 | //!MouseCursor 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | //? Still 60 + 21 widgets to do = 91 6 | 7 | class Widget138 extends StatelessWidget { 8 | const Widget138({Key? key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Center( 13 | child: MouseRegion( 14 | cursor: SystemMouseCursors.grab, 15 | child: Container( 16 | width: 200, 17 | height: 100, 18 | decoration: const BoxDecoration( 19 | shape: BoxShape.circle, 20 | color: Colors.orangeAccent, 21 | ), 22 | ), 23 | ), 24 | ); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /lib/every_widgets/navigation_bar.dart: -------------------------------------------------------------------------------- 1 | //!NavigationBar 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget140 extends StatefulWidget { 6 | const Widget140({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget140State(); 10 | } 11 | 12 | class _Widget140State extends State { 13 | int currentIndex = 0; 14 | static const List body = [ 15 | Icon(Icons.home, size: 50), 16 | Icon(Icons.search, size: 50), 17 | Icon(Icons.person, size: 50), 18 | ]; 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | body: Center( 24 | child: body.elementAt(currentIndex), 25 | ), 26 | bottomNavigationBar: NavigationBar( 27 | destinations: const [ 28 | NavigationDestination(icon: Icon(Icons.home), label: 'Home'), 29 | NavigationDestination(icon: Icon(Icons.search), label: 'Search'), 30 | NavigationDestination(icon: Icon(Icons.person), label: 'Person'), 31 | ], 32 | selectedIndex: currentIndex, 33 | onDestinationSelected: (int index) { 34 | setState(() { 35 | currentIndex = index; 36 | }); 37 | }, 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/every_widgets/navigation_drawer.dart: -------------------------------------------------------------------------------- 1 | //!NavigationDrawer 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget140C extends StatelessWidget { 6 | const Widget140C({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | appBar: AppBar( 12 | title: const Text('Flutter Mapp'), 13 | ), 14 | drawer: const NavigationDrawer( 15 | children: [ 16 | NavigationDrawerDestination( 17 | icon: Icon(Icons.home), 18 | label: Text('Home'), 19 | ), 20 | NavigationDrawerDestination( 21 | icon: Icon(Icons.home), 22 | label: Text('Home'), 23 | ), 24 | ], 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/every_widgets/navigation_drawer_destination.dart: -------------------------------------------------------------------------------- 1 | //!NavigationDrawerDestination 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget140B extends StatelessWidget { 6 | const Widget140B({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | appBar: AppBar( 12 | title: const Text('Flutter Mapp'), 13 | ), 14 | drawer: const NavigationDrawer( 15 | children: [ 16 | NavigationDrawerDestination( 17 | icon: Icon(Icons.home), 18 | label: Text('Home'), 19 | ), 20 | NavigationDrawerDestination( 21 | icon: Icon(Icons.home), 22 | label: Text('Home'), 23 | ), 24 | ], 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/every_widgets/offstage.dart: -------------------------------------------------------------------------------- 1 | //! Offstage 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget142 extends StatefulWidget { 6 | const Widget142({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget142State(); 10 | } 11 | 12 | class _Widget142State extends State { 13 | bool isHided = true; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return SizedBox( 18 | width: double.infinity, 19 | child: Column( 20 | mainAxisAlignment: MainAxisAlignment.center, 21 | children: [ 22 | Offstage( 23 | offstage: isHided, 24 | child: const Icon( 25 | Icons.flutter_dash, 26 | size: 100, 27 | ), 28 | ), 29 | ElevatedButton( 30 | child: Text('isHided = $isHided'), 31 | onPressed: () { 32 | setState(() { 33 | isHided = !isHided; 34 | }); 35 | }, 36 | ), 37 | ], 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/every_widgets/opacity.dart: -------------------------------------------------------------------------------- 1 | //! Opacity 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget143 extends StatelessWidget { 6 | const Widget143({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Column( 11 | children: [ 12 | Opacity( 13 | opacity: 1, 14 | child: Container( 15 | width: double.infinity, 16 | height: 100, 17 | color: Colors.orangeAccent, 18 | alignment: Alignment.center, 19 | child: const Text('Flutter Mapp'), 20 | ), 21 | ), 22 | Opacity( 23 | opacity: 0.5, 24 | child: Container( 25 | width: double.infinity, 26 | height: 100, 27 | color: Colors.orangeAccent, 28 | alignment: Alignment.center, 29 | child: const Text('Flutter Mapp'), 30 | ), 31 | ), 32 | Opacity( 33 | opacity: 0.1, 34 | child: Container( 35 | width: double.infinity, 36 | height: 100, 37 | color: Colors.orangeAccent, 38 | alignment: Alignment.center, 39 | child: const Text('Flutter Mapp'), 40 | ), 41 | ), 42 | ], 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/every_widgets/orientation_builder.dart: -------------------------------------------------------------------------------- 1 | //! OrientationBuilder 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget144 extends StatelessWidget { 6 | const Widget144({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return OrientationBuilder( 11 | builder: (context, orientation) { 12 | if (orientation == Orientation.portrait) { 13 | return const Center( 14 | child: Text('Portrait'), 15 | ); 16 | } else { 17 | return const Center( 18 | child: Text('Landscape'), 19 | ); 20 | } 21 | }, 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/every_widgets/outlined_button.dart: -------------------------------------------------------------------------------- 1 | //! OutlinedButton 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget145 extends StatelessWidget { 6 | const Widget145({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return OutlinedButton( 11 | onPressed: () {}, 12 | child: const Text('Click Me'), 13 | style: OutlinedButton.styleFrom( 14 | primary: Colors.black, 15 | backgroundColor: Colors.orangeAccent, 16 | ), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/every_widgets/overflow_bar.dart: -------------------------------------------------------------------------------- 1 | //! OverflowBar 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget146 extends StatelessWidget { 6 | const Widget146({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Padding( 11 | padding: const EdgeInsets.all(8.0), 12 | child: OverflowBar( 13 | spacing: 8, 14 | children: [ 15 | ElevatedButton( 16 | child: const Text('Flutter Mapp'), 17 | onPressed: () {}, 18 | ), 19 | ElevatedButton( 20 | child: const Text('Flutter Mapp'), 21 | onPressed: () {}, 22 | ), 23 | ElevatedButton( 24 | child: const Text('Flutter Mapp'), 25 | onPressed: () {}, 26 | ), 27 | ], 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/every_widgets/overflow_box.dart: -------------------------------------------------------------------------------- 1 | //! OverflowBox 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget147 extends StatelessWidget { 6 | const Widget147({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Container( 12 | width: 100, 13 | height: 100, 14 | color: Colors.orangeAccent, 15 | child: OverflowBox( 16 | maxWidth: 200, 17 | maxHeight: 200, 18 | child: Container( 19 | color: Colors.red.withOpacity(0.5), 20 | width: double.infinity, 21 | height: double.infinity, 22 | ), 23 | ), 24 | ), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/every_widgets/padding.dart: -------------------------------------------------------------------------------- 1 | //! Padding 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget148 extends StatelessWidget { 6 | const Widget148({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const Center( 11 | child: Card( 12 | child: Padding( 13 | padding: EdgeInsets.all(20), 14 | // padding: EdgeInsets.zero, 15 | // padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), 16 | // padding: EdgeInsets.fromLTRB(5, 10, 15, 20), 17 | child: Text('Flutter Mapp'), 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/every_widgets/page_view.dart: -------------------------------------------------------------------------------- 1 | //!PageView 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget149 extends StatefulWidget { 6 | const Widget149({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget149State(); 10 | } 11 | 12 | class _Widget149State extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return PageView( 16 | children: [ 17 | Container( 18 | color: Colors.orangeAccent, 19 | child: const Center( 20 | child: Text( 21 | "1", 22 | style: TextStyle(fontSize: 100), 23 | ), 24 | ), 25 | ), 26 | Container( 27 | color: Colors.redAccent, 28 | child: const Center( 29 | child: Text( 30 | "2", 31 | style: TextStyle(fontSize: 100), 32 | ), 33 | ), 34 | ), 35 | Container( 36 | color: Colors.blueGrey, 37 | child: const Center( 38 | child: Text( 39 | "3", 40 | style: TextStyle(fontSize: 100), 41 | ), 42 | ), 43 | ), 44 | ], 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/every_widgets/physical_model.dart: -------------------------------------------------------------------------------- 1 | //! PhysicalModel 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget150 extends StatelessWidget { 6 | const Widget150({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const Scaffold( 11 | backgroundColor: Colors.white, 12 | body: Center( 13 | child: PhysicalModel( 14 | elevation: 20.0, 15 | shadowColor: Colors.redAccent, 16 | color: Colors.orangeAccent, 17 | shape: BoxShape.circle, 18 | child: SizedBox( 19 | width: 200, 20 | height: 200, 21 | child: Center( 22 | child: Icon( 23 | Icons.flutter_dash, 24 | size: 100, 25 | ), 26 | ), 27 | ), 28 | ), 29 | ), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/every_widgets/physical_shape.dart: -------------------------------------------------------------------------------- 1 | //! PhysicalShape 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget151 extends StatelessWidget { 6 | const Widget151({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: PhysicalShape( 12 | elevation: 5.0, 13 | clipper: ShapeBorderClipper( 14 | shape: RoundedRectangleBorder( 15 | borderRadius: BorderRadius.circular(40.0), 16 | ), 17 | ), 18 | color: Colors.orangeAccent, 19 | child: const SizedBox( 20 | height: 250, 21 | width: 250, 22 | child: Center( 23 | child: Icon( 24 | Icons.flutter_dash, 25 | size: 100, 26 | ), 27 | ), 28 | ), 29 | ), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/every_widgets/placeholder.dart: -------------------------------------------------------------------------------- 1 | //! Placeholder 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget152 extends StatelessWidget { 6 | const Widget152({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Column( 11 | children: const [ 12 | Placeholder( 13 | fallbackHeight: 300, 14 | fallbackWidth: 50, 15 | color: Colors.orangeAccent, 16 | ), 17 | ], 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/every_widgets/popup_menu_button.dart: -------------------------------------------------------------------------------- 1 | //!PopupMenuButton 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget154 extends StatefulWidget { 6 | const Widget154({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget154State(); 10 | } 11 | 12 | class _Widget154State extends State { 13 | String title = 'First item'; 14 | String item1 = 'First item'; 15 | String item2 = 'Second item'; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return ListTile( 20 | title: Text(title), 21 | trailing: PopupMenuButton( 22 | itemBuilder: (context) => [ 23 | PopupMenuItem( 24 | child: Text(item1), 25 | value: item1, 26 | ), 27 | PopupMenuItem( 28 | child: Text(item2), 29 | value: item2, 30 | ) 31 | ], 32 | onSelected: (String newValue) { 33 | setState(() { 34 | title = newValue; 35 | }); 36 | }, 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/every_widgets/positioned.dart: -------------------------------------------------------------------------------- 1 | //!positioned 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget155 extends StatelessWidget { 5 | const Widget155({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Center( 10 | child: Stack( 11 | children: [ 12 | Positioned( 13 | left: 20, 14 | top: 20, 15 | child: Image.network( 16 | 'https://tinyurl.com/yc4pctt5', 17 | width: 250, 18 | ), 19 | ), 20 | Positioned( 21 | left: 60, 22 | top: 120, 23 | child: Image.network( 24 | 'https://tinyurl.com/22yj4f66', 25 | width: 250, 26 | ), 27 | ), 28 | Positioned( 29 | left: 100, 30 | top: 220, 31 | child: Image.network( 32 | 'https://tinyurl.com/5n97bfvp', 33 | width: 250, 34 | ), 35 | ), 36 | ], 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/every_widgets/preferred_size.dart: -------------------------------------------------------------------------------- 1 | //! PreferredSize 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget157 extends StatelessWidget { 6 | const Widget157({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Scaffold( 11 | appBar: PreferredSize( 12 | preferredSize: const Size.fromHeight(80.0), 13 | child: Container( 14 | height: 70, 15 | decoration: const BoxDecoration( 16 | gradient: LinearGradient( 17 | colors: [ 18 | Colors.redAccent, 19 | Colors.orangeAccent, 20 | ], 21 | ), 22 | ), 23 | child: Center( 24 | child: ListTile( 25 | title: const Text('Flutter Mapp'), 26 | trailing: IconButton( 27 | icon: const Icon( 28 | Icons.search, 29 | size: 20, 30 | ), 31 | color: Colors.white, 32 | onPressed: () {}, 33 | ), 34 | ), 35 | ), 36 | ), 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/every_widgets/radio.dart: -------------------------------------------------------------------------------- 1 | //! Radio 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget158 extends StatefulWidget { 6 | const Widget158({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget158State(); 10 | } 11 | 12 | List options = ['Option 1', 'Option 2']; 13 | 14 | class _Widget158State extends State { 15 | String currentOption = options[0]; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Column( 20 | children: [ 21 | ListTile( 22 | title: const Text('Option 1'), 23 | leading: Radio( 24 | value: options[0], 25 | groupValue: currentOption, 26 | onChanged: (value) { 27 | setState(() { 28 | currentOption = value.toString(); 29 | }); 30 | }, 31 | ), 32 | ), 33 | ListTile( 34 | title: const Text('Option 2'), 35 | leading: Radio( 36 | value: options[1], 37 | groupValue: currentOption, 38 | onChanged: (value) { 39 | setState(() { 40 | currentOption = value.toString(); 41 | }); 42 | }, 43 | ), 44 | ), 45 | ], 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /lib/every_widgets/radio_list_tile.dart: -------------------------------------------------------------------------------- 1 | //! RadioListTile 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | enum SingingCharacter { lafayette, jefferson } 6 | 7 | class Widget159 extends StatefulWidget { 8 | const Widget159({Key? key}) : super(key: key); 9 | 10 | @override 11 | State createState() => _Widget159State(); 12 | } 13 | 14 | List options = ['Option 1', 'Option 2']; 15 | 16 | class _Widget159State extends State { 17 | String currentOption = options[0]; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | return Column( 22 | children: [ 23 | RadioListTile( 24 | title: const Text('Option 1'), 25 | value: options[0], 26 | groupValue: currentOption, 27 | onChanged: (value) { 28 | setState(() { 29 | currentOption = value.toString(); 30 | }); 31 | }, 32 | ), 33 | RadioListTile( 34 | title: const Text('Option 2'), 35 | value: options[1], 36 | groupValue: currentOption, 37 | onChanged: (value) { 38 | setState(() { 39 | currentOption = value.toString(); 40 | }); 41 | }, 42 | ), 43 | ], 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/every_widgets/range_slider.dart: -------------------------------------------------------------------------------- 1 | //! RangeSlider 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget160 extends StatefulWidget { 6 | const Widget160({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget160State(); 10 | } 11 | 12 | class _Widget160State extends State { 13 | RangeValues values = const RangeValues(0.1, 0.5); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | RangeLabels labels = RangeLabels( 18 | values.start.toString(), 19 | values.end.toString(), 20 | ); 21 | return Center( 22 | child: RangeSlider( 23 | values: values, 24 | divisions: 10, 25 | labels: labels, 26 | onChanged: (newValues) { 27 | setState(() { 28 | values = newValues; 29 | }); 30 | }, 31 | ), 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/every_widgets/raw_chip.dart: -------------------------------------------------------------------------------- 1 | //! rawchip 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget162 extends StatelessWidget { 6 | const Widget162({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: RawChip( 12 | label: const Text('RawChip'), 13 | avatar: const Icon(Icons.person), 14 | deleteIcon: const Icon(Icons.remove_circle), 15 | onPressed: () {}, 16 | onDeleted: () {}, 17 | ), 18 | ); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/every_widgets/refresh_indicator.dart: -------------------------------------------------------------------------------- 1 | //! RefreshIndicator 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget163 extends StatefulWidget { 6 | const Widget163({Key? key}) : super(key: key); 7 | @override 8 | _Widget163State createState() => _Widget163State(); 9 | } 10 | 11 | class _Widget163State extends State { 12 | List items = [ 13 | "Item 1", 14 | "Item 2", 15 | ]; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return RefreshIndicator( 20 | onRefresh: () async { 21 | await Future.delayed( 22 | const Duration(seconds: 1), 23 | ); 24 | int nextItem = items.length + 1; 25 | items.add("Item $nextItem"); 26 | setState(() {}); 27 | }, 28 | child: ListView.builder( 29 | itemCount: items.length, 30 | itemBuilder: ((context, index) => Padding( 31 | padding: const EdgeInsets.all(8.0), 32 | child: ListTile( 33 | title: Text(items[index]), 34 | tileColor: Colors.white24, 35 | ), 36 | )), 37 | padding: const EdgeInsets.all(5), 38 | ), 39 | color: Colors.white, 40 | backgroundColor: Colors.orangeAccent, 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/every_widgets/reorderable_list_view.dart: -------------------------------------------------------------------------------- 1 | //! ReorderableListView 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget164 extends StatefulWidget { 6 | const Widget164({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget164State(); 10 | } 11 | 12 | class _Widget164State extends State { 13 | final List items = List.generate(30, (int index) => index); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return ReorderableListView( 18 | children: List.generate( 19 | items.length, 20 | (index) => ListTile( 21 | key: Key('$index'), 22 | tileColor: items[index].isOdd ? Colors.white12 : Colors.white30, 23 | title: Text('Item ${items[index]}'), 24 | trailing: const Icon(Icons.drag_handle_sharp), 25 | ), 26 | ), 27 | onReorder: (int oldIndex, int newIndex) { 28 | setState(() { 29 | if (oldIndex < newIndex) { 30 | newIndex -= 1; 31 | } 32 | final int item = items.removeAt(oldIndex); 33 | items.insert(newIndex, item); 34 | }); 35 | }, 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/every_widgets/rich_text.dart: -------------------------------------------------------------------------------- 1 | //! richtext 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget165 extends StatelessWidget { 6 | const Widget165({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: RichText( 12 | text: const TextSpan( 13 | style: TextStyle( 14 | color: Colors.orangeAccent, 15 | fontSize: 30, 16 | ), 17 | children: [ 18 | TextSpan(text: 'To the '), 19 | TextSpan( 20 | text: 'moon ', 21 | style: TextStyle( 22 | fontWeight: FontWeight.bold, 23 | color: Colors.white, 24 | ), 25 | ), 26 | TextSpan(text: 'and beyond!'), 27 | ], 28 | ), 29 | ), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lib/every_widgets/rotated_box.dart: -------------------------------------------------------------------------------- 1 | //! RotatedBox 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget166 extends StatelessWidget { 6 | const Widget166({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const Center( 11 | child: RotatedBox( 12 | quarterTurns: 1, 13 | child: FlutterLogo( 14 | size: 200, 15 | ), 16 | ), 17 | ); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/every_widgets/rotation_transition.dart: -------------------------------------------------------------------------------- 1 | //! RotationTransition 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget167 extends StatefulWidget { 6 | const Widget167({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget167State(); 10 | } 11 | 12 | class _Widget167State extends State with TickerProviderStateMixin { 13 | late final AnimationController _controller = AnimationController( 14 | duration: const Duration(seconds: 1), 15 | vsync: this, 16 | )..repeat(reverse: true); 17 | late final Animation _animation = CurvedAnimation( 18 | parent: _controller, 19 | curve: Curves.easeInCirc, 20 | ); 21 | 22 | @override 23 | void dispose() { 24 | _controller.dispose(); 25 | super.dispose(); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Center( 31 | child: RotationTransition( 32 | turns: _animation, 33 | child: const Padding( 34 | padding: EdgeInsets.all(8.0), 35 | child: FlutterLogo(size: 150.0), 36 | ), 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /lib/every_widgets/row.dart: -------------------------------------------------------------------------------- 1 | //! Row 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget168 extends StatelessWidget { 6 | const Widget168({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return SizedBox( 11 | height: double.infinity, 12 | child: Row( 13 | crossAxisAlignment: CrossAxisAlignment.center, 14 | children: [ 15 | Expanded( 16 | child: ElevatedButton( 17 | onPressed: () {}, 18 | child: const Text('Click'), 19 | ), 20 | ), 21 | Expanded( 22 | child: ElevatedButton( 23 | onPressed: () {}, 24 | child: const Text('Click'), 25 | ), 26 | ), 27 | Expanded( 28 | child: ElevatedButton( 29 | onPressed: () {}, 30 | child: const Text('Click'), 31 | ), 32 | ), 33 | ], 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/every_widgets/scale_transition.dart: -------------------------------------------------------------------------------- 1 | //! ScaleTransition 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget170 extends StatefulWidget { 6 | const Widget170({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget170State(); 10 | } 11 | 12 | class _Widget170State extends State with TickerProviderStateMixin { 13 | late final AnimationController _controller = AnimationController( 14 | duration: const Duration(seconds: 1), 15 | vsync: this, 16 | )..repeat(reverse: true); 17 | late final Animation _animation = CurvedAnimation( 18 | parent: _controller, 19 | curve: Curves.fastOutSlowIn, 20 | ); 21 | 22 | @override 23 | void dispose() { 24 | _controller.dispose(); 25 | super.dispose(); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Center( 31 | child: ScaleTransition( 32 | scale: _animation, 33 | child: const FlutterLogo(size: 150.0), 34 | ), 35 | ); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /lib/every_widgets/scrollbar.dart: -------------------------------------------------------------------------------- 1 | //! Scrollbar 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget171 extends StatefulWidget { 6 | const Widget171({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget171State(); 10 | } 11 | 12 | class _Widget171State extends State { 13 | final ScrollController controller = ScrollController(); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scrollbar( 18 | controller: controller, 19 | child: ListView.builder( 20 | controller: controller, 21 | itemCount: 40, 22 | itemBuilder: (BuildContext context, int index) { 23 | return ListTile( 24 | title: Text('Item ${index + 1}'), 25 | ); 26 | }, 27 | ), 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/every_widgets/selectable_text.dart: -------------------------------------------------------------------------------- 1 | //!Selectable Text 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget172 extends StatefulWidget { 6 | const Widget172({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget172State(); 10 | } 11 | 12 | class _Widget172State extends State { 13 | String text = ''; 14 | @override 15 | Widget build(BuildContext context) { 16 | return Center( 17 | child: SelectableText( 18 | 'This is selectable', 19 | style: const TextStyle(fontSize: 30), 20 | onSelectionChanged: (selection, cause) {}, 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/every_widgets/semantics.dart: -------------------------------------------------------------------------------- 1 | //!Semantics 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget173 extends StatelessWidget { 6 | const Widget173({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Column( 12 | mainAxisSize: MainAxisSize.min, 13 | children: [ 14 | Semantics( 15 | child: const FlutterLogo( 16 | size: 200, 17 | ), 18 | label: 'This is the Flutter Logo', 19 | ), 20 | const FlutterLogo( 21 | size: 200, 22 | ), 23 | ], 24 | ), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/every_widgets/shader_mask.dart: -------------------------------------------------------------------------------- 1 | //! ShaderMask 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget174 extends StatelessWidget { 6 | const Widget174({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Padding( 11 | padding: const EdgeInsets.all(8.0), 12 | child: Center( 13 | child: ShaderMask( 14 | shaderCallback: (Rect bounds) { 15 | return const RadialGradient( 16 | center: Alignment.topRight, 17 | radius: 4.0, 18 | colors: [ 19 | Colors.orangeAccent, 20 | Colors.redAccent, 21 | ], 22 | tileMode: TileMode.mirror, 23 | ).createShader(bounds); 24 | }, 25 | child: const Text( 26 | 'This is a cool looking text', 27 | style: TextStyle(fontSize: 40), 28 | ), 29 | ), 30 | ), 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/every_widgets/simple_dialog.dart: -------------------------------------------------------------------------------- 1 | //! SimpleDialog 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget176 extends StatefulWidget { 6 | const Widget176({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _MyHomePage14State(); 10 | } 11 | 12 | class _MyHomePage14State extends State { 13 | @override 14 | Widget build(BuildContext context) { 15 | return Center( 16 | child: ElevatedButton( 17 | onPressed: () { 18 | showDialog( 19 | context: context, 20 | builder: (context) => SimpleDialog( 21 | title: const Text('Flutter Mapp'), 22 | contentPadding: const EdgeInsets.all(20.0), 23 | children: [ 24 | const Text('More information'), 25 | TextButton( 26 | onPressed: () { 27 | Navigator.of(context).pop(); 28 | }, 29 | child: const Text('Close'), 30 | ) 31 | ], 32 | ), 33 | ); 34 | }, 35 | child: const Text('Show Dialog'), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/every_widgets/single_child_scroll_view.dart: -------------------------------------------------------------------------------- 1 | //! SingleChildScrollView 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget177 extends StatelessWidget { 6 | const Widget177({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return SingleChildScrollView( 11 | child: Column( 12 | children: List.generate( 13 | 50, 14 | (index) => ListTile( 15 | title: Text('Item ${index + 1}'), 16 | ), 17 | ), 18 | ), 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /lib/every_widgets/size_transition.dart: -------------------------------------------------------------------------------- 1 | //! SizeTransition 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget178 extends StatefulWidget { 6 | const Widget178({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget178State(); 10 | } 11 | 12 | class _Widget178State extends State with TickerProviderStateMixin { 13 | late final AnimationController _controller = AnimationController( 14 | duration: const Duration(seconds: 2), 15 | vsync: this, 16 | )..repeat(reverse: true); 17 | late final Animation _animation = CurvedAnimation( 18 | parent: _controller, 19 | curve: Curves.easeInSine, 20 | ); 21 | 22 | @override 23 | void dispose() { 24 | _controller.dispose(); 25 | super.dispose(); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return SizeTransition( 31 | sizeFactor: _animation, 32 | axis: Axis.horizontal, 33 | axisAlignment: -1, 34 | child: const Center( 35 | child: FlutterLogo(size: 300.0), 36 | ), 37 | ); 38 | } 39 | } -------------------------------------------------------------------------------- /lib/every_widgets/sized_box.dart: -------------------------------------------------------------------------------- 1 | //! SizedBox 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget179 extends StatelessWidget { 6 | const Widget179({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const Center( 11 | child: SizedBox( 12 | width: 300.0, 13 | height: 300.0, 14 | child: Card( 15 | color: Colors.orangeAccent, 16 | child: Center( 17 | child: Text( 18 | 'Flutter Mapp', 19 | style: TextStyle( 20 | fontSize: 30, 21 | ), 22 | ), 23 | ), 24 | ), 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/every_widgets/sized_overflow_box.dart: -------------------------------------------------------------------------------- 1 | //!SizedOverflowBox 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget180 extends StatelessWidget { 6 | const Widget180({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Container( 12 | color: Colors.orangeAccent, 13 | child: SizedOverflowBox( 14 | size: const Size(100, 100), 15 | child: ElevatedButton( 16 | onPressed: () {}, 17 | child: const Text('This is a button'), 18 | ), 19 | ), 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/every_widgets/slide_transition.dart: -------------------------------------------------------------------------------- 1 | //!SlideTransition 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget181 extends StatefulWidget { 6 | const Widget181({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget181State(); 10 | } 11 | 12 | class _Widget181State extends State 13 | with SingleTickerProviderStateMixin { 14 | late final AnimationController _controller = AnimationController( 15 | duration: const Duration(seconds: 2), 16 | vsync: this, 17 | )..repeat(reverse: true); 18 | late final Animation _offsetAnimation = Tween( 19 | begin: Offset.zero, 20 | end: const Offset(0, 1.5), 21 | ).animate( 22 | CurvedAnimation( 23 | parent: _controller, 24 | curve: Curves.elasticIn, 25 | ), 26 | ); 27 | 28 | @override 29 | void dispose() { 30 | _controller.dispose(); 31 | super.dispose(); 32 | } 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return Center( 37 | child: SlideTransition( 38 | position: _offsetAnimation, 39 | child: const Padding( 40 | padding: EdgeInsets.all(8.0), 41 | child: FlutterLogo(size: 150.0), 42 | ), 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/every_widgets/slider.dart: -------------------------------------------------------------------------------- 1 | //! Slider 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget182 extends StatefulWidget { 6 | const Widget182({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget182State(); 10 | } 11 | 12 | class _Widget182State extends State { 13 | double _currentSliderValue = 20; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Slider( 18 | value: _currentSliderValue, 19 | max: 100, 20 | divisions: 5, 21 | label: _currentSliderValue.round().toString(), 22 | onChanged: (double value) { 23 | setState(() { 24 | _currentSliderValue = value; 25 | }); 26 | }, 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /lib/every_widgets/sliver_fixed_extent_list.dart: -------------------------------------------------------------------------------- 1 | //! SliverFixedExtentList 2 | //?DONE 3 | 4 | import 'package:flutter/material.dart'; 5 | 6 | class Widget184 extends StatelessWidget { 7 | const Widget184({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return CustomScrollView( 12 | slivers: [ 13 | SliverFixedExtentList( 14 | itemExtent: 50.0, 15 | delegate: SliverChildBuilderDelegate( 16 | (BuildContext context, int index) { 17 | return Container( 18 | alignment: Alignment.center, 19 | color: index.isEven ? Colors.white12 : Colors.white38, 20 | child: Text('Item ${index + 1}'), 21 | ); 22 | }, 23 | ), 24 | ) 25 | ], 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/every_widgets/sliver_grid.dart: -------------------------------------------------------------------------------- 1 | //! SliverGrid 2 | //? DONE 3 | 4 | import 'package:flutter/material.dart'; 5 | 6 | class Widget185 extends StatelessWidget { 7 | const Widget185({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return CustomScrollView( 12 | slivers: [ 13 | SliverGrid( 14 | gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent( 15 | maxCrossAxisExtent: 200.0, 16 | mainAxisSpacing: 10.0, 17 | crossAxisSpacing: 10.0, 18 | childAspectRatio: 4.0, 19 | ), 20 | delegate: SliverChildBuilderDelegate( 21 | (BuildContext context, int index) { 22 | return Container( 23 | alignment: Alignment.center, 24 | color: Colors.orange[100 * (index % 9)], 25 | child: Text('Item ${index + 1}'), 26 | ); 27 | }, 28 | childCount: 20, 29 | ), 30 | ) 31 | ], 32 | ); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/every_widgets/sliver_list.dart: -------------------------------------------------------------------------------- 1 | //! SliverList 2 | //? DONE 3 | 4 | import 'package:flutter/material.dart'; 5 | 6 | class Widget186 extends StatelessWidget { 7 | const Widget186({Key? key}) : super(key: key); 8 | 9 | @override 10 | Widget build(BuildContext context) { 11 | return CustomScrollView( 12 | slivers: [ 13 | SliverList( 14 | delegate: SliverChildBuilderDelegate( 15 | (BuildContext context, int index) { 16 | return ListTile( 17 | title: Text('Item ${index + 1}'), 18 | tileColor: Colors.orange[100 * (index % 9 + 1)], 19 | ); 20 | }, 21 | childCount: 50, 22 | ), 23 | ), 24 | ], 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/every_widgets/sliver_padding.dart: -------------------------------------------------------------------------------- 1 | //! SliverPadding 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget188 extends StatelessWidget { 6 | const Widget188({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return CustomScrollView( 11 | slivers: [ 12 | SliverPadding( 13 | padding: const EdgeInsets.all(50.0), 14 | sliver: SliverList( 15 | delegate: SliverChildListDelegate( 16 | [ 17 | Image.network('https://tinyurl.com/95ncjeuu'), 18 | ], 19 | ), 20 | ), 21 | ), 22 | ], 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/every_widgets/sliver_to_box_adapter.dart: -------------------------------------------------------------------------------- 1 | //! SliverToBoxAdapter 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget189 extends StatelessWidget { 6 | const Widget189({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const CustomScrollView( 11 | slivers: [ 12 | SliverToBoxAdapter( 13 | child: SizedBox( 14 | height: 20, 15 | child: Center( 16 | child: Text('Sliver To Box Adapter'), 17 | ), 18 | ), 19 | ), 20 | ], 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/every_widgets/snack_bar.dart: -------------------------------------------------------------------------------- 1 | //! SnackBar 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget190 extends StatelessWidget { 6 | const Widget190({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: ElevatedButton( 12 | onPressed: () { 13 | ScaffoldMessenger.of(context).showSnackBar( 14 | SnackBar( 15 | content: const Text('Flutter Mapp'), 16 | action: SnackBarAction( 17 | label: 'Undo', 18 | onPressed: () {}, 19 | ), 20 | ), 21 | ); 22 | }, 23 | child: const Text('Show SnackBar'), 24 | ), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/every_widgets/spacer.dart: -------------------------------------------------------------------------------- 1 | //! spacer 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget191 extends StatelessWidget { 6 | const Widget191({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Column( 11 | children: [ 12 | Container( 13 | color: Colors.orangeAccent, 14 | height: 100, 15 | ), 16 | const Spacer( 17 | flex: 1, 18 | ), 19 | Container( 20 | color: Colors.orangeAccent, 21 | height: 100, 22 | ), 23 | const Spacer( 24 | flex: 2, 25 | ), 26 | Container( 27 | color: Colors.orangeAccent, 28 | height: 100, 29 | ) 30 | ], 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/every_widgets/stack.dart: -------------------------------------------------------------------------------- 1 | //! stack 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget192 extends StatelessWidget { 6 | const Widget192({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Stack( 12 | children: [ 13 | Center( 14 | child: Image.asset( 15 | 'assets/icon/ocean.jpg', 16 | ), 17 | ), 18 | Center( 19 | child: Image.asset( 20 | 'assets/icon/blue.jpg', 21 | width: 300, 22 | ), 23 | ), 24 | ], 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/every_widgets/switch.dart: -------------------------------------------------------------------------------- 1 | //! Switch 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget195 extends StatefulWidget { 6 | const Widget195({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget195State(); 10 | } 11 | 12 | class _Widget195State extends State { 13 | bool isSwitched = false; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Center( 18 | child: Switch( 19 | value: isSwitched, 20 | onChanged: (value) { 21 | setState(() { 22 | isSwitched = value; 23 | }); 24 | }, 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/every_widgets/switch_list_tile.dart: -------------------------------------------------------------------------------- 1 | //! SwitchListTile 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget196 extends StatefulWidget { 6 | const Widget196({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget196State(); 10 | } 11 | 12 | class _Widget196State extends State { 13 | bool lights = false; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Center( 18 | child: SwitchListTile( 19 | title: const Text('Lights'), 20 | value: lights, 21 | onChanged: (bool value) { 22 | setState(() { 23 | lights = value; 24 | }); 25 | }, 26 | secondary: const Icon(Icons.lightbulb_outline), 27 | ), 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/every_widgets/tab_bar.dart: -------------------------------------------------------------------------------- 1 | //! TabBar 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget197 extends StatelessWidget { 6 | const Widget197({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return DefaultTabController( 11 | length: 3, 12 | child: Scaffold( 13 | appBar: AppBar( 14 | bottom: const TabBar( 15 | tabs: [ 16 | Tab( 17 | icon: Icon(Icons.home), 18 | ), 19 | Tab( 20 | icon: Icon(Icons.settings), 21 | ), 22 | Tab( 23 | icon: Icon(Icons.person), 24 | ), 25 | ], 26 | ), 27 | title: const Text('Flutter Mapp'), 28 | ), 29 | body: const TabBarView( 30 | children: [ 31 | Icon(Icons.home), 32 | Icon(Icons.settings), 33 | Icon(Icons.person), 34 | ], 35 | ), 36 | ), 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /lib/every_widgets/text.dart: -------------------------------------------------------------------------------- 1 | //!Text 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget200 extends StatelessWidget { 6 | const Widget200({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const Center( 11 | child: Padding( 12 | padding: EdgeInsets.all(15.0), 13 | child: Text( 14 | 'This is a text which is pretty long', 15 | textAlign: TextAlign.center, 16 | overflow: TextOverflow.ellipsis, 17 | style: TextStyle( 18 | fontWeight: FontWeight.bold, 19 | wordSpacing: 2, 20 | letterSpacing: 2, 21 | fontSize: 30, 22 | ), 23 | ), 24 | ), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /lib/every_widgets/text_field.dart: -------------------------------------------------------------------------------- 1 | //! TextField 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget202 extends StatefulWidget { 6 | const Widget202({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget202State(); 10 | } 11 | 12 | class _Widget202State extends State { 13 | late TextEditingController controller; 14 | String text = ''; 15 | 16 | @override 17 | void initState() { 18 | super.initState(); 19 | controller = TextEditingController(); 20 | } 21 | 22 | @override 23 | void dispose() { 24 | controller.dispose(); 25 | super.dispose(); 26 | } 27 | 28 | @override 29 | Widget build(BuildContext context) { 30 | return Center( 31 | child: Padding( 32 | padding: const EdgeInsets.all(8.0), 33 | child: Column( 34 | mainAxisSize: MainAxisSize.min, 35 | children: [ 36 | TextField( 37 | controller: controller, 38 | onSubmitted: (String value) { 39 | setState(() { 40 | text = controller.text; 41 | }); 42 | }, 43 | ), 44 | const SizedBox(height: 20), 45 | Text(text), 46 | ], 47 | ), 48 | ), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/every_widgets/text_span.dart: -------------------------------------------------------------------------------- 1 | //!TextSpan 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget204 extends StatelessWidget { 6 | const Widget204({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return const Center( 11 | child: Text.rich( 12 | TextSpan( 13 | style: TextStyle( 14 | fontSize: 25, 15 | color: Colors.blueGrey, 16 | ), 17 | text: 'Flutter ', 18 | children: [ 19 | TextSpan( 20 | text: 'to the moon!', 21 | style: TextStyle( 22 | fontWeight: FontWeight.bold, 23 | color: Colors.orangeAccent, 24 | ), 25 | ) 26 | ], 27 | ), 28 | ), 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/every_widgets/theme.dart: -------------------------------------------------------------------------------- 1 | //! Theme 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget205 extends StatelessWidget { 6 | const Widget205({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return MaterialApp( 11 | debugShowCheckedModeBanner: false, 12 | theme: ThemeData( 13 | brightness: Brightness.dark, 14 | primaryColor: Colors.orangeAccent, 15 | ), 16 | home: Scaffold( 17 | body: Container( 18 | width: double.infinity, 19 | height: double.infinity, 20 | color: Theme.of(context).colorScheme.primary, 21 | ), 22 | ), 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /lib/every_widgets/toggle_buttons.dart: -------------------------------------------------------------------------------- 1 | //! toggle buttons 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget206 extends StatefulWidget { 6 | const Widget206({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget206State(); 10 | } 11 | 12 | class _Widget206State extends State { 13 | List isSelected = [ 14 | false, 15 | false, 16 | false, 17 | ]; 18 | @override 19 | Widget build(BuildContext context) { 20 | return Center( 21 | child: ToggleButtons( 22 | children: const [ 23 | Icon(Icons.home), 24 | Icon(Icons.settings), 25 | Icon(Icons.person), 26 | ], 27 | onPressed: (int index) { 28 | setState(() { 29 | isSelected[index] = !isSelected[index]; 30 | }); 31 | }, 32 | isSelected: isSelected, 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/every_widgets/tooltip.dart: -------------------------------------------------------------------------------- 1 | //!Tooltip 2 | import 'package:flutter/material.dart'; 3 | 4 | class Widget207 extends StatelessWidget { 5 | const Widget207({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Center( 10 | child: Tooltip( 11 | message: 'This is an image', 12 | child: Image.asset('assets/icon/ocean.jpg'), 13 | ), 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lib/every_widgets/transform.dart: -------------------------------------------------------------------------------- 1 | //! Transform 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget208 extends StatelessWidget { 6 | const Widget208({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Center( 11 | child: Transform( 12 | alignment: Alignment.center, 13 | transform: Matrix4.rotationZ(45), 14 | child: Image.asset('assets/icon/ocean.jpg'), 15 | ), 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /lib/every_widgets/tween_animation_builder.dart: -------------------------------------------------------------------------------- 1 | //! TweenAnimationBuilder 2 | 3 | //? LEFT: 7! 4 | 5 | import 'package:flutter/material.dart'; 6 | 7 | class Widget209 extends StatefulWidget { 8 | const Widget209({Key? key}) : super(key: key); 9 | 10 | @override 11 | State createState() => _Widget209State(); 12 | } 13 | 14 | class _Widget209State extends State { 15 | double targetValue = 100; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Center( 20 | child: TweenAnimationBuilder( 21 | tween: Tween(begin: 0, end: targetValue), 22 | duration: const Duration(milliseconds: 500), 23 | builder: (BuildContext context, double size, Widget? child) { 24 | return IconButton( 25 | iconSize: size, 26 | color: Colors.orangeAccent, 27 | icon: const Icon(Icons.flutter_dash), 28 | onPressed: () { 29 | setState(() { 30 | targetValue = targetValue == 100 ? 250 : 100; 31 | }); 32 | }, 33 | ); 34 | }, 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/every_widgets/value_listenable_builder.dart: -------------------------------------------------------------------------------- 1 | //! ValueListenableBuilder 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | final ValueNotifier number = ValueNotifier(0); 6 | 7 | class Widget210 extends StatelessWidget { 8 | const Widget210({Key? key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Center( 13 | child: Column( 14 | mainAxisSize: MainAxisSize.min, 15 | children: [ 16 | IconButton( 17 | onPressed: () { 18 | number.value += 1; 19 | }, 20 | icon: const Icon(Icons.add), 21 | ), 22 | const SizedBox(height: 30), 23 | ValueListenableBuilder( 24 | valueListenable: number, 25 | builder: (BuildContext context, int value, Widget? child) { 26 | return Text( 27 | '$value', 28 | style: const TextStyle(fontSize: 30), 29 | ); 30 | }, 31 | ), 32 | ], 33 | ), 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/every_widgets/vertical_divider.dart: -------------------------------------------------------------------------------- 1 | //! VerticalDivider 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget211 extends StatelessWidget { 6 | const Widget211({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Padding( 11 | padding: const EdgeInsets.all(50), 12 | child: Row( 13 | children: [ 14 | Expanded( 15 | child: Container( 16 | decoration: BoxDecoration( 17 | borderRadius: BorderRadius.circular(10), 18 | color: Colors.orangeAccent, 19 | ), 20 | ), 21 | ), 22 | const VerticalDivider( 23 | width: 40, 24 | thickness: 1, 25 | indent: 40, 26 | endIndent: 100, 27 | color: Colors.grey, 28 | ), 29 | Expanded( 30 | child: Container( 31 | decoration: BoxDecoration( 32 | borderRadius: BorderRadius.circular(10), 33 | color: Colors.orangeAccent, 34 | ), 35 | ), 36 | ), 37 | ], 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/every_widgets/visibility.dart: -------------------------------------------------------------------------------- 1 | //! Visibility 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget212 extends StatefulWidget { 6 | const Widget212({Key? key}) : super(key: key); 7 | 8 | @override 9 | State createState() => _Widget212State(); 10 | } 11 | 12 | class _Widget212State extends State { 13 | bool isVisible = true; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Center( 18 | child: Column( 19 | mainAxisSize: MainAxisSize.min, 20 | children: [ 21 | TextButton( 22 | onPressed: () { 23 | setState(() { 24 | isVisible = !isVisible; 25 | }); 26 | }, 27 | child: const Text( 28 | 'Show / Hide', 29 | ), 30 | ), 31 | Image.asset( 32 | 'assets/icon/blue.jpg', 33 | width: 300, 34 | ), 35 | const SizedBox(height: 30), 36 | Visibility( 37 | visible: isVisible, 38 | child: Image.asset( 39 | 'assets/icon/ocean.jpg', 40 | width: 300, 41 | ), 42 | ), 43 | ], 44 | ), 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/every_widgets/wrap.dart: -------------------------------------------------------------------------------- 1 | //! Wrap 2 | 3 | import 'package:flutter/material.dart'; 4 | 5 | class Widget214 extends StatelessWidget { 6 | const Widget214({Key? key}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Padding( 11 | padding: const EdgeInsets.all(8.0), 12 | child: Center( 13 | child: Wrap( 14 | spacing: 10.0, 15 | runSpacing: 5.0, 16 | children: List.generate( 17 | 10, 18 | (index) => const Chip( 19 | avatar: CircleAvatar( 20 | backgroundColor: Colors.orangeAccent, 21 | child: Icon(Icons.person), 22 | ), 23 | label: Text('Mapp'), 24 | ), 25 | ), 26 | ), 27 | ), 28 | ); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'every_widgets/about_dialog.dart'; 4 | 5 | const Color darkBlue = Color(0xFF12202F); 6 | 7 | void main() { 8 | runApp(const MyApp()); 9 | } 10 | 11 | class MyApp extends StatelessWidget { 12 | const MyApp({Key? key}) : super(key: key); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return MaterialApp( 17 | theme: ThemeData.dark().copyWith(scaffoldBackgroundColor: darkBlue), 18 | debugShowCheckedModeBanner: false, 19 | title: 'Every Flutter Widget', 20 | home: Scaffold( 21 | appBar: AppBar( 22 | title: const Text('Flutter Mapp'), 23 | ), 24 | //! Just change the Widget001 for the Widget you want. 25 | body: const Widget001(), 26 | ), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | 9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 10 | } 11 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = the_widgets 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.theWidgets 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /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 in the flutter_test package. 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:the_widgets/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /the_widgets.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/web/favicon.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/web/icons/Icon-512.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "the_widgets", 3 | "short_name": "the_widgets", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void RegisterPlugins(flutter::PluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Disable Windows macros that collide with C++ standard library functions. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 25 | 26 | # Add dependency libraries and include directories. Add any application-specific 27 | # dependencies here. 28 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 29 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 30 | 31 | # Run the Flutter tool portions of the build. This must not be removed. 32 | add_dependencies(${BINARY_NAME} flutter_assemble) 33 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fluttermapp/flutter_widgets/7eb8a38ce1d720edeb7dcd10bfd36a63c64e88a7/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | --------------------------------------------------------------------------------