Skip to content

Commit

Permalink
Update for stable channel.
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianos42 committed Mar 9, 2023
1 parent c456de9 commit b053618
Show file tree
Hide file tree
Showing 56 changed files with 49,654 additions and 46,713 deletions.
11 changes: 11 additions & 0 deletions desktop/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 4.0.0

- Update for stable channel.
- Theme option for widgets.
- New options for [Tab].
- Possibility to drag [ListTable] columns.
- Initial implementation for [DatePickerDialog].
- Initial implementation for [SelectableText].
- Initial impletmenation for [TextFormField].
- Fix progress widget styles.

## 4.0.0-dev.7

- Creates theme for linear and circular progress indicators.
Expand Down
3 changes: 3 additions & 0 deletions desktop/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ targets:
- lib/src/desktop/theme/data/list_table.dart
- lib/src/desktop/theme/dialogs/context_menu.dart
- lib/src/desktop/theme/dialogs/dialog.dart
- lib/src/desktop/theme/dialogs/message.dart
- lib/src/desktop/theme/dialogs/tooltip.dart
- lib/src/desktop/theme/input/button.dart
- lib/src/desktop/theme/input/checkbox.dart
- lib/src/desktop/theme/input/drop_down.dart
- lib/src/desktop/theme/input/hyperlink.dart
- lib/src/desktop/theme/input/radio.dart
- lib/src/desktop/theme/input/slider.dart
- lib/src/desktop/theme/input/toggle_switch.dart
- lib/src/desktop/theme/navigation/breadcrumb.dart
- lib/src/desktop/theme/navigation/nav.dart
- lib/src/desktop/theme/navigation/tab.dart
- lib/src/desktop/theme/navigation/tree.dart
Expand Down
31 changes: 13 additions & 18 deletions desktop/lib/src/desktop/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'dart:ui';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';

import 'dialogs/dialog.dart';
import 'dialogs/message.dart';
import 'icons.dart';
import 'input/button.dart';
Expand Down Expand Up @@ -372,30 +371,26 @@ class DesktopScrollBehavior extends ScrollBehavior {
/// Creates a [DesktopScrollBehavior].
const DesktopScrollBehavior({this.isAlwaysShown = true}) : super();

/// See [Scrollbar].
final bool isAlwaysShown;

/// Applies a [Scrollbar] to the child widget.
@override
Widget buildScrollbar(
BuildContext context, Widget child, ScrollableDetails details) {
switch (axisDirectionToAxis(details.direction)) {
case Axis.horizontal:
switch (getPlatform(context)) {
case TargetPlatform.linux:
case TargetPlatform.macOS:
case TargetPlatform.windows:
return Scrollbar(
child: child,
isAlwaysShown: isAlwaysShown,
controller: details.controller,
);
case TargetPlatform.android:
case TargetPlatform.fuchsia:
case TargetPlatform.iOS:
return child;
case Axis.vertical:
switch (getPlatform(context)) {
case TargetPlatform.linux:
case TargetPlatform.macOS:
case TargetPlatform.windows:
return Scrollbar(
child: child,
isAlwaysShown: isAlwaysShown,
controller: details.controller,
);
case TargetPlatform.android:
case TargetPlatform.fuchsia:
case TargetPlatform.iOS:
return child;
}
}
}
}
1 change: 0 additions & 1 deletion desktop/lib/src/desktop/data/form/date_form_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ class DateFormField extends FormField<String> {
textDirection: textDirection,
textCapitalization: TextCapitalization.none,
autofocus: autofocus,
toolbarOptions: toolbarOptions,
readOnly: readOnly,
showCursor: showCursor,
autocorrect: false,
Expand Down
1 change: 0 additions & 1 deletion desktop/lib/src/desktop/data/form/text_form_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ class TextFormField extends FormField<String> {
textDirection: textDirection,
textCapitalization: textCapitalization,
autofocus: autofocus,
toolbarOptions: toolbarOptions,
readOnly: readOnly,
showCursor: showCursor,
obscuringCharacter: obscuringCharacter,
Expand Down
19 changes: 9 additions & 10 deletions desktop/lib/src/desktop/dialogs/dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,8 @@ class Dialog extends StatelessWidget {
super.key,
this.title,
this.actions,
this.constraints,
//this.padding,
//this.dialogPadding,
this.allowScroll = true,
this.theme,
required this.body,
});

Expand All @@ -113,11 +111,11 @@ class Dialog extends StatelessWidget {
/// Widgets to be placed at the bottom right of the dialog.
final List<DialogAction>? actions;

/// The constraints for the dialog.
final BoxConstraints? constraints;

final bool allowScroll;

/// The style [DialogThemeData] of the dialog.
final DialogThemeData? theme;

static Future<T?> showDialog<T>(
BuildContext context, {
required Widget body,
Expand All @@ -127,7 +125,7 @@ class Dialog extends StatelessWidget {
bool useRootNavigator = true,
RouteSettings? routeSettings,
List<DialogAction>? actions,
BoxConstraints? constraints,
DialogThemeData? theme,
Widget? title,
bool allowScroll = true,
}) {
Expand All @@ -147,7 +145,7 @@ class Dialog extends StatelessWidget {
pageBuilder: (context, animation, secondaryAnimation) => Dialog(
body: body,
actions: actions,
constraints: constraints,
theme: theme,
title: title,
allowScroll: allowScroll,
),
Expand Down Expand Up @@ -198,12 +196,13 @@ class Dialog extends StatelessWidget {
final ThemeData themeData = Theme.of(context);
final TextTheme textTheme = themeData.textTheme;

final DialogThemeData dialogThemeData = DialogTheme.of(context);
final DialogThemeData dialogThemeData =
DialogTheme.of(context).merge(theme);

final Color backgroundColor = dialogThemeData.background!;

Widget result = Container(
constraints: constraints ?? dialogThemeData.constraints,
constraints: dialogThemeData.constraints,
color: backgroundColor,
child: Column(
mainAxisSize: MainAxisSize.min,
Expand Down
Loading

0 comments on commit b053618

Please sign in to comment.