mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2026-08-27 02:01:13 +00:00
chore: modernize Flutter examples — null safety, latest APIs, Kotlin DSL Gradle (#148)
* updates * Update Gradle wrapper script to fetch latest version online and allow --version override * chore(analytics_integration): migrate Gradle build scripts to Kotlin DSL Convert Groovy build files to Kotlin DSL and bump Gradle wrapper. * chore(animation_example): migrate Gradle build scripts to Kotlin DSL Convert Groovy build files to Kotlin DSL. * chore(biometrics): migrate Gradle build scripts to Kotlin DSL Convert Groovy build files to Kotlin DSL. * chore(bmi_calculator): test test body * chore(bottom_sheet): test test body * chore(custom_home_drawer): migrate Gradle build scripts to Kotlin DSL Convert Groovy build files to Kotlin DSL and bump Gradle wrapper. * chore(covid19_mobile_app): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(dropdown_button): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(enabling_splash_screen): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(expense_planner): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(firebase_crash_reporting): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(firebase_google_authentication): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(flutter_date_pickers-master): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(getx_counter_app): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(google_signin): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(grid_layout): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(handling_routes): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(image_editor): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(image_from_network): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(infinite_list): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(load_local_image): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(load_local_json): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(lunch_app): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(navigation_drawer): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(news_memes_app): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(persist_key_value): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(push_notifications): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(save_data_locally_with_sqlite): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(scan_qr_code): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(simple_material_app): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(sliver_app_bar_example): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(stateful_widget): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(stateless_widgets): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(statless_counter_app): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(tic_tac_toe): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(tip_calculator): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(todo_list_using_provider): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(unit_testing): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(using_alert_dialog): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_bottom_nav_bar): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_custom_fonts): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_edittext): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_expansionpanel): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(using_firebase_db): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(using_gradient): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_http_get): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_interactiveviewer): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(using_listview): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_listwheelscrollview): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(using_platform_adaptive): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore(using_snackbar): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_stepper): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_tabs): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(using_theme): remove legacy nested android project Delete the redundant nested android/ project directory from the old layout. Also update pubspec.yaml SDK constraints and dependencies. * chore(view_pdf_file): migrate Gradle build scripts to Kotlin DSL Convert Groovy build.gradle/settings.gradle to Kotlin DSL and bump Gradle wrapper. * chore: ignore .trash directory * chore: remove IDE configs and PR template * chore(infinite_list): remove legacy nested android project * refactor(infinite_list): migrate theme to ColorScheme API * refactor(using_theme): migrate to ColorScheme API * refactor(analytics_integration): migrate Firebase Analytics API * refactor(firebase_google_authentication): migrate Google Sign-In API * refactor(covid19_mobile_app): migrate theme and buttons to current API * refactor(covid19_mobile_app): replace bezier_chart with fl_chart * refactor(image_editor): migrate image plugins and button styles * refactor(scan_qr_code): migrate mobile_scanner API * refactor(lunch_app): migrate to null safety * refactor(todo_list_using_provider): migrate to null safety * refactor(unit_testing): migrate to null safety * refactor(using_firebase_db): migrate Firebase Database API * fix(update_gradle_wrapper): edit gradle-wrapper.properties directly * refactor(push_notifications): migrate Firebase Messaging API * refactor(using_http_get): migrate to null safety * refactor(using_listview): migrate to null safety * refactor(using_listwheelscrollview): migrate to null safety * refactor(view_pdf_file): migrate to null safety * refactor(bottom_sheet): migrate to null safety * refactor(stateless_widgets): migrate to null safety * chore: regenerate Gradle wrapper * refactor: move maintenance scripts to Makefile * chore: remove generated and IDE files * fix: migrate image_editor to current plugins * fix: migrate news_memes_app share to share_plus * fix: migrate view_pdf_file to syncfusion pdf viewer * fix: update deprecated APIs * style: remove commented-out code
This commit is contained in:
committed by
GitHub
parent
80fe9bed92
commit
8745f7cf5a
@@ -1,3 +1,12 @@
|
||||
analyzer:
|
||||
exclude:
|
||||
- build/**
|
||||
- android/**
|
||||
- ios/**
|
||||
- web/**
|
||||
- windows/**
|
||||
- macos/**
|
||||
- linux/**
|
||||
linter:
|
||||
rules:
|
||||
# STYLE
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
def localProperties = new Properties()
|
||||
def localPropertiesFile = rootProject.file('local.properties')
|
||||
if (localPropertiesFile.exists()) {
|
||||
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')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '1'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '1.0'
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
|
||||
lintOptions {
|
||||
disable 'InvalidPackage'
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId "com.mariamelnik.flutter_date_picker"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 28
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source '../..'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.mariamelnik.flutter_date_picker"
|
||||
compileSdk = flutter.compileSdkVersion
|
||||
ndkVersion = flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.mariamelnik.flutter_date_picker"
|
||||
minSdk = flutter.minSdkVersion
|
||||
targetSdk = flutter.targetSdkVersion
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mariamelnik.flutter_date_picker">
|
||||
>
|
||||
|
||||
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
|
||||
calls FlutterMain.startInitialization(this); in its onCreate method.
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package io.flutter.plugins;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.NonNull;
|
||||
import io.flutter.Log;
|
||||
|
||||
import io.flutter.embedding.engine.FlutterEngine;
|
||||
|
||||
/**
|
||||
* Generated file. Do not edit.
|
||||
* This file is generated by the Flutter tool based on the
|
||||
* plugins that support the Android platform.
|
||||
*/
|
||||
@Keep
|
||||
public final class GeneratedPluginRegistrant {
|
||||
private static final String TAG = "GeneratedPluginRegistrant";
|
||||
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.buildDir = '../build'
|
||||
subprojects {
|
||||
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(':app')
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
24
flutter_date_pickers-master/example/android/build.gradle.kts
Normal file
24
flutter_date_pickers-master/example/android/build.gradle.kts
Normal file
@@ -0,0 +1,24 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
val newBuildDir: Directory =
|
||||
rootProject.layout.buildDirectory
|
||||
.dir("../../build")
|
||||
.get()
|
||||
rootProject.layout.buildDirectory.value(newBuildDir)
|
||||
|
||||
subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
tasks.register<Delete>("clean") {
|
||||
delete(rootProject.layout.buildDirectory)
|
||||
}
|
||||
@@ -1,2 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx1536M
|
||||
android.enableR8=true
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.newDsl=false
|
||||
android.builtInKotlin=false
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
include ':app'
|
||||
|
||||
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
|
||||
|
||||
def plugins = new Properties()
|
||||
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
|
||||
if (pluginsFile.exists()) {
|
||||
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
|
||||
}
|
||||
|
||||
plugins.each { name, path ->
|
||||
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
|
||||
include ":$name"
|
||||
project(":$name").projectDir = pluginDirectory
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
pluginManagement {
|
||||
val flutterSdkPath =
|
||||
run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "9.1.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.2.20" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
@@ -0,0 +1,15 @@
|
||||
// This is a generated file; do not edit or check into version control.
|
||||
FLUTTER_ROOT=/opt/homebrew/share/flutter
|
||||
FLUTTER_APPLICATION_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/flutter_date_pickers-master/example
|
||||
FLUTTER_FRAMEWORK_SWIFT_PACKAGE_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/flutter_date_pickers-master/example/ios/Flutter/ephemeral/Packages/.packages/FlutterFramework
|
||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
||||
FLUTTER_TARGET=lib/main.dart
|
||||
FLUTTER_BUILD_DIR=build
|
||||
FLUTTER_BUILD_NAME=1.0.0
|
||||
FLUTTER_BUILD_NUMBER=1
|
||||
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
|
||||
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
|
||||
DART_OBFUSCATION=false
|
||||
TRACK_WIDGET_CREATION=true
|
||||
TREE_SHAKE_ICONS=false
|
||||
PACKAGE_CONFIG=.dart_tool/package_config.json
|
||||
@@ -0,0 +1,32 @@
|
||||
#
|
||||
# Generated file, do not edit.
|
||||
#
|
||||
|
||||
import lldb
|
||||
|
||||
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
|
||||
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
|
||||
base = frame.register["x0"].GetValueAsAddress()
|
||||
page_len = frame.register["x1"].GetValueAsUnsigned()
|
||||
|
||||
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
|
||||
# first page to see if handled it correctly. This makes diagnosing
|
||||
# misconfiguration (e.g. missing breakpoint) easier.
|
||||
data = bytearray(page_len)
|
||||
data[0:8] = b'IHELPED!'
|
||||
|
||||
error = lldb.SBError()
|
||||
frame.GetThread().GetProcess().WriteMemory(base, data, error)
|
||||
if not error.Success():
|
||||
print(f'Failed to write into {base}[+{page_len}]', error)
|
||||
return
|
||||
|
||||
def __lldb_init_module(debugger: lldb.SBDebugger, _):
|
||||
target = debugger.GetDummyTarget()
|
||||
# Caveat: must use BreakpointCreateByRegEx here and not
|
||||
# BreakpointCreateByName. For some reasons callback function does not
|
||||
# get carried over from dummy target for the later.
|
||||
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
|
||||
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
|
||||
bp.SetAutoContinue(True)
|
||||
print("-- LLDB integration loaded --")
|
||||
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Generated file, do not edit.
|
||||
#
|
||||
|
||||
command script import --relative-to-command-file flutter_lldb_helper.py
|
||||
@@ -0,0 +1,12 @@
|
||||
FLUTTER_ROOT=/opt/homebrew/share/flutter
|
||||
FLUTTER_APPLICATION_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/flutter_date_pickers-master/example
|
||||
FLUTTER_FRAMEWORK_SWIFT_PACKAGE_PATH=/Users/nishantsrivastava/Personal/Workspaces/github/flutter/flutter-examples/flutter_date_pickers-master/example/ios/Flutter/ephemeral/Packages/.packages/FlutterFramework
|
||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
||||
FLUTTER_TARGET=lib/main.dart
|
||||
FLUTTER_BUILD_DIR=build
|
||||
FLUTTER_BUILD_NAME=1.0.0
|
||||
FLUTTER_BUILD_NUMBER=1
|
||||
DART_OBFUSCATION=false
|
||||
TRACK_WIDGET_CREATION=true
|
||||
TREE_SHAKE_ICONS=false
|
||||
PACKAGE_CONFIG=.dart_tool/package_config.json
|
||||
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// Generated file. Do not edit.
|
||||
//
|
||||
|
||||
// clang-format off
|
||||
|
||||
#ifndef GeneratedPluginRegistrant_h
|
||||
#define GeneratedPluginRegistrant_h
|
||||
|
||||
#import <Flutter/Flutter.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface GeneratedPluginRegistrant : NSObject
|
||||
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
#endif /* GeneratedPluginRegistrant_h */
|
||||
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// Generated file. Do not edit.
|
||||
//
|
||||
|
||||
// clang-format off
|
||||
|
||||
#import "GeneratedPluginRegistrant.h"
|
||||
|
||||
@implementation GeneratedPluginRegistrant
|
||||
|
||||
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -34,10 +34,10 @@ class _DayPickerPageState extends State<DayPickerPage> {
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
|
||||
Color? bodyTextColor = Theme.of(context).accentTextTheme.bodyText1?.color;
|
||||
Color? bodyTextColor = Theme.of(context).textTheme.bodyLarge?.color;
|
||||
if (bodyTextColor != null) selectedDateStyleColor = bodyTextColor;
|
||||
|
||||
selectedSingleDateDecorationColor = Theme.of(context).accentColor;
|
||||
selectedSingleDateDecorationColor = Theme.of(context).colorScheme.secondary;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -45,8 +45,8 @@ class _DayPickerPageState extends State<DayPickerPage> {
|
||||
// add selected colors to default settings
|
||||
dp.DatePickerRangeStyles styles = dp.DatePickerRangeStyles(
|
||||
selectedDateStyle: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.bodyText1
|
||||
.textTheme
|
||||
.bodyLarge
|
||||
?.copyWith(color: selectedDateStyleColor),
|
||||
selectedSingleDateDecoration: BoxDecoration(
|
||||
color: selectedSingleDateDecorationColor,
|
||||
@@ -89,7 +89,7 @@ class _DayPickerPageState extends State<DayPickerPage> {
|
||||
children: <Widget>[
|
||||
Text(
|
||||
"Selected date styles",
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
||||
|
||||
@@ -45,10 +45,10 @@ class _DaysPickerPageState extends State<DaysPickerPage> {
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
|
||||
Color? bodyTextColor = Theme.of(context).accentTextTheme.bodyText1?.color;
|
||||
Color? bodyTextColor = Theme.of(context).textTheme.bodyLarge?.color;
|
||||
if (bodyTextColor != null) selectedDateStyleColor = bodyTextColor;
|
||||
|
||||
selectedSingleDateDecorationColor = Theme.of(context).accentColor;
|
||||
selectedSingleDateDecorationColor = Theme.of(context).colorScheme.secondary;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -56,8 +56,8 @@ class _DaysPickerPageState extends State<DaysPickerPage> {
|
||||
// add selected colors to default settings
|
||||
dp.DatePickerRangeStyles styles = dp.DatePickerRangeStyles(
|
||||
selectedDateStyle: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.bodyText1
|
||||
.textTheme
|
||||
.bodyLarge
|
||||
?.copyWith(color: selectedDateStyleColor),
|
||||
selectedSingleDateDecoration: BoxDecoration(
|
||||
color: selectedSingleDateDecorationColor, shape: BoxShape.circle));
|
||||
@@ -92,7 +92,7 @@ class _DaysPickerPageState extends State<DaysPickerPage> {
|
||||
children: <Widget>[
|
||||
Text(
|
||||
"Selected date styles",
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
||||
|
||||
@@ -22,10 +22,10 @@ class _MonthPickerPageState extends State<MonthPickerPage> {
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
|
||||
Color? bodyTextColor = Theme.of(context).accentTextTheme.bodyText1?.color;
|
||||
Color? bodyTextColor = Theme.of(context).textTheme.bodyLarge?.color;
|
||||
if (bodyTextColor != null) selectedDateStyleColor = bodyTextColor;
|
||||
|
||||
selectedSingleDateDecorationColor = Theme.of(context).accentColor;
|
||||
selectedSingleDateDecorationColor = Theme.of(context).colorScheme.secondary;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -33,8 +33,8 @@ class _MonthPickerPageState extends State<MonthPickerPage> {
|
||||
// add selected colors to default settings
|
||||
dp.DatePickerStyles styles = dp.DatePickerStyles(
|
||||
selectedDateStyle: Theme.of(context)
|
||||
.accentTextTheme
|
||||
.bodyText1
|
||||
.textTheme
|
||||
.bodyLarge
|
||||
?.copyWith(color: selectedDateStyleColor),
|
||||
selectedSingleDateDecoration: BoxDecoration(
|
||||
color: selectedSingleDateDecorationColor, shape: BoxShape.circle));
|
||||
@@ -62,7 +62,7 @@ class _MonthPickerPageState extends State<MonthPickerPage> {
|
||||
children: <Widget>[
|
||||
Text(
|
||||
"Selected date styles",
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 12.0),
|
||||
|
||||
@@ -37,9 +37,9 @@ class _RangePickerPageState extends State<RangePickerPage> {
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
|
||||
selectedPeriodLastColor = Theme.of(context).accentColor;
|
||||
selectedPeriodMiddleColor = Theme.of(context).accentColor;
|
||||
selectedPeriodStartColor = Theme.of(context).accentColor;
|
||||
selectedPeriodLastColor = Theme.of(context).colorScheme.secondary;
|
||||
selectedPeriodMiddleColor = Theme.of(context).colorScheme.secondary;
|
||||
selectedPeriodStartColor = Theme.of(context).colorScheme.secondary;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -92,7 +92,7 @@ class _RangePickerPageState extends State<RangePickerPage> {
|
||||
children: <Widget>[
|
||||
Text(
|
||||
"Selected date styles",
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
_stylesBlock(),
|
||||
_selectedBlock()
|
||||
|
||||
@@ -46,9 +46,9 @@ class _RangePickerPageStyledState extends State<RangePickerPageStyled> {
|
||||
super.didChangeDependencies();
|
||||
|
||||
// defaults for styles
|
||||
selectedPeriodLastColor = Theme.of(context).accentColor;
|
||||
selectedPeriodMiddleColor = Theme.of(context).accentColor;
|
||||
selectedPeriodStartColor = Theme.of(context).accentColor;
|
||||
selectedPeriodLastColor = Theme.of(context).colorScheme.secondary;
|
||||
selectedPeriodMiddleColor = Theme.of(context).colorScheme.secondary;
|
||||
selectedPeriodStartColor = Theme.of(context).colorScheme.secondary;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -120,7 +120,7 @@ class _RangePickerPageStyledState extends State<RangePickerPageStyled> {
|
||||
children: <Widget>[
|
||||
Text(
|
||||
"Selected date styles",
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
_selectedBlock()
|
||||
],
|
||||
|
||||
@@ -35,9 +35,9 @@ class _WeekPickerPageState extends State<WeekPickerPage> {
|
||||
super.didChangeDependencies();
|
||||
|
||||
// defaults for styles
|
||||
selectedPeriodLastColor = Theme.of(context).accentColor;
|
||||
selectedPeriodMiddleColor = Theme.of(context).accentColor;
|
||||
selectedPeriodStartColor = Theme.of(context).accentColor;
|
||||
selectedPeriodLastColor = Theme.of(context).colorScheme.secondary;
|
||||
selectedPeriodMiddleColor = Theme.of(context).colorScheme.secondary;
|
||||
selectedPeriodStartColor = Theme.of(context).colorScheme.secondary;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -84,7 +84,7 @@ class _WeekPickerPageState extends State<WeekPickerPage> {
|
||||
children: <Widget>[
|
||||
Text(
|
||||
"Selected date styles",
|
||||
style: Theme.of(context).textTheme.subtitle1,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
_stylesBlock(),
|
||||
_selectedBlock()
|
||||
@@ -229,7 +229,7 @@ class _WeekPickerPageState extends State<WeekPickerPage> {
|
||||
|
||||
TextStyle? whiteText = Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText2
|
||||
.bodyMedium
|
||||
?.copyWith(color: Colors.white);
|
||||
|
||||
return isEventDate
|
||||
|
||||
@@ -81,7 +81,7 @@ class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin {
|
||||
data: Theme.of(context).copyWith(
|
||||
canvasColor: Colors.blueGrey,
|
||||
textTheme: Theme.of(context).textTheme.copyWith(
|
||||
caption: TextStyle(color: Colors.white.withOpacity(0.5)))),
|
||||
bodySmall: TextStyle(color: Colors.white.withOpacity(0.5)))),
|
||||
child: BottomNavigationBar(
|
||||
type: BottomNavigationBarType.fixed,
|
||||
items: [
|
||||
|
||||
@@ -5,58 +5,66 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.5.0"
|
||||
version: "2.13.1"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "5bbf32bc9e518d41ec49718e2931cd4527292c9b0c6d2dffcf7fe6b9a8a8cf72"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.4.1"
|
||||
charcode:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: charcode
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "8e36feea6de5ea69f2199f29cf42a450a855738c498b57c0b980e2d3cca9c362"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
version: "1.1.2"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.15.0"
|
||||
version: "1.19.1"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: cupertino_icons
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: caac504f942f41dfadcf45229ce8c47065b93919a12739f20d6173a883c5ec73
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.2"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.3.3"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -68,7 +76,7 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.2.3+1"
|
||||
version: "0.2.4"
|
||||
flutter_localizations:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -77,12 +85,11 @@ packages:
|
||||
flutter_material_color_picker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: HEAD
|
||||
resolved-ref: "286596b1e0167877bcdb87011bff77364338ba57"
|
||||
url: "git://github.com/Bwolfs2/flutter_material_color_picker.git"
|
||||
source: git
|
||||
version: "1.0.5-nullsafety.0"
|
||||
name: flutter_material_color_picker
|
||||
sha256: ca1e7749d228c9155ea24bce98e647cdbffa350e6f334f6c001f841cd3d9c987
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@@ -92,90 +99,135 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: intl
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "1ca20c894b1717686a2319b8548763d812bc0aabdac580420a44c5178c57a867"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.17.0"
|
||||
version: "0.20.3"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.0.2"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.10"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.10"
|
||||
version: "0.12.20"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.13.0"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "307249ce4ff29d58a18e97f6345f539382eb9c9c29ecda628900f31de0443dd9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.19.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
version: "1.9.1"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
version: "0.0.0"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: f4b22294de9a549967d0033d4f30fcad4f0afc200f4bf58e82d815725feec70c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.0"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.12.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.4"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: dd11571b8a03f7cadcf91ec26a77e02bfbd6bbba2a512924d3116646b4198fc4
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.0"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: a88162591b02c1f3a3db3af8ce1ea2b374bd75a7bb8d5e353bcfbdc79d719830
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.19"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "0.7.12"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
sha256: f36f9f3be64c6198714492bb455c11056e33e2f85d9a0b676a48301e44fdcf47
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.4.2"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "15.2.0"
|
||||
sdks:
|
||||
dart: ">=2.12.0 <3.0.0"
|
||||
dart: ">=3.11.0-0 <4.0.0"
|
||||
flutter: ">=3.18.0-18.0.pre.54"
|
||||
|
||||
@@ -21,10 +21,7 @@ dependencies:
|
||||
sdk: flutter
|
||||
flutter_localizations:
|
||||
sdk: flutter
|
||||
flutter_material_color_picker:
|
||||
# null-safety fork
|
||||
git:
|
||||
url: git://github.com/Bwolfs2/flutter_material_color_picker.git
|
||||
flutter_material_color_picker: ^1.1.0
|
||||
flutter_date_pickers:
|
||||
path: ../
|
||||
|
||||
|
||||
@@ -84,18 +84,18 @@ class DatePickerStyles {
|
||||
/// Return new [DatePickerStyles] object where fields
|
||||
/// with null values set with defaults from theme.
|
||||
DatePickerStyles fulfillWithTheme(ThemeData theme) {
|
||||
Color accentColor = theme.accentColor;
|
||||
Color accentColor = theme.colorScheme.secondary;
|
||||
|
||||
TextStyle? _displayedPeriodTitle =
|
||||
displayedPeriodTitle ?? theme.textTheme.subtitle1;
|
||||
displayedPeriodTitle ?? theme.textTheme.titleMedium;
|
||||
TextStyle? _currentDateStyle = currentDateStyle ??
|
||||
theme.textTheme.bodyText1?.copyWith(color: theme.accentColor);
|
||||
theme.textTheme.bodyLarge?.copyWith(color: theme.colorScheme.secondary);
|
||||
TextStyle? _disabledDateStyle = disabledDateStyle ??
|
||||
theme.textTheme.bodyText2?.copyWith(color: theme.disabledColor);
|
||||
theme.textTheme.bodyMedium?.copyWith(color: theme.disabledColor);
|
||||
TextStyle? _selectedDateStyle =
|
||||
selectedDateStyle ?? theme.accentTextTheme.bodyText1;
|
||||
selectedDateStyle ?? theme.textTheme.bodyLarge;
|
||||
TextStyle? _defaultDateTextStyle =
|
||||
defaultDateTextStyle ?? theme.textTheme.bodyText2;
|
||||
defaultDateTextStyle ?? theme.textTheme.bodyMedium;
|
||||
BoxDecoration _selectedSingleDateDecoration =
|
||||
selectedSingleDateDecoration ??
|
||||
BoxDecoration(
|
||||
@@ -104,7 +104,7 @@ class DatePickerStyles {
|
||||
|
||||
DayHeaderStyle? _dayHeaderStyle = dayHeaderStyle;
|
||||
if (dayHeaderStyleBuilder == null && _dayHeaderStyle == null) {
|
||||
_dayHeaderStyle = DayHeaderStyle(textStyle: theme.textTheme.caption);
|
||||
_dayHeaderStyle = DayHeaderStyle(textStyle: theme.textTheme.bodySmall);
|
||||
}
|
||||
|
||||
return DatePickerStyles(
|
||||
@@ -142,7 +142,7 @@ class DatePickerStyles {
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
hashValues(
|
||||
Object.hash(
|
||||
displayedPeriodTitle,
|
||||
currentDateStyle,
|
||||
disabledDateStyle,
|
||||
@@ -210,7 +210,7 @@ class DatePickerRangeStyles extends DatePickerStyles {
|
||||
/// where fields with null values set with defaults from given theme.
|
||||
@override
|
||||
DatePickerRangeStyles fulfillWithTheme(ThemeData theme) {
|
||||
Color accentColor = theme.accentColor;
|
||||
Color accentColor = theme.colorScheme.secondary;
|
||||
|
||||
DatePickerStyles commonStyles = super.fulfillWithTheme(theme);
|
||||
|
||||
@@ -328,7 +328,7 @@ class DatePickerRangeStyles extends DatePickerStyles {
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
hashValues(
|
||||
Object.hash(
|
||||
selectedPeriodStartDecoration,
|
||||
selectedPeriodStartTextStyle,
|
||||
selectedPeriodLastDecoration,
|
||||
@@ -353,7 +353,7 @@ class DatePickerRangeStyles extends DatePickerStyles {
|
||||
/// User styles for the day header in date picker.
|
||||
@immutable
|
||||
class DayHeaderStyle {
|
||||
/// If null - textTheme.caption from the Theme will be used.
|
||||
/// If null - textTheme.bodySmall from the Theme will be used.
|
||||
final TextStyle? textStyle;
|
||||
|
||||
/// If null - no decoration will be applied for the day header;
|
||||
@@ -379,7 +379,7 @@ class DayHeaderStyle {
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => hashValues(
|
||||
int get hashCode => Object.hash(
|
||||
textStyle,
|
||||
decoration
|
||||
);
|
||||
|
||||
@@ -12,10 +12,10 @@ class DayBasedChangeablePickerPresenter {
|
||||
|
||||
/// Last date user can select.
|
||||
final DateTime lastDate;
|
||||
|
||||
|
||||
/// Localization.
|
||||
final MaterialLocalizations localizations;
|
||||
|
||||
|
||||
/// If empty day cells before 1st day of showing month should be filled with
|
||||
/// date from the last week of the previous month.
|
||||
final bool showPrevMonthDates;
|
||||
@@ -23,11 +23,11 @@ class DayBasedChangeablePickerPresenter {
|
||||
/// If empty day cells after last day of showing month should be filled with
|
||||
/// date from the first week of the next month.
|
||||
final bool showNextMonthDates;
|
||||
|
||||
|
||||
/// Index of the first day in week.
|
||||
/// 0 is Sunday, 6 is Saturday.
|
||||
final int firstDayOfWeekIndex;
|
||||
|
||||
|
||||
/// View model stream for the [DayBasedChangeablePicker].
|
||||
Stream<DayBasedChangeablePickerState> get data => _controller.stream;
|
||||
|
||||
@@ -35,26 +35,18 @@ class DayBasedChangeablePickerPresenter {
|
||||
DayBasedChangeablePickerState? get lastVal => _lastVal;
|
||||
|
||||
/// Creates presenter to use for [DayBasedChangeablePicker].
|
||||
DayBasedChangeablePickerPresenter({
|
||||
required this.firstDate,
|
||||
required this.lastDate,
|
||||
required this.localizations,
|
||||
required this.showPrevMonthDates,
|
||||
required this.showNextMonthDates,
|
||||
int? firstDayOfWeekIndex
|
||||
}): firstDayOfWeekIndex = firstDayOfWeekIndex
|
||||
?? localizations.firstDayOfWeekIndex;
|
||||
DayBasedChangeablePickerPresenter(
|
||||
{required this.firstDate,
|
||||
required this.lastDate,
|
||||
required this.localizations,
|
||||
required this.showPrevMonthDates,
|
||||
required this.showNextMonthDates,
|
||||
int? firstDayOfWeekIndex})
|
||||
: firstDayOfWeekIndex =
|
||||
firstDayOfWeekIndex ?? localizations.firstDayOfWeekIndex;
|
||||
|
||||
/// Update state according to the [selectedDate] if it needs.
|
||||
void setSelectedDate(DateTime selectedDate) {
|
||||
// bool firstAndLastNotNull = _firstShownDate != null
|
||||
// && _lastShownDate != null;
|
||||
//
|
||||
// bool selectedOnCurPage = firstAndLastNotNull
|
||||
// && !selectedDate.isBefore(_firstShownDate)
|
||||
// && !selectedDate.isAfter(_lastShownDate);
|
||||
// if (selectedOnCurPage) return;
|
||||
|
||||
changeMonth(selectedDate);
|
||||
}
|
||||
|
||||
@@ -76,19 +68,19 @@ class DayBasedChangeablePickerPresenter {
|
||||
|
||||
/// Update state to change month to the [newMonth].
|
||||
void changeMonth(DateTime newMonth) {
|
||||
bool sameMonth = _lastVal != null
|
||||
&& DatePickerUtils.sameMonth(_lastVal!.currentMonth, newMonth);
|
||||
bool sameMonth = _lastVal != null &&
|
||||
DatePickerUtils.sameMonth(_lastVal!.currentMonth, newMonth);
|
||||
if (sameMonth) return;
|
||||
|
||||
int monthPage = DatePickerUtils.monthDelta(firstDate, newMonth);
|
||||
DateTime prevMonth = DatePickerUtils
|
||||
.addMonthsToMonthDate(firstDate, monthPage - 1);
|
||||
DateTime prevMonth =
|
||||
DatePickerUtils.addMonthsToMonthDate(firstDate, monthPage - 1);
|
||||
|
||||
DateTime curMonth = DatePickerUtils
|
||||
.addMonthsToMonthDate(firstDate, monthPage);
|
||||
DateTime curMonth =
|
||||
DatePickerUtils.addMonthsToMonthDate(firstDate, monthPage);
|
||||
|
||||
DateTime nextMonth = DatePickerUtils
|
||||
.addMonthsToMonthDate(firstDate, monthPage + 1);
|
||||
DateTime nextMonth =
|
||||
DatePickerUtils.addMonthsToMonthDate(firstDate, monthPage + 1);
|
||||
|
||||
String prevMonthStr = localizations.formatMonthYear(prevMonth);
|
||||
String curMonthStr = localizations.formatMonthYear(curMonth);
|
||||
@@ -101,9 +93,8 @@ class DayBasedChangeablePickerPresenter {
|
||||
? null
|
||||
: "${localizations.previousMonthTooltip} $prevMonthStr";
|
||||
|
||||
String? nextTooltip = isLastMonth
|
||||
? null
|
||||
: "${localizations.nextMonthTooltip} $nextMonthStr";
|
||||
String? nextTooltip =
|
||||
isLastMonth ? null : "${localizations.nextMonthTooltip} $nextMonthStr";
|
||||
|
||||
DayBasedChangeablePickerState newState = DayBasedChangeablePickerState(
|
||||
currentMonth: curMonth,
|
||||
@@ -113,14 +104,13 @@ class DayBasedChangeablePickerPresenter {
|
||||
prevTooltip: prevTooltip,
|
||||
nextTooltip: nextTooltip,
|
||||
isFirstMonth: isFirstMonth,
|
||||
isLastMonth: isLastMonth
|
||||
);
|
||||
isLastMonth: isLastMonth);
|
||||
|
||||
_updateState(newState);
|
||||
}
|
||||
|
||||
/// Closes controller.
|
||||
void dispose () {
|
||||
void dispose() {
|
||||
_controller.close();
|
||||
}
|
||||
|
||||
@@ -130,15 +120,13 @@ class DayBasedChangeablePickerPresenter {
|
||||
}
|
||||
|
||||
final StreamController<DayBasedChangeablePickerState> _controller =
|
||||
StreamController.broadcast();
|
||||
StreamController.broadcast();
|
||||
|
||||
DayBasedChangeablePickerState? _lastVal;
|
||||
}
|
||||
|
||||
|
||||
/// View Model for the [DayBasedChangeablePicker].
|
||||
class DayBasedChangeablePickerState {
|
||||
|
||||
/// Display name of the current month.
|
||||
final String curMonthDis;
|
||||
|
||||
@@ -174,4 +162,4 @@ class DayBasedChangeablePickerState {
|
||||
this.prevTooltip,
|
||||
this.nextTooltip,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ class _MonthPicker extends StatelessWidget {
|
||||
selectedDate.year == year && selectedDate.month == month;
|
||||
|
||||
BoxDecoration? decoration;
|
||||
TextStyle? itemStyle = themeData.textTheme.bodyText2;
|
||||
TextStyle? itemStyle = themeData.textTheme.bodyMedium;
|
||||
|
||||
if (isSelectedMonth) {
|
||||
itemStyle = datePickerStyles.selectedDateStyle;
|
||||
|
||||
@@ -5,50 +5,50 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: async
|
||||
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
|
||||
sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.11.0"
|
||||
version: "2.13.1"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: boolean_selector
|
||||
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
|
||||
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.2"
|
||||
characters:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: characters
|
||||
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
|
||||
sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.4.1"
|
||||
clock:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: clock
|
||||
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
|
||||
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
version: "1.1.2"
|
||||
collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: collection
|
||||
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
|
||||
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.17.2"
|
||||
version: "1.19.1"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: fake_async
|
||||
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
|
||||
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
version: "1.3.3"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
@@ -68,110 +68,135 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: intl
|
||||
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
|
||||
sha256: "1ca20c894b1717686a2319b8548763d812bc0aabdac580420a44c5178c57a867"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.18.1"
|
||||
version: "0.20.3"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.0.2"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.10"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
|
||||
sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.16"
|
||||
version: "0.12.20"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
|
||||
sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.0"
|
||||
version: "0.13.0"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
|
||||
sha256: "307249ce4ff29d58a18e97f6345f539382eb9c9c29ecda628900f31de0443dd9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.1"
|
||||
version: "1.19.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
|
||||
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.3"
|
||||
version: "1.9.1"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
version: "0.0.0"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_span
|
||||
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
|
||||
sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.10.2"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
|
||||
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.11.0"
|
||||
version: "1.12.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
|
||||
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.4"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: string_scanner
|
||||
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
||||
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.4.1"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: term_glyph
|
||||
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
|
||||
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
version: "1.2.2"
|
||||
test_api:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
|
||||
sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.0"
|
||||
version: "0.7.12"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
|
||||
sha256: f36f9f3be64c6198714492bb455c11056e33e2f85d9a0b676a48301e44fdcf47
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
web:
|
||||
version: "2.4.2"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
|
||||
name: vm_service
|
||||
sha256: "0016aef94fc66495ac78af5859181e3f3bf2026bd8eecc72b9565601e19ab360"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.1.4-beta"
|
||||
version: "15.2.0"
|
||||
sdks:
|
||||
dart: ">=3.1.0-185.0.dev <4.0.0"
|
||||
dart: ">=3.11.0-0 <4.0.0"
|
||||
flutter: ">=3.18.0-18.0.pre.54"
|
||||
|
||||
@@ -11,7 +11,7 @@ environment:
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
intl: ">=0.17.0 <1.0.0"
|
||||
intl: ">=0.20.3 <1.0.0"
|
||||
flutter_localizations:
|
||||
sdk: flutter
|
||||
|
||||
|
||||
Reference in New Issue
Block a user