Browse Source

fix display issue

zulfahmi93-master
张兴洋 2 years ago
parent
commit
30ac0ee60f
  1. 2
      example/android/app/build.gradle
  2. 2
      example/android/build.gradle
  3. 2
      example/lib/main.dart
  4. 4
      lib/src/dialogs.dart
  5. 23
      lib/src/pickers.dart

2
example/android/app/build.gradle

@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 30
compileSdkVersion 31
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8

2
example/android/build.gradle

@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.6.20'
repositories {
google()
mavenCentral()

2
example/lib/main.dart

@ -83,7 +83,7 @@ class _MyHomePageState extends State<MyHomePage> {
context: context,
initialDate: _selected ?? DateTime.now(),
firstDate: DateTime(2019),
lastDate: DateTime(2022),
lastDate: DateTime(2025),
locale: localeObj,
);
// final selected = await showDatePicker(

4
lib/src/dialogs.dart

@ -127,8 +127,8 @@ class _MonthYearPickerDialogState extends State<MonthYearPickerDialog> {
final orientation = MediaQuery.of(context).orientation;
final offset =
Theme.of(context).materialTapTargetSize == MaterialTapTargetSize.padded
? const Offset(0.0, 24.0)
: Offset.zero;
? Offset.zero
: const Offset(0.0, 24.0) ;
switch (orientation) {
case Orientation.portrait:
return _portraitDialogSize + offset;

23
lib/src/pickers.dart

@ -357,18 +357,21 @@ class _Button extends StatelessWidget {
? colorScheme.secondary
: colorScheme.onSurface;
return TextButton(
onPressed: isEnabled ? onPressed : null,
style: TextButton.styleFrom(
backgroundColor: buttonBackground,
primary: buttonText,
onSurface: buttonText,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100.0),
return Padding(
padding: const EdgeInsets.all(8.0),
child: TextButton(
onPressed: isEnabled ? onPressed : null,
style: TextButton.styleFrom(
backgroundColor: buttonBackground,
primary: buttonText,
onSurface: buttonText,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(100.0),
),
textStyle: TextStyle(color: buttonText),
),
textStyle: TextStyle(color: buttonText),
child: Text(label),
),
child: Text(label),
);
}
}

Loading…
Cancel
Save