chore: upgrade flutter to 3.10.1 (#2619)

* chore: upgrade flutter and dart

* ci: upgrade flutter in cicd

* fix: remove textstyle_extensions from flowy_infra

* ci: upgrade flutter in cicd

* fix: update flutter.toml

* fix: deprecations and ffi

* fix: move json_annotation to dependencies

Must have accidentally moved it to dev_dependencies when upgrading dependencies

* fix: update editor ref and use fold

* chore: try with generate true
This commit is contained in:
Mathias Mogensen 2023-05-28 05:09:39 +01:00 committed by GitHub
parent 45d0d41830
commit cdfb634aa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
53 changed files with 478 additions and 538 deletions

View File

@ -22,7 +22,7 @@ on:
- "!frontend/appflowy_tauri/**" - "!frontend/appflowy_tauri/**"
env: env:
FLUTTER_VERSION: "3.7.5" FLUTTER_VERSION: "3.10.1"
RUST_TOOLCHAIN: "1.65" RUST_TOOLCHAIN: "1.65"
jobs: jobs:

View File

@ -35,7 +35,7 @@ jobs:
- uses: subosito/flutter-action@v2 - uses: subosito/flutter-action@v2
with: with:
channel: "stable" channel: "stable"
flutter-version: "3.7.5" flutter-version: "3.10.1"
cache: true cache: true
- name: Cache Cargo - name: Cache Cargo

View File

@ -6,7 +6,7 @@ on:
- "*" - "*"
env: env:
FLUTTER_VERSION: "3.7.5" FLUTTER_VERSION: "3.10.1"
RUST_TOOLCHAIN: "1.65" RUST_TOOLCHAIN: "1.65"
jobs: jobs:
@ -136,11 +136,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
job: job:
- { - { target: x86_64-apple-darwin, os: macos-11, extra-build-args: "" }
target: x86_64-apple-darwin,
os: macos-11,
extra-build-args: "",
}
steps: steps:
- name: Checkout source code - name: Checkout source code
uses: actions/checkout@v3 uses: actions/checkout@v3

View File

@ -22,7 +22,7 @@ on:
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: "1.65" RUST_TOOLCHAIN: "1.65"
FLUTTER_VERSION: "3.7.5" FLUTTER_VERSION: "3.10.1"
jobs: jobs:
test-on-ubuntu: test-on-ubuntu:
@ -80,7 +80,7 @@ jobs:
working-directory: shared-lib working-directory: shared-lib
- name: clippy shared-lib - name: clippy shared-lib
run: cargo clippy -- -D warnings run: cargo clippy -- -D warnings
working-directory: shared-lib working-directory: shared-lib
- name: Run shared-lib tests - name: Run shared-lib tests

View File

@ -11,7 +11,7 @@ on:
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
FLUTTER_VERSION: "3.7.5" FLUTTER_VERSION: "3.10.1"
RUST_TOOLCHAIN: "1.65" RUST_TOOLCHAIN: "1.65"
jobs: jobs:

View File

@ -118,7 +118,7 @@
{ {
"label": "AF: Generate Freezed Files", "label": "AF: Generate Freezed Files",
"type": "shell", "type": "shell",
"command": "flutter pub run build_runner build --delete-conflicting-outputs", "command": "dart run build_runner build -d",
"options": { "options": {
"cwd": "${workspaceFolder}/appflowy_flutter" "cwd": "${workspaceFolder}/appflowy_flutter"
} }

View File

@ -1,7 +1,7 @@
.PHONY: freeze_build, free_watch .PHONY: freeze_build, free_watch
freeze_build: freeze_build:
flutter pub run build_runner build --delete-conflicting-outputs dart run build_runner build -d
watch: watch:
flutter pub run build_runner watch dart run build_runner watch

View File

@ -1,6 +1,6 @@
<h1 align="center" style="margin:0"> AppFlowy_Flutter</h1> <h1 align="center" style="margin:0"> AppFlowy_Flutter</h1>
<div align="center"> <div align="center">
<img src="https://img.shields.io/badge/Flutter-v3.7.5-blue"/> <img src="https://img.shields.io/badge/Flutter-v3.10.1-blue"/>
<img src="https://img.shields.io/badge/Rust-v1.65-orange"/> <img src="https://img.shields.io/badge/Rust-v1.65-orange"/>
</div> </div>

View File

@ -58,17 +58,21 @@ class TestFolder {
extension AppFlowyTestBase on WidgetTester { extension AppFlowyTestBase on WidgetTester {
Future<void> initializeAppFlowy() async { Future<void> initializeAppFlowy() async {
const MethodChannel('hotkey_manager') TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler((MethodCall methodCall) async { .setMockMethodCallHandler(
if (methodCall.method == 'unregisterAll') { const MethodChannel('hotkey_manager'),
// do nothing (MethodCall methodCall) async {
} if (methodCall.method == 'unregisterAll') {
}); // do nothing
}
return;
},
);
await app.main(); await app.main();
await wait(3000); await wait(3000);
await pumpAndSettle(const Duration(seconds: 2)); await pumpAndSettle(const Duration(seconds: 2));
return;
} }
Future<void> tapButton( Future<void> tapButton(

View File

@ -10,32 +10,32 @@ abstract class Env {
varName: 'SUPABASE_URL', varName: 'SUPABASE_URL',
defaultValue: '', defaultValue: '',
) )
static final supabaseUrl = _Env.supabaseUrl; static final String supabaseUrl = _Env.supabaseUrl;
@EnviedField( @EnviedField(
obfuscate: true, obfuscate: true,
varName: 'SUPABASE_ANON_KEY', varName: 'SUPABASE_ANON_KEY',
defaultValue: '', defaultValue: '',
) )
static final supabaseAnonKey = _Env.supabaseAnonKey; static final String supabaseAnonKey = _Env.supabaseAnonKey;
@EnviedField( @EnviedField(
obfuscate: true, obfuscate: true,
varName: 'SUPABASE_KEY', varName: 'SUPABASE_KEY',
defaultValue: '', defaultValue: '',
) )
static final supabaseKey = _Env.supabaseKey; static final String supabaseKey = _Env.supabaseKey;
@EnviedField( @EnviedField(
obfuscate: true, obfuscate: true,
varName: 'SUPABASE_JWT_SECRET', varName: 'SUPABASE_JWT_SECRET',
defaultValue: '', defaultValue: '',
) )
static final supabaseJwtSecret = _Env.supabaseJwtSecret; static final String supabaseJwtSecret = _Env.supabaseJwtSecret;
@EnviedField( @EnviedField(
obfuscate: true, obfuscate: true,
varName: 'SUPABASE_COLLAB_TABLE', varName: 'SUPABASE_COLLAB_TABLE',
defaultValue: '', defaultValue: '',
) )
static final supabaseCollabTable = _Env.supabaseCollabTable; static final String supabaseCollabTable = _Env.supabaseCollabTable;
} }
bool get isSupabaseEnable => bool get isSupabaseEnable =>

View File

@ -5,7 +5,7 @@ import 'dart:async';
import 'package:dartz/dartz.dart'; import 'package:dartz/dartz.dart';
part 'select_option_type_option_bloc.freezed.dart'; part 'select_option_type_option_bloc.freezed.dart';
abstract class ISelectOptionAction { abstract mixin class ISelectOptionAction {
Future<List<SelectOptionPB>> Function(String) get insertOption; Future<List<SelectOptionPB>> Function(String) get insertOption;
List<SelectOptionPB> Function(SelectOptionPB) get deleteOption; List<SelectOptionPB> Function(SelectOptionPB) get deleteOption;

View File

@ -17,7 +17,7 @@ abstract class RowFieldsDelegate {
void onFieldsChanged(void Function(List<FieldInfo>) callback); void onFieldsChanged(void Function(List<FieldInfo>) callback);
} }
abstract class RowCacheDelegate { abstract mixin class RowCacheDelegate {
UnmodifiableListView<FieldInfo> get fields; UnmodifiableListView<FieldInfo> get fields;
void onRowDispose(); void onRowDispose();
} }

View File

@ -17,11 +17,11 @@ class CalendarToolbar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( return const SizedBox(
height: 40, height: 40,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: const [ children: [
_UnscheduleEventsButton(), _UnscheduleEventsButton(),
_SettingButton(), _SettingButton(),
], ],

View File

@ -62,9 +62,9 @@ class _AccessoryMenu extends StatelessWidget {
color: AFThemeExtension.of(context).toggleOffFill, color: AFThemeExtension.of(context).toggleOffFill,
), ),
const VSpace(6), const VSpace(6),
IntrinsicHeight( const IntrinsicHeight(
child: Row( child: Row(
children: const [ children: [
SortMenu(), SortMenu(),
HSpace(6), HSpace(6),
FilterMenu(), FilterMenu(),

View File

@ -157,7 +157,7 @@ class EditableRowNotifier {
} }
} }
abstract class EditableCell { abstract mixin class EditableCell {
// Each cell notifier will be bind to the [EditableRowNotifier], which enable // Each cell notifier will be bind to the [EditableRowNotifier], which enable
// the row notifier receive its cells event. For example: begin editing the // the row notifier receive its cells event. For example: begin editing the
// cell or end editing the cell. // cell or end editing the cell.

View File

@ -2,7 +2,6 @@ import 'package:appflowy/plugins/database_view/application/cell/cell_controller_
import 'package:flowy_infra_ui/style_widget/text.dart'; import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:textstyle_extensions/textstyle_extensions.dart';
import '../../row/cell_builder.dart'; import '../../row/cell_builder.dart';
import '../bloc/text_card_cell_bloc.dart'; import '../bloc/text_card_cell_bloc.dart';
import '../define.dart'; import '../define.dart';
@ -178,7 +177,10 @@ class _TextCardCellState extends State<TextCardCell> {
onChanged: (value) => focusChanged(), onChanged: (value) => focusChanged(),
onEditingComplete: () => focusNode.unfocus(), onEditingComplete: () => focusNode.unfocus(),
maxLines: null, maxLines: null,
style: Theme.of(context).textTheme.bodyMedium!.size(_fontSize()), style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(fontSize: _fontSize()),
decoration: InputDecoration( decoration: InputDecoration(
// Magic number 4 makes the textField take up the same space as FlowyText // Magic number 4 makes the textField take up the same space as FlowyText
contentPadding: EdgeInsets.symmetric( contentPadding: EdgeInsets.symmetric(

View File

@ -2,7 +2,6 @@ import 'package:appflowy/plugins/database_view/application/cell/cell_controller_
import 'package:flowy_infra/size.dart'; import 'package:flowy_infra/size.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:textstyle_extensions/textstyle_extensions.dart';
import '../bloc/url_card_cell_bloc.dart'; import '../bloc/url_card_cell_bloc.dart';
import '../define.dart'; import '../define.dart';
@ -60,12 +59,11 @@ class _URLCardCellState extends State<URLCardCell> {
textAlign: TextAlign.left, textAlign: TextAlign.left,
text: TextSpan( text: TextSpan(
text: state.content, text: state.content,
style: Theme.of(context) style: Theme.of(context).textTheme.bodyMedium!.copyWith(
.textTheme fontSize: widget.style?.fontSize ?? FontSizes.s14,
.bodyMedium! color: Theme.of(context).colorScheme.primary,
.size(widget.style?.fontSize ?? FontSizes.s14) decoration: TextDecoration.underline,
.textColor(Theme.of(context).colorScheme.primary) ),
.underline,
), ),
), ),
), ),

View File

@ -6,7 +6,7 @@ enum AccessoryType {
more, more,
} }
abstract class CardAccessory implements Widget { abstract mixin class CardAccessory implements Widget {
AccessoryType get type; AccessoryType get type;
void onTap(BuildContext context) {} void onTap(BuildContext context) {}
} }

View File

@ -41,7 +41,7 @@ class GridCellAccessoryBuilder {
} }
} }
abstract class GridCellAccessoryState { abstract mixin class GridCellAccessoryState {
void onTap(); void onTap();
// The accessory will be hidden if enable() return false; // The accessory will be hidden if enable() return false;

View File

@ -17,7 +17,6 @@ import 'package:appflowy_backend/protobuf/flowy-error/errors.pbserver.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:table_calendar/table_calendar.dart'; import 'package:table_calendar/table_calendar.dart';
import 'package:textstyle_extensions/textstyle_extensions.dart';
import '../../../../grid/presentation/layout/sizes.dart'; import '../../../../grid/presentation/layout/sizes.dart';
import '../../../../grid/presentation/widgets/common/type_option_separator.dart'; import '../../../../grid/presentation/widgets/common/type_option_separator.dart';
import '../../../../grid/presentation/widgets/header/type_option/date.dart'; import '../../../../grid/presentation/widgets/header/type_option/date.dart';
@ -198,11 +197,13 @@ class _CellCalendarWidgetState extends State<_CellCalendarWidget> {
outsideDecoration: boxDecoration, outsideDecoration: boxDecoration,
defaultTextStyle: textStyle, defaultTextStyle: textStyle,
weekendTextStyle: textStyle, weekendTextStyle: textStyle,
selectedTextStyle: selectedTextStyle: textStyle.copyWith(
textStyle.textColor(Theme.of(context).colorScheme.surface), color: Theme.of(context).colorScheme.surface,
),
todayTextStyle: textStyle, todayTextStyle: textStyle,
outsideTextStyle: outsideTextStyle: textStyle.copyWith(
textStyle.textColor(Theme.of(context).disabledColor), color: Theme.of(context).disabledColor,
),
), ),
selectedDayPredicate: (day) => isSameDay(state.dateTime, day), selectedDayPredicate: (day) => isSameDay(state.dateTime, day),
onDaySelected: (selectedDay, focusedDay) { onDaySelected: (selectedDay, focusedDay) {

View File

@ -8,7 +8,6 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:textfield_tags/textfield_tags.dart'; import 'package:textfield_tags/textfield_tags.dart';
import 'package:textstyle_extensions/textstyle_extensions.dart';
import 'extension.dart'; import 'extension.dart';
@ -126,7 +125,7 @@ class _SelectOptionTextFieldState extends State<SelectOptionTextField> {
hintStyle: Theme.of(context) hintStyle: Theme.of(context)
.textTheme .textTheme
.bodySmall! .bodySmall!
.textColor(Theme.of(context).hintColor), .copyWith(color: Theme.of(context).hintColor),
suffixText: _suffixText(), suffixText: _suffixText(),
counterText: "", counterText: "",
prefixIconConstraints: prefixIconConstraints:

View File

@ -6,7 +6,6 @@ import 'package:appflowy/plugins/document/presentation/editor_style.dart';
import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:tuple/tuple.dart';
/// Wrapper for the appflowy editor. /// Wrapper for the appflowy editor.
class AppFlowyEditorPage extends StatefulWidget { class AppFlowyEditorPage extends StatefulWidget {
@ -88,14 +87,16 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final autoFocusParameters = _computeAutoFocusParameters(); final (bool autoFocus, Selection? selection) =
_computeAutoFocusParameters();
final editor = AppFlowyEditor.custom( final editor = AppFlowyEditor.custom(
editorState: widget.editorState, editorState: widget.editorState,
editable: true, editable: true,
scrollController: scrollController, scrollController: scrollController,
// setup the auto focus parameters // setup the auto focus parameters
autoFocus: autoFocusParameters.item1, autoFocus: autoFocus,
focusedSelection: autoFocusParameters.item2, focusedSelection: selection,
// setup the theme // setup the theme
editorStyle: styleCustomizer.style(), editorStyle: styleCustomizer.style(),
// customize the block builder // customize the block builder
@ -107,7 +108,7 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
); );
return Center( return Center(
child: Container( child: ConstrainedBox(
constraints: const BoxConstraints( constraints: const BoxConstraints(
maxWidth: double.infinity, maxWidth: double.infinity,
), ),
@ -246,17 +247,17 @@ class _AppFlowyEditorPageState extends State<AppFlowyEditorPage> {
return builders; return builders;
} }
Tuple2<bool, Selection?> _computeAutoFocusParameters() { (bool, Selection?) _computeAutoFocusParameters() {
if (widget.editorState.document.isEmpty) { if (widget.editorState.document.isEmpty) {
return Tuple2(true, Selection.collapse([0], 0)); return (true, Selection.collapse([0], 0));
} }
final nodes = widget.editorState.document.root.children final nodes = widget.editorState.document.root.children
.where((element) => element.delta != null); .where((element) => element.delta != null);
final isAllEmpty = final isAllEmpty =
nodes.isNotEmpty && nodes.every((element) => element.delta!.isEmpty); nodes.isNotEmpty && nodes.every((element) => element.delta!.isEmpty);
if (isAllEmpty) { if (isAllEmpty) {
return Tuple2(true, Selection.collapse(nodes.first.path, 0)); return (true, Selection.collapse(nodes.first.path, 0));
} }
return const Tuple2(false, null); return const (false, null);
} }
} }

View File

@ -2,7 +2,6 @@ import 'package:appflowy/plugins/document/presentation/editor_plugins/base/inser
import 'package:appflowy/workspace/application/app/app_service.dart'; import 'package:appflowy/workspace/application/app/app_service.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:appflowy_editor/appflowy_editor.dart'; import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:dartz/dartz.dart' as dartz;
import 'package:flowy_infra/image.dart'; import 'package:flowy_infra/image.dart';
import 'package:flowy_infra_ui/style_widget/button.dart'; import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/style_widget/text.dart'; import 'package:flowy_infra_ui/style_widget/text.dart';
@ -66,16 +65,16 @@ class _LinkToPageMenuState extends State<LinkToPageMenu> {
EditorStyle get style => widget.editorState.editorStyle; EditorStyle get style => widget.editorState.editorStyle;
int _selectedIndex = 0; int _selectedIndex = 0;
int _totalItems = 0; int _totalItems = 0;
Future<List<dartz.Tuple2<ViewPB, List<ViewPB>>>>? _availableLayout; Future<List<(ViewPB, List<ViewPB>)>>? _availableLayout;
final Map<int, dartz.Tuple2<ViewPB, ViewPB>> _items = {}; final Map<int, (ViewPB, ViewPB)> _items = {};
Future<List<dartz.Tuple2<ViewPB, List<ViewPB>>>> fetchItems() async { Future<List<(ViewPB, List<ViewPB>)>> fetchItems() async {
final items = await AppBackendService().fetchViews(widget.layoutType); final items = await AppBackendService().fetchViews(widget.layoutType);
int index = 0; int index = 0;
for (final app in items) { for (final (app, children) in items) {
for (final view in app.value2) { for (final view in children) {
_items.putIfAbsent(index, () => dartz.Tuple2(app.value1, view)); _items.putIfAbsent(index, () => (app, view));
index += 1; index += 1;
} }
} }
@ -158,8 +157,8 @@ class _LinkToPageMenuState extends State<LinkToPageMenu> {
newSelectedIndex %= _totalItems; newSelectedIndex %= _totalItems;
} else if (event.logicalKey == LogicalKeyboardKey.enter) { } else if (event.logicalKey == LogicalKeyboardKey.enter) {
widget.onSelected( widget.onSelected(
_items[_selectedIndex]!.value1, _items[_selectedIndex]!.$1,
_items[_selectedIndex]!.value2, _items[_selectedIndex]!.$2,
); );
} }
@ -173,15 +172,15 @@ class _LinkToPageMenuState extends State<LinkToPageMenu> {
Widget _buildListWidget( Widget _buildListWidget(
BuildContext context, BuildContext context,
int selectedIndex, int selectedIndex,
Future<List<dartz.Tuple2<ViewPB, List<ViewPB>>>>? items, Future<List<(ViewPB, List<ViewPB>)>>? items,
) { ) {
int index = 0; int index = 0;
return FutureBuilder<List<dartz.Tuple2<ViewPB, List<ViewPB>>>>( return FutureBuilder<List<(ViewPB, List<ViewPB>)>>(
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData && if (snapshot.hasData &&
snapshot.connectionState == ConnectionState.done) { snapshot.connectionState == ConnectionState.done) {
final views = snapshot.data; final views = snapshot.data;
final children = <Widget>[ final List<Widget> children = [
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 4), padding: const EdgeInsets.symmetric(vertical: 4),
child: FlowyText.regular( child: FlowyText.regular(
@ -191,18 +190,20 @@ class _LinkToPageMenuState extends State<LinkToPageMenu> {
), ),
), ),
]; ];
if (views != null && views.isNotEmpty) { if (views != null && views.isNotEmpty) {
for (final view in views) { for (final (view, viewChildren) in views) {
if (view.value2.isNotEmpty) { if (viewChildren.isNotEmpty) {
children.add( children.add(
Padding( Padding(
padding: const EdgeInsets.symmetric(vertical: 4), padding: const EdgeInsets.symmetric(vertical: 4),
child: FlowyText.regular( child: FlowyText.regular(
view.value1.name, view.name,
), ),
), ),
); );
for (final value in view.value2) {
for (final value in viewChildren) {
children.add( children.add(
FlowyButton( FlowyButton(
isSelected: index == _selectedIndex, isSelected: index == _selectedIndex,
@ -211,7 +212,7 @@ class _LinkToPageMenuState extends State<LinkToPageMenu> {
color: Theme.of(context).iconTheme.color, color: Theme.of(context).iconTheme.color,
), ),
text: FlowyText.regular(value.name), text: FlowyText.regular(value.name),
onTap: () => widget.onSelected(view.value1, value), onTap: () => widget.onSelected(view, value),
), ),
); );

View File

@ -4,7 +4,6 @@ import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:appflowy/generated/locale_keys.g.dart'; import 'package:appflowy/generated/locale_keys.g.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:tuple/tuple.dart';
import 'package:easy_localization/easy_localization.dart'; import 'package:easy_localization/easy_localization.dart';
class FontSizeSwitcher extends StatefulWidget { class FontSizeSwitcher extends StatefulWidget {
@ -17,10 +16,10 @@ class FontSizeSwitcher extends StatefulWidget {
} }
class _FontSizeSwitcherState extends State<FontSizeSwitcher> { class _FontSizeSwitcherState extends State<FontSizeSwitcher> {
final List<Tuple3<String, double, bool>> _fontSizes = [ final List<(String, double, bool)> _fontSizes = [
Tuple3(LocaleKeys.moreAction_small.tr(), 14.0, false), (LocaleKeys.moreAction_small.tr(), 14.0, false),
Tuple3(LocaleKeys.moreAction_medium.tr(), 18.0, true), (LocaleKeys.moreAction_medium.tr(), 18.0, true),
Tuple3(LocaleKeys.moreAction_large.tr(), 22.0, false), (LocaleKeys.moreAction_large.tr(), 22.0, false),
]; ];
@override @override
@ -42,9 +41,9 @@ class _FontSizeSwitcherState extends State<FontSizeSwitcher> {
), ),
ToggleButtons( ToggleButtons(
isSelected: isSelected:
_fontSizes.map((e) => e.item2 == state.fontSize).toList(), _fontSizes.map((e) => e.$2 == state.fontSize).toList(),
onPressed: (int index) { onPressed: (int index) {
_updateSelectedFontSize(_fontSizes[index].item2); _updateSelectedFontSize(_fontSizes[index].$2);
}, },
color: foregroundColor, color: foregroundColor,
borderRadius: const BorderRadius.all(Radius.circular(5)), borderRadius: const BorderRadius.all(Radius.circular(5)),
@ -63,8 +62,8 @@ class _FontSizeSwitcherState extends State<FontSizeSwitcher> {
children: _fontSizes children: _fontSizes
.map( .map(
(e) => Text( (e) => Text(
e.item1, e.$1,
style: TextStyle(fontSize: e.item2), style: TextStyle(fontSize: e.$2),
), ),
) )
.toList(), .toList(),

View File

@ -273,9 +273,9 @@ class OrContinueWith extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return const Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: const [ children: [
Flexible( Flexible(
child: Divider( child: Divider(
color: Colors.white, color: Colors.white,

View File

@ -178,8 +178,8 @@ class _SkipLoginMoveWindow extends StatelessWidget
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return const Row(
children: const [ children: [
Expanded( Expanded(
child: MoveWindowDetector(), child: MoveWindowDetector(),
), ),

View File

@ -85,10 +85,10 @@ class AppBackendService {
return FolderEventMoveItem(payload).send(); return FolderEventMoveItem(payload).send();
} }
Future<List<Tuple2<ViewPB, List<ViewPB>>>> fetchViews( Future<List<(ViewPB, List<ViewPB>)>> fetchViews(
ViewLayoutPB layoutType, ViewLayoutPB layoutType,
) async { ) async {
final result = <Tuple2<ViewPB, List<ViewPB>>>[]; final result = <(ViewPB, List<ViewPB>)>[];
return FolderEventReadCurrentWorkspace().send().then((value) async { return FolderEventReadCurrentWorkspace().send().then((value) async {
final workspaces = value.getLeftOrNull<WorkspaceSettingPB>(); final workspaces = value.getLeftOrNull<WorkspaceSettingPB>();
if (workspaces != null) { if (workspaces != null) {
@ -101,7 +101,7 @@ class AppBackendService {
.toList(), .toList(),
); );
if (childViews != null && childViews.isNotEmpty) { if (childViews != null && childViews.isNotEmpty) {
result.add(Tuple2(view, childViews)); result.add((view, childViews));
} }
} }
} }

View File

@ -100,7 +100,7 @@ class FadingIndexedStackState extends State<FadingIndexedStack> {
} }
} }
abstract class NavigationItem { abstract mixin class NavigationItem {
Widget get leftBarItem; Widget get leftBarItem;
Widget? get rightBarItem => null; Widget? get rightBarItem => null;

View File

@ -108,15 +108,10 @@ class _DebugToast {
Future<String> _getDeviceInfo() async { Future<String> _getDeviceInfo() async {
final deviceInfoPlugin = DeviceInfoPlugin(); final deviceInfoPlugin = DeviceInfoPlugin();
final deviceInfo = deviceInfoPlugin.deviceInfo; final deviceInfo = await deviceInfoPlugin.deviceInfo;
return deviceInfo.then((info) { return deviceInfo.data.entries
var debugText = ""; .fold('', (prev, el) => "$prev${el.key}: ${el.value}");
info.toMap().forEach((key, value) {
debugText = "$debugText$key: $value\n";
});
return debugText;
});
} }
Future<String> _getDocumentPath() async { Future<String> _getDocumentPath() async {

View File

@ -6,7 +6,7 @@ description: Demonstrates how to use the appflowy_backend plugin.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev publish_to: 'none' # Remove this line if you wish to publish to pub.dev
environment: environment:
sdk: ">=2.7.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"
dependencies: dependencies:
flutter: flutter:

View File

@ -8,7 +8,6 @@ import 'package:appflowy_backend/protobuf/flowy-net/network_state.pb.dart';
import 'package:isolates/isolates.dart'; import 'package:isolates/isolates.dart';
import 'package:isolates/ports.dart'; import 'package:isolates/ports.dart';
import 'package:ffi/ffi.dart'; import 'package:ffi/ffi.dart';
// ignore: unused_import
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'dart:async'; import 'dart:async';
import 'dart:typed_data'; import 'dart:typed_data';

View File

@ -1,17 +1,17 @@
name: appflowy_backend name: appflowy_backend
description: A new flutter plugin project. description: A new flutter plugin project.
version: 0.0.1 version: 0.0.1
homepage: homepage: https://appflowy.io
publish_to: "none" publish_to: "none"
environment: environment:
sdk: ">=2.12.0-0 <3.0.0" sdk: ">=2.17.0-0 <3.0.0"
flutter: ">=1.17.0" flutter: ">=1.17.0"
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
ffi: ^2.0.1 ffi: ^2.0.2
isolates: ^3.0.3+8 isolates: ^3.0.3+8
protobuf: ^2.0.0 protobuf: ^2.0.0
dartz: ^0.10.1 dartz: ^0.10.1

View File

@ -9,13 +9,21 @@ void main() {
TestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized();
setUp(() { setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
return '42'; .setMockMethodCallHandler(
}); channel,
(MethodCall methodCall) async {
return '42';
},
);
}); });
tearDown(() { tearDown(() {
channel.setMockMethodCallHandler(null); TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
channel,
null,
);
}); });
test('getPlatformVersion', () async { test('getPlatformVersion', () async {

View File

@ -8,13 +8,18 @@ void main() {
TestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized();
setUp(() { setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(channel, (MethodCall methodCall) async {
return '42'; return '42';
}); });
}); });
tearDown(() { tearDown(() {
channel.setMockMethodCallHandler(null); TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
channel,
null,
);
}); });
test('getPlatformVersion', () async { test('getPlatformVersion', () async {

View File

@ -78,11 +78,11 @@ class _MyHomePageState extends State<MyHomePage> {
direction: PopoverDirection.topWithLeftAligned, direction: PopoverDirection.topWithLeftAligned,
), ),
]), ]),
Expanded( const Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: [
const ExampleButton( ExampleButton(
label: "Top", label: "Top",
offset: Offset(0, 10), offset: Offset(0, 10),
direction: PopoverDirection.bottomWithCenterAligned, direction: PopoverDirection.bottomWithCenterAligned,
@ -91,7 +91,7 @@ class _MyHomePageState extends State<MyHomePage> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: const [ children: [
ExampleButton( ExampleButton(
label: "Central", label: "Central",
offset: Offset(0, 10), offset: Offset(0, 10),
@ -100,7 +100,7 @@ class _MyHomePageState extends State<MyHomePage> {
], ],
), ),
), ),
const ExampleButton( ExampleButton(
label: "Bottom", label: "Bottom",
offset: Offset(0, -10), offset: Offset(0, -10),
direction: PopoverDirection.topWithCenterAligned, direction: PopoverDirection.topWithCenterAligned,
@ -108,15 +108,15 @@ class _MyHomePageState extends State<MyHomePage> {
], ],
), ),
), ),
Column( const Column(
children: [ children: [
const ExampleButton( ExampleButton(
label: "Right top", label: "Right top",
offset: Offset(0, 10), offset: Offset(0, 10),
direction: PopoverDirection.bottomWithRightAligned, direction: PopoverDirection.bottomWithRightAligned,
), ),
Expanded(child: Container()), Expanded(child: SizedBox.shrink()),
const ExampleButton( ExampleButton(
label: "Right bottom", label: "Right bottom",
offset: Offset(0, -10), offset: Offset(0, -10),
direction: PopoverDirection.topWithRightAligned, direction: PopoverDirection.topWithRightAligned,

View File

@ -1,11 +1,11 @@
name: appflowy_popover name: appflowy_popover
description: A new Flutter package project. description: A new Flutter package project.
version: 0.0.1 version: 0.0.1
homepage: homepage: https://appflowy.io
environment: environment:
sdk: ">=2.19.0 <3.0.0" sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.7.0" flutter: ">=3.10.1"
dependencies: dependencies:
flutter: flutter:

View File

@ -1,19 +1,18 @@
name: flowy_infra name: flowy_infra
description: A new Flutter package project. description: A new Flutter package project.
version: 0.0.1 version: 0.0.1
homepage: homepage: https://appflowy.io
environment: environment:
sdk: ">=2.18.0 <3.0.0" sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.3.0" flutter: ">=3.10.1"
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
time: '>=2.0.0' time: '>=2.0.0'
uuid: ">=2.2.2" uuid: ">=2.2.2"
textstyle_extensions: '2.0.0-nullsafety' flutter_svg: ^2.0.6
flutter_svg: ^2.0.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

View File

@ -73,7 +73,7 @@ TransitionBuilder overlayManagerBuilder() {
}; };
} }
abstract class FlowyOverlayDelegate { abstract mixin class FlowyOverlayDelegate {
bool asBarrier() => false; bool asBarrier() => false;
void didRemove() => {}; void didRemove() => {};
} }

View File

@ -3,7 +3,6 @@ import 'dart:async';
import 'package:flowy_infra/size.dart'; import 'package:flowy_infra/size.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:textstyle_extensions/textstyle_extensions.dart';
class FlowyTextField extends StatefulWidget { class FlowyTextField extends StatefulWidget {
final String hintText; final String hintText;
@ -125,7 +124,7 @@ class FlowyTextFieldState extends State<FlowyTextField> {
hintStyle: Theme.of(context) hintStyle: Theme.of(context)
.textTheme .textTheme
.bodySmall! .bodySmall!
.textColor(Theme.of(context).hintColor), .copyWith(color: Theme.of(context).hintColor),
suffixText: _suffixText(), suffixText: _suffixText(),
counterText: "", counterText: "",
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(

View File

@ -3,7 +3,6 @@ import 'dart:math' as math;
import 'package:flowy_infra/size.dart'; import 'package:flowy_infra/size.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:textstyle_extensions/textstyle_extensions.dart';
class FlowyFormTextInput extends StatelessWidget { class FlowyFormTextInput extends StatelessWidget {
static EdgeInsets kDefaultTextInputPadding = static EdgeInsets kDefaultTextInputPadding =
@ -221,7 +220,7 @@ class StyledSearchTextInputState extends State<StyledSearchTextInput> {
hintStyle: Theme.of(context) hintStyle: Theme.of(context)
.textTheme .textTheme
.bodyMedium! .bodyMedium!
.textColor(Theme.of(context).hintColor), .copyWith(color: Theme.of(context).hintColor),
labelText: widget.label, labelText: widget.label,
), ),
), ),

View File

@ -3,7 +3,6 @@ import 'package:flowy_infra_ui/widget/rounded_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flowy_infra/time/duration.dart'; import 'package:flowy_infra/time/duration.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:textstyle_extensions/textstyle_extensions.dart';
class RoundedInputField extends StatefulWidget { class RoundedInputField extends StatefulWidget {
final String? hintText; final String? hintText;
@ -131,7 +130,7 @@ class _RoundedInputFieldState extends State<RoundedInputField> {
hintStyle: Theme.of(context) hintStyle: Theme.of(context)
.textTheme .textTheme
.bodySmall! .bodySmall!
.textColor(Theme.of(context).hintColor), .copyWith(color: Theme.of(context).hintColor),
suffixText: _suffixText(), suffixText: _suffixText(),
counterText: "", counterText: "",
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(

View File

@ -1,25 +1,24 @@
name: flowy_infra_ui name: flowy_infra_ui
description: A new flutter plugin project. description: A new flutter plugin project.
version: 0.0.1 version: 0.0.1
homepage: homepage: https://appflowy.io
publish_to: "none" publish_to: "none"
environment: environment:
sdk: ">=2.19.0 <3.0.0" sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.7.0" flutter: ">=3.10.1"
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
# Thirdparty packages # Thirdparty packages
textstyle_extensions: "2.0.0-nullsafety"
dartz: dartz:
provider: ^6.0.1 provider: ^6.0.5
styled_widget: "^0.3.1" styled_widget: ^0.4.1
equatable: "^2.0.3" equatable: ^2.0.5
animations: ^2.0.0 animations: ^2.0.7
loading_indicator: ^3.0.1 loading_indicator: ^3.1.0
async: async:
# Federated Platform Interface # Federated Platform Interface

View File

@ -7,13 +7,18 @@ void main() {
TestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized();
setUp(() { setUp(() {
channel.setMockMethodCallHandler((MethodCall methodCall) async { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(channel, (MethodCall methodCall) async {
return '42'; return '42';
}); });
}); });
tearDown(() { tearDown(() {
channel.setMockMethodCallHandler(null); TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
.setMockMethodCallHandler(
channel,
null,
);
}); });
test('getPlatformVersion', () async {}); test('getPlatformVersion', () async {});

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 0.1.5 version: 0.1.5
environment: environment:
sdk: ">=2.19.0 <3.0.0" sdk: ">=3.0.0 <4.0.0"
# Dependencies specify other packages that your package needs in order to work. # Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions # To automatically upgrade your package dependencies to the latest versions
@ -42,72 +42,64 @@ dependencies:
git: git:
url: https://github.com/AppFlowy-IO/appflowy-board.git url: https://github.com/AppFlowy-IO/appflowy-board.git
ref: a183c57 ref: a183c57
# appflowy_editor: ^0.1.9
appflowy_editor: appflowy_editor:
# path: /Users/lucas.xu/Desktop/appflowy-editor
git: git:
url: https://github.com/LucasXu0/appflowy-editor.git url: https://github.com/AppFlowy-IO/appflowy-editor.git
ref: 09e91c ref: 30ce149
appflowy_popover: appflowy_popover:
path: packages/appflowy_popover path: packages/appflowy_popover
# third party packages # third party packages
intl: ^0.17.0 intl: ^0.18.0
time: "^2.0.0" time: ^2.1.3
equatable: "^2.0.3" equatable: ^2.0.5
freezed_annotation: ^2.1.0 freezed_annotation: ^2.2.0
get_it: "^7.1.3" get_it: ^7.6.0
flutter_bloc: "^8.0.1" flutter_bloc: ^8.1.3
flutter_math_fork: flutter_math_fork:
git: git:
url: https://github.com/LucasXu0/flutter_math_fork.git url: https://github.com/xazin/flutter_math_fork.git
ref: master ref: de24059
dartz: ^0.10.1 dartz: ^0.10.1
provider: ^6.0.1 provider: ^6.0.5
path_provider: ^2.0.1 path_provider: ^2.0.15
sized_context: ^1.0.0+1 sized_context: ^1.0.0+4
styled_widget: "^0.3.1" styled_widget: ^0.4.1
expandable: ^5.0.1 expandable: ^5.0.1
flutter_colorpicker: ^1.0.3 flutter_colorpicker: ^1.0.3
highlight: ^0.7.0 highlight: ^0.7.0
package_info_plus: ^1.3.0 package_info_plus: ^4.0.1
url_launcher: ^6.0.2 url_launcher: ^6.1.11
# file_picker: ^4.2.1
clipboard: ^0.1.3 clipboard: ^0.1.3
connectivity_plus: ^3.0.3 connectivity_plus: ^4.0.1
connectivity_plus_platform_interface: ^1.2.2 connectivity_plus_platform_interface: ^1.2.2
easy_localization: ^3.0.0 easy_localization: ^3.0.2
textfield_tags: ^2.0.2 textfield_tags: ^2.0.2
# The following adds the Cupertino Icons font to your application. device_info_plus: ^9.0.1
# Use with the CupertinoIcons class for iOS style icons. fluttertoast: ^8.2.2
cupertino_icons: ^1.0.2 json_annotation: ^4.8.1
device_info_plus: ^4.0.0 table_calendar: ^3.0.9
fluttertoast: ^8.0.9
table_calendar: ^3.0.5
reorderables: ^0.6.0 reorderables: ^0.6.0
linked_scroll_controller: ^0.2.0 linked_scroll_controller: ^0.2.0
hotkey_manager: ^0.1.7 hotkey_manager: ^0.1.7
fixnum: ^1.0.1 fixnum: ^1.1.0
tuple: ^2.0.0
protobuf: "2.0.0" protobuf: "2.0.0"
charcode: ^1.3.1 charcode: ^1.3.1
collection: ^1.16.0 collection: ^1.17.1
bloc: ^8.1.0 bloc: ^8.1.2
textstyle_extensions: "2.0.0-nullsafety" shared_preferences: ^2.1.1
shared_preferences: ^2.0.15 google_fonts: ^4.0.5
google_fonts: ^4.0.3 file_picker: ^5.3.1
file_picker: <=5.0.0 percent_indicator: ^4.2.3
percent_indicator: ^4.0.1 calendar_view: ^1.0.3
calendar_view: ^1.0.1 window_manager: ^0.3.4
window_manager: ^0.3.0 http: ^1.0.0
http: ^0.13.5 path: ^1.8.3
json_annotation: ^4.7.0
path: ^1.8.2
mocktail: ^0.3.0 mocktail: ^0.3.0
archive: ^3.3.0 archive: ^3.3.7
flutter_svg: ^2.0.5 flutter_svg: ^2.0.6
nanoid: ^1.0.0 nanoid: ^1.0.0
supabase_flutter: ^1.9.1 supabase_flutter: ^1.10.0
envied: ^0.3.0+3 envied: ^0.3.0+3
dev_dependencies: dev_dependencies:
@ -117,12 +109,15 @@ dev_dependencies:
sdk: flutter sdk: flutter
integration_test: integration_test:
sdk: flutter sdk: flutter
build_runner: ^2.3.3 build_runner: ^2.4.4
freezed: ^2.1.0+1 freezed: ^2.3.4
bloc_test: ^9.0.2 bloc_test: ^9.1.2
json_serializable: ^6.5.4 json_serializable: ^6.7.0
envied_generator: ^0.3.0+3 envied_generator: ^0.3.0+3
dependency_overrides:
http: ^1.0.0
# The "flutter_lints" package below contains a set of recommended lints to # The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is # encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your # activated in the `analysis_options.yaml` file located at the root of your

View File

@ -102,8 +102,9 @@ class AppFlowyUnitTest {
void _pathProviderInitialized() { void _pathProviderInitialized() {
const MethodChannel channel = const MethodChannel channel =
MethodChannel('plugins.flutter.io/path_provider'); MethodChannel('plugins.flutter.io/path_provider');
channel.setMockMethodCallHandler((MethodCall methodCall) async { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger
return "."; .setMockMethodCallHandler(channel, (MethodCall methodCall) async {
return '.';
}); });
} }

View File

@ -38,7 +38,7 @@ RUN source ~/.cargo/env && \
RUN sudo pacman -S --noconfirm git tar gtk3 RUN sudo pacman -S --noconfirm git tar gtk3
RUN curl -sSfL \ RUN curl -sSfL \
--output flutter.tar.xz \ --output flutter.tar.xz \
https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.7.5-stable.tar.xz && \ https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.10.1-stable.tar.xz && \
tar -xf flutter.tar.xz && \ tar -xf flutter.tar.xz && \
rm flutter.tar.xz rm flutter.tar.xz
RUN flutter config --enable-linux-desktop RUN flutter config --enable-linux-desktop

View File

@ -1,5 +1,5 @@
echo 'Generating language files' echo 'Generating language files'
cd appflowy_flutter cd appflowy_flutter
call flutter pub run easy_localization:generate -S assets/translations/ call dart run easy_localization:generate -S assets/translations/
call flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations/ -s en.json call dart run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations/ -s en.json

View File

@ -2,5 +2,5 @@
#!/usr/bin/env fish #!/usr/bin/env fish
echo 'Generating language files' echo 'Generating language files'
cd appflowy_flutter cd appflowy_flutter
flutter pub run easy_localization:generate -S assets/translations/ dart run easy_localization:generate -S assets/translations/
flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json dart run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json

View File

@ -38,9 +38,9 @@ fi
printMessage "Setting up Flutter" printMessage "Setting up Flutter"
# Get the current Flutter version # Get the current Flutter version
FLUTTER_VERSION=$(flutter --version | grep -oP 'Flutter \K\S+') FLUTTER_VERSION=$(flutter --version | grep -oP 'Flutter \K\S+')
# Check if the current version is 3.7.5 # Check if the current version is 3.10.1
if [ "$FLUTTER_VERSION" = "3.7.5" ]; then if [ "$FLUTTER_VERSION" = "3.10.1" ]; then
echo "Flutter version is already 3.7.5" echo "Flutter version is already 3.10.1"
else else
# Get the path to the Flutter SDK # Get the path to the Flutter SDK
FLUTTER_PATH=$(which flutter) FLUTTER_PATH=$(which flutter)
@ -49,12 +49,12 @@ else
current_dir=$(pwd) current_dir=$(pwd)
cd $FLUTTER_PATH cd $FLUTTER_PATH
# Use git to checkout version 3.7.5 of Flutter # Use git to checkout version 3.10.1 of Flutter
git checkout 3.7.5 git checkout 3.10.1
# Get back to current working directory # Get back to current working directory
cd "$current_dir" cd "$current_dir"
echo "Switched to Flutter version 3.7.5" echo "Switched to Flutter version 3.10.1"
fi fi
# Enable linux desktop # Enable linux desktop

View File

@ -41,9 +41,9 @@ printMessage "Setting up Flutter"
# Get the current Flutter version # Get the current Flutter version
FLUTTER_VERSION=$(flutter --version | grep -oE 'Flutter [^ ]+' | grep -oE '[^ ]+$') FLUTTER_VERSION=$(flutter --version | grep -oE 'Flutter [^ ]+' | grep -oE '[^ ]+$')
# Check if the current version is 3.7.5 # Check if the current version is 3.10.1
if [ "$FLUTTER_VERSION" = "3.7.5" ]; then if [ "$FLUTTER_VERSION" = "3.10.1" ]; then
echo "Flutter version is already 3.7.5" echo "Flutter version is already 3.10.1"
else else
# Get the path to the Flutter SDK # Get the path to the Flutter SDK
FLUTTER_PATH=$(which flutter) FLUTTER_PATH=$(which flutter)
@ -52,12 +52,12 @@ else
current_dir=$(pwd) current_dir=$(pwd)
cd $FLUTTER_PATH cd $FLUTTER_PATH
# Use git to checkout version 3.7.5 of Flutter # Use git to checkout version 3.10.1 of Flutter
git checkout 3.7.5 git checkout 3.10.1
# Get back to current working directory # Get back to current working directory
cd "$current_dir" cd "$current_dir"
echo "Switched to Flutter version 3.7.5" echo "Switched to Flutter version 3.10.1"
fi fi
# Enable linux desktop # Enable linux desktop

View File

@ -48,9 +48,9 @@ fi
printMessage "Setting up Flutter" printMessage "Setting up Flutter"
# Get the current Flutter version # Get the current Flutter version
FLUTTER_VERSION=$(flutter --version | grep -oP 'Flutter \K\S+') FLUTTER_VERSION=$(flutter --version | grep -oP 'Flutter \K\S+')
# Check if the current version is 3.7.5 # Check if the current version is 3.10.1
if [ "$FLUTTER_VERSION" = "3.7.5" ]; then if [ "$FLUTTER_VERSION" = "3.10.1" ]; then
echo "Flutter version is already 3.7.5" echo "Flutter version is already 3.10.1"
else else
# Get the path to the Flutter SDK # Get the path to the Flutter SDK
FLUTTER_PATH=$(which flutter) FLUTTER_PATH=$(which flutter)
@ -59,12 +59,12 @@ else
current_dir=$(pwd) current_dir=$(pwd)
cd $FLUTTER_PATH cd $FLUTTER_PATH
# Use git to checkout version 3.7.5 of Flutter # Use git to checkout version 3.10.1 of Flutter
git checkout 3.7.5 git checkout 3.10.1
# Get back to current working directory # Get back to current working directory
cd "$current_dir" cd "$current_dir"
echo "Switched to Flutter version 3.7.5" echo "Switched to Flutter version 3.10.1"
fi fi
# Add pub cache and cargo to PATH # Add pub cache and cargo to PATH

View File

@ -189,8 +189,8 @@ script = [
cd appflowy_flutter cd appflowy_flutter
flutter clean flutter clean
flutter packages pub get flutter packages pub get
flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json dart run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
flutter packages pub run build_runner build --delete-conflicting-outputs dart run build_runner build -d
""", """,
] ]
@ -201,8 +201,8 @@ script = [
cd ./appflowy_flutter/ cd ./appflowy_flutter/
exec cmd.exe /c flutter clean exec cmd.exe /c flutter clean
exec cmd.exe /c flutter packages pub get exec cmd.exe /c flutter packages pub get
exec cmd.exe /c flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json exec cmd.exe /c dart run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
exec cmd.exe /c flutter packages pub run build_runner build --delete-conflicting-outputs exec cmd.exe /c dart run build_runner build -d
""", """,
] ]
@ -211,8 +211,8 @@ script_runner = "@shell"
script = [ script = [
""" """
cd appflowy_flutter cd appflowy_flutter
flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json dart run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
flutter packages pub run build_runner build --delete-conflicting-outputs dart run build_runner build -d
""", """,
] ]
@ -221,7 +221,7 @@ script_runner = "@duckscript"
script = [ script = [
""" """
cd ./appflowy_flutter/ cd ./appflowy_flutter/
exec cmd.exe /c flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json exec cmd.exe /c dart run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
exec cmd.exe /c flutter packages pub run build_runner build --delete-conflicting-outputs exec cmd.exe /c dart run build_runner build -d
""", """,
] ]