Update to Flutter 3

This commit is contained in:
Hillel Coren 2022-05-15 12:52:20 +03:00
parent 5629a9b861
commit 5c566033b4
9 changed files with 89 additions and 36 deletions

View File

@ -34,8 +34,7 @@ class _AppScrollbarState extends State<AppScrollbar> {
child: Scrollbar(
child: widget.child,
controller: widget.controller,
isAlwaysShown: isDesktop(context) && _isHovered,
showTrackOnHover: true,
trackVisibility: isDesktop(context) && _isHovered,
),
);
}

View File

@ -1,11 +1,11 @@
// Flutter imports:
import 'package:flutter/foundation.dart';
//import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
//import 'package:flutter/services.dart';
// Project imports:
import 'package:invoiceninja_flutter/data/models/entities.dart';
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
//import 'package:invoiceninja_flutter/data/models/entities.dart';
//import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
class AppShortcuts extends StatefulWidget {
const AppShortcuts({Key key, this.child}) : super(key: key);
@ -20,6 +20,7 @@ class AppShortcuts extends StatefulWidget {
}
class AppShortcutsState extends State<AppShortcuts> {
/*
final _shortcuts = <LogicalKeySet, _ShortcutIntent>{
LogicalKeySet(LogicalKeyboardKey.keyN, LogicalKeyboardKey.keyI):
_ShortcutIntent.create(EntityType.invoice),
@ -49,9 +50,13 @@ class AppShortcutsState extends State<AppShortcuts> {
LogicalKeySet(LogicalKeyboardKey.alt, LogicalKeyboardKey.arrowLeft):
_ShortcutIntent.back(),
};
*/
@override
Widget build(BuildContext context) {
return SizedBox();
/*
final _actions = <Type, Action<Intent>>{
_ShortcutIntent: CallbackAction<_ShortcutIntent>(
onInvoke: (_ShortcutIntent intent) {
@ -86,7 +91,6 @@ class AppShortcutsState extends State<AppShortcuts> {
),
);
/*
return FocusableActionDetector(
child: widget.child,
actions: _actions,
@ -97,6 +101,7 @@ class AppShortcutsState extends State<AppShortcuts> {
}
}
/*
class _ShortcutIntent extends Intent {
const _ShortcutIntent({this.intentType, this.entityType});
@ -119,3 +124,5 @@ enum _ShortcutIntentType {
back,
list,
}
*/

View File

@ -476,7 +476,6 @@ class AppPaginatedDataTableState extends State<AppPaginatedDataTable> {
),
*/
Scrollbar(
showTrackOnHover: true,
controller: _controller,
child: SingleChildScrollView(
controller: _controller,

View File

@ -2,6 +2,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:invoiceninja_flutter/utils/super_editor/toolbar.dart';
import 'package:super_editor/super_editor.dart';
import 'package:super_editor_markdown/super_editor_markdown.dart';
/// Example of a rich text editor.
///

View File

@ -255,7 +255,6 @@ class _EditorToolbarState extends State<EditorToolbar> {
);
}
/*
/// Returns true if the current text selection includes part
/// or all of a single link, returns false if zero links are
/// in the selection or if 2+ links are in the selection.
@ -278,7 +277,7 @@ class _EditorToolbarState extends State<EditorToolbar> {
final selectionStart = min(baseOffset, extentOffset);
final selectionEnd = max(baseOffset, extentOffset);
final selectionRange =
TextRange(start: selectionStart, end: selectionEnd - 1);
SpanRange(start: selectionStart, end: selectionEnd - 1);
final textNode =
widget.editor.document.getNodeById(selection.extent.nodeId) as TextNode;
@ -302,7 +301,7 @@ class _EditorToolbarState extends State<EditorToolbar> {
final selectionStart = min(baseOffset, extentOffset);
final selectionEnd = max(baseOffset, extentOffset);
final selectionRange =
TextRange(start: selectionStart, end: selectionEnd - 1);
SpanRange(start: selectionStart, end: selectionEnd - 1);
final textNode =
widget.editor.document.getNodeById(selection.extent.nodeId) as TextNode;
@ -337,7 +336,7 @@ class _EditorToolbarState extends State<EditorToolbar> {
// the entire link attribution.
text.removeAttribution(
overlappingLinkSpan.attribution,
TextRange(
SpanRange(
start: overlappingLinkSpan.start, end: overlappingLinkSpan.end),
);
}
@ -349,7 +348,6 @@ class _EditorToolbarState extends State<EditorToolbar> {
});
}
}
*/
/// Takes the text from the [urlController] and applies it as a link
/// attribution to the currently selected text.
@ -362,7 +360,7 @@ class _EditorToolbarState extends State<EditorToolbar> {
final selectionStart = min(baseOffset, extentOffset);
final selectionEnd = max(baseOffset, extentOffset);
final selectionRange =
TextRange(start: selectionStart, end: selectionEnd - 1);
SpanRange(start: selectionStart, end: selectionEnd - 1);
final textNode =
widget.editor.document.getNodeById(selection.extent.nodeId) as TextNode;
@ -389,7 +387,7 @@ class _EditorToolbarState extends State<EditorToolbar> {
/// Given [text] and a [range] within the [text], the [range] is
/// shortened on both sides to remove any trailing whitespace and
/// the new range is returned.
TextRange _trimTextRangeWhitespace(AttributedText text, TextRange range) {
SpanRange _trimTextRangeWhitespace(AttributedText text, SpanRange range) {
int startOffset = range.start;
int endOffset = range.end;
@ -400,7 +398,7 @@ class _EditorToolbarState extends State<EditorToolbar> {
endOffset -= 1;
}
return TextRange(start: startOffset, end: endOffset);
return SpanRange(start: startOffset, end: endOffset);
}
/*
@ -560,7 +558,6 @@ class _EditorToolbarState extends State<EditorToolbar> {
tooltip: 'Strikethrough',
),
),
/*
Center(
child: IconButton(
onPressed: _areMultipleLinksSelected() ? null : _onLinkPressed,
@ -572,7 +569,6 @@ class _EditorToolbarState extends State<EditorToolbar> {
tooltip: 'Link',
),
),
*/
// Only display alignment controls if the currently selected text
// node respects alignment. List items, for example, do not.
/*

View File

@ -8,6 +8,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_linux
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
@ -16,3 +19,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

View File

@ -21,7 +21,7 @@ packages:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.6"
version: "3.1.11"
args:
dependency: transitive
description:
@ -36,6 +36,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
attributed_text:
dependency: transitive
description:
name: attributed_text
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1"
barcode:
dependency: transitive
description:
@ -196,7 +203,7 @@ packages:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.15.0"
version: "1.16.0"
contacts_service:
dependency: "direct main"
description:
@ -217,7 +224,7 @@ packages:
name: coverage
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
version: "1.2.0"
cross_file:
dependency: transitive
description:
@ -266,7 +273,7 @@ packages:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.0"
faker:
dependency: "direct dev"
description:
@ -590,7 +597,7 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.3"
version: "0.6.4"
json_annotation:
dependency: transitive
description:
@ -646,7 +653,7 @@ packages:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
version: "0.1.4"
material_design_icons_flutter:
dependency: "direct main"
description:
@ -765,7 +772,7 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
path_parsing:
dependency: transitive
description:
@ -1110,7 +1117,7 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
version: "1.8.2"
sqflite:
dependency: transitive
description:
@ -1163,10 +1170,30 @@ packages:
super_editor:
dependency: "direct main"
description:
name: super_editor
url: "https://pub.dartlang.org"
source: hosted
path: super_editor
ref: HEAD
resolved-ref: c284ee9b0a008fd507d9cc3dae7f03078592f9eb
url: "https://github.com/superlistapp/super_editor.git"
source: git
version: "0.2.0"
super_editor_markdown:
dependency: "direct main"
description:
path: super_editor_markdown
ref: HEAD
resolved-ref: c284ee9b0a008fd507d9cc3dae7f03078592f9eb
url: "https://github.com/superlistapp/super_editor.git"
source: git
version: "0.1.0"
super_text:
dependency: transitive
description:
path: super_text
ref: HEAD
resolved-ref: c284ee9b0a008fd507d9cc3dae7f03078592f9eb
url: "https://github.com/superlistapp/super_editor.git"
source: git
version: "0.1.0"
sync_http:
dependency: transitive
description:
@ -1194,21 +1221,21 @@ packages:
name: test
url: "https://pub.dartlang.org"
source: hosted
version: "1.19.5"
version: "1.20.2"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.8"
version: "0.4.9"
test_core:
dependency: transitive
description:
name: test_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.9"
version: "0.4.11"
timeago:
dependency: "direct main"
description:
@ -1313,7 +1340,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
version: "2.1.2"
version:
dependency: "direct main"
description:
@ -1327,7 +1354,7 @@ packages:
name: vm_service
url: "https://pub.dartlang.org"
source: hosted
version: "7.5.0"
version: "8.2.2"
watcher:
dependency: transitive
description:
@ -1413,5 +1440,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=2.16.1 <3.0.0"
dart: ">=2.17.0-0 <3.0.0"
flutter: ">=2.10.0"

View File

@ -60,7 +60,15 @@ dependencies:
contacts_service: ^0.6.1
diacritic: ^0.1.3
states_rebuilder: ^5.2.0
super_editor: ^0.2.0
#super_editor: ^0.2.0
super_editor:
git:
url: https://github.com/superlistapp/super_editor.git
path: super_editor
super_editor_markdown:
git:
url: https://github.com/superlistapp/super_editor.git
path: super_editor_markdown
html2md: ^1.2.5
printing: ^5.8.0
image_cropper: ^2.0.2

View File

@ -8,6 +8,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_windows
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
@ -16,3 +19,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)