Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow single select without an initial value #70

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
04eb80c
fix null safety
vasilich6107 Nov 12, 2021
939d3f3
Merge pull request #1 from artflutter/fix-null-safety
vasilich6107 Nov 12, 2021
05d8fce
flutter_awesome_select 6.0.1
vasilich6107 Nov 19, 2021
501ffaa
flutter_awesome_select 6.1.0-beta
vasilich6107 Dec 3, 2021
9c66d10
flutter_awesome_select 6.1.1-beta
vasilich6107 Dec 28, 2021
4be93c4
A value of type 'Color?' can't be assigned to a variable of type 'Color'
jsml Feb 7, 2022
92e29b2
Merge pull request #10 from jsml/patch-1
vasilich6107 Feb 23, 2022
bc8b8d9
example android embeding update
vasilich6107 Apr 2, 2022
8b592c5
flutter_awesome_select 6.2.0-beta
vasilich6107 May 27, 2022
8f1dbd2
license
vasilich6107 May 27, 2022
60e11bd
flutter_awesome_select 6.3.0
vasilich6107 May 27, 2022
8a435a9
flutter_awesome_select 6.4.0
vasilich6107 Jun 23, 2022
1a42956
flutter_awesome_select 6.5.0-beta
vasilich6107 Jul 28, 2022
d0640f9
Fixes issue #3 list items are not refreshed when the items’ source e.…
absar Oct 3, 2022
8ec7177
Fixes #27 A S2Filter was used after being disposed
absar Mar 21, 2023
acfd715
- fix modal scrolling throws exception
vcenturion-cbs Apr 11, 2023
e50edf4
Merge pull request #28 from absar/S2FilterIssue27
vasilich6107 Mar 3, 2024
255367d
Merge pull request #29 from vcenturion/master
vasilich6107 Mar 3, 2024
d9a73cd
Merge branch 'master' into item-refresh-issue3
vasilich6107 Mar 3, 2024
092e405
Merge pull request #23 from absar/item-refresh-issue3
vasilich6107 Mar 3, 2024
d341522
Fix #55: allow null group and subtitle
mauriziopinotti Jun 27, 2023
7d4a429
Fix #49: allow SmartSelect.single without an initial value
mauriziopinotti Oct 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,25 @@ pubspec.lock
*.iml
*.ipr
*.iws
.fvm
example/ios/.symlinks
.idea/

# Visual Studio Code related
.vscode/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/
build/
demo/build/

# Android related
**/android/**/gradle-wrapper.jar
Expand Down Expand Up @@ -56,10 +62,12 @@ pubspec.lock
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

Expand All @@ -68,4 +76,3 @@ pubspec.lock
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dart.flutterSdkPath": "/Users/vasilich/fvm/versions/3.0.1",
"editor.rulers": [

]
}
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## [Next]
* Fixes issue #3 list items are not refreshed when the items’ source e.g. a change notifier Provider sends an updated list.
* Corrects spelling mistakes in documentation.
* Fixes #27 A S2Filter was used after being disposed

## [6.5.0-beta]
* type fixes

## [6.4.0]
* fix for https://github.com/artflutter/flutter_awesome_select/issues/17

## [6.3.0]
* licence

## [6.2.0-beta]
* flutter 3

## [6.1.2-beta]
* expose more classes

## [6.1.1-beta]
* expose more classes

## [6.1.0-beta]
* fix of nullsafety. mooving to beta statge until covering the functionality with tests

## [6.0.1]
* bugfix for https://github.com/artflutter/flutter_awesome_select/issues/2

## [6.0.0]
* Null safety proper migration.

## [5.0.5] - 2021-10-23

* Fixes: #8 Unhandled Exception: A S2Choices<Abc?> was used after being disposed
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021 Akbar Pulatov
Copyright (c) 2021 ArtFlutter

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Pub Version](https://img.shields.io/pub/v/awesome_select) ![GitHub](https://img.shields.io/github/license/akbarpulatov/flutter_smart_select)
![Pub Version](https://img.shields.io/pub/v/flutter_awesome_select) ![GitHub](https://img.shields.io/github/license/akbarpulatov/flutter_smart_select)

## About

Expand Down Expand Up @@ -239,10 +239,10 @@ SmartSelect<T>.single({
String placeholder = 'Select one',

// The current value of the single choice widget.
@required T value,
required T value,

// Called when single choice value changed
@required ValueChanged<S2SingleState<T>> onChange,
required ValueChanged<S2SingleState<T>> onChange,

// choice item list
List<S2Choice<T>> choiceItems,
Expand Down Expand Up @@ -290,10 +290,10 @@ SmartSelect<T>.multiple({
String placeholder = 'Select one',

// The current value of the single choice widget.
@required List<T> value,
required List<T> value,

// Called when single choice value changed
@required ValueChanged<S2MultiState<T>> onChange,
required ValueChanged<S2MultiState<T>> onChange,

// choice item list
List<S2Choice<T>> choiceItems,
Expand Down Expand Up @@ -945,7 +945,7 @@ SmartSelect<T>.single(
...,
...,
tileBuilder: (context, state) {
return S2Tile(
return S2Tile<dynamic>(
title: state.titleWidget,
value: state.valueDisplay,
onTap: state.showModal,
Expand Down
6 changes: 6 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include: package:flutter_lints/flutter.yaml

#analyzer:
# strong-mode:
# implicit-casts: false
# implicit-dynamic: false
Binary file removed demo/build/SmartSelect.apk
Binary file not shown.
Binary file removed demo/build/qr-apk.png
Binary file not shown.
4 changes: 4 additions & 0 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#analyzer:
# strong-mode:
# implicit-casts: false
# implicit-dynamic: false
13 changes: 13 additions & 0 deletions example/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
25 changes: 13 additions & 12 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,28 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28
compileSdkVersion flutter.compileSdkVersion

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

lintOptions {
disable 'InvalidPackage'
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.davigmacode.smartselect"
minSdkVersion 16
targetSdkVersion 28
applicationId "com.davigmacode.example"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -61,7 +65,4 @@ flutter {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
2 changes: 1 addition & 1 deletion example/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.davigmacode.smartselect">
package="com.davigmacode.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
23 changes: 13 additions & 10 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.davigmacode.smartselect">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:name="io.flutter.app.FlutterApplication"
android:label="SmartSelect"
package="com.davigmacode.example">
<application
android:label="example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.davigmacode.example

import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />

<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
18 changes: 18 additions & 0 deletions example/android/app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
12 changes: 11 additions & 1 deletion example/android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.

This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
2 changes: 1 addition & 1 deletion example/android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.davigmacode.smartselect">
package="com.davigmacode.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
8 changes: 4 additions & 4 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.10'
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}

Expand Down
1 change: 0 additions & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
18 changes: 7 additions & 11 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
include ':app'

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }

plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
}
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
Loading