Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
54 changes: 29 additions & 25 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,57 +1,61 @@
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = '1'
flutterVersionCode = "1"
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
flutterVersionName = '1.0'
flutterVersionName = "1.0"
}

apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28

lintOptions {
disable 'InvalidPackage'
namespace = "com.example.example"
compileSdk = 34
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.example"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
applicationId = "com.example.example"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk 21
targetSdk 34
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
signingConfig = signingConfigs.debug
}
}
}

flutter {
source '../..'
source = "../.."
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<activity
android:name="io.flutter.embedding.android.FlutterActivity"
android:launchMode="singleTop"
android:exported="true"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
5 changes: 3 additions & 2 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
org.gradle.jvmargs=-Xmx4G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
5 changes: 3 additions & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
30 changes: 20 additions & 10 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":$name"
project(":$name").projectDir = pluginDirectory
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}

include ":app"
13 changes: 13 additions & 0 deletions example/ios/Flutter/flutter_export_environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/reaprite/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/reaprite/Desktop/software/flutter_animated_dialog/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
32 changes: 16 additions & 16 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class _MyAppState extends State<MyApp> {
// The StatefulWidget's job is to take in some data and create a State class.
// In this case, the Widget takes a title, and creates a _MyHomePageState.
class MyHomePage extends StatefulWidget {
final String title;
final String? title;

final VoidCallback onSetting;
final VoidCallback? onSetting;

MyHomePage({Key key, this.title, this.onSetting}) : super(key: key);
MyHomePage({Key? key, this.title, this.onSetting}) : super(key: key);

@override
_MyHomePageState createState() => _MyHomePageState();
Expand All @@ -59,23 +59,23 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> {
// Whether the green box should be visible or invisible

String selectedIndexText;
String? selectedIndexText;

int selectIdx;
int? selectIdx;

String singleSelectedIndexText;
String? singleSelectedIndexText;

int selectIndex;
int? selectIndex;

String multiSelectedIndexesText;
String? multiSelectedIndexesText;

List<int> selectedIndexes;
List<int>? selectedIndexes;

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
title: Text(widget.title ?? ""),
actions: <Widget>[
IconButton(
icon: Icon(Icons.settings),
Expand Down Expand Up @@ -683,7 +683,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
ListTile(
title: Text(
"List dialog ${selectedIndexText != null && selectedIndexText.isNotEmpty ? '(index:' + selectedIndexText + ')' : ''}",
"List dialog ${selectedIndexText != null && selectedIndexText!.isNotEmpty ? '(index:' + selectedIndexText! + ')' : ''}",
),
onTap: () async {
int index = await showAnimatedDialog(
Expand Down Expand Up @@ -722,7 +722,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
ListTile(
title: Text(
"List single select${singleSelectedIndexText != null && singleSelectedIndexText.isNotEmpty ? '(index:' + singleSelectedIndexText + ')' : ''}",
"List single select${singleSelectedIndexText != null && singleSelectedIndexText!.isNotEmpty ? '(index:' + singleSelectedIndexText! + ')' : ''}",
),
onTap: () async {
int index = await showAnimatedDialog(
Expand All @@ -733,7 +733,7 @@ class _MyHomePageState extends State<MyHomePage> {
titleText: 'Title',
listType: ListType.singleSelect,
activeColor: Colors.red,
selectedIndex: selectIndex,
selectedIndex: selectIndex!,
dataList: List.generate(
20,
(index) {
Expand All @@ -759,7 +759,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
ListTile(
title: Text(
"List multiple select${multiSelectedIndexesText != null && multiSelectedIndexesText.isNotEmpty ? '(index:' + multiSelectedIndexesText + ')' : ''}",
"List multiple select${multiSelectedIndexesText != null && multiSelectedIndexesText!.isNotEmpty ? '(index:' + multiSelectedIndexesText! + ')' : ''}",
),
onTap: () async {
List<int> indexes = await showAnimatedDialog(
Expand All @@ -769,7 +769,7 @@ class _MyHomePageState extends State<MyHomePage> {
return ClassicListDialogWidget<ListDataModel>(
titleText: 'Title',
listType: ListType.multiSelect,
selectedIndexes: selectedIndexes,
selectedIndexes: selectedIndexes!,
activeColor: Colors.green,
dataList: List.generate(
20,
Expand All @@ -788,7 +788,7 @@ class _MyHomePageState extends State<MyHomePage> {
print('selectedIndex:${selectedIndexes?.toString()}');
setState(() {
this.multiSelectedIndexesText =
selectedIndexes != null && selectedIndexes.length > 0
selectedIndexes != null && selectedIndexes!.length > 0
? selectedIndexes.toString()
: '';
});
Expand Down
2 changes: 1 addition & 1 deletion example/lib/model/list_data_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ListDataModel {
///Value
String value;

ListDataModel({this.name, this.value});
ListDataModel({required this.name, required this.value});

@override
String toString() {
Expand Down
Loading