mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
[flutter]: dir refactor
This commit is contained in:
parent
03182a51b0
commit
5445853839
@ -15,6 +15,7 @@ analyzer:
|
|||||||
- "**/*.g.dart"
|
- "**/*.g.dart"
|
||||||
- "**/*.freezed.dart"
|
- "**/*.freezed.dart"
|
||||||
- "packages/flowy_editor/**"
|
- "packages/flowy_editor/**"
|
||||||
|
- "packages/editor/**"
|
||||||
# - "packages/flowy_infra_ui/**"
|
# - "packages/flowy_infra_ui/**"
|
||||||
|
|
||||||
linter:
|
linter:
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
import 'dart:typed_data';
|
|
||||||
|
|
||||||
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
|
import 'package:flowy_sdk/protobuf/flowy-workspace/errors.pb.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:app_flowy/workspace/domain/i_doc.dart';
|
import 'package:app_flowy/workspace/domain/i_doc.dart';
|
||||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||||
import 'package:flowy_editor/flowy_editor.dart';
|
|
||||||
import 'dart:convert';
|
|
||||||
part 'doc_bloc.freezed.dart';
|
part 'doc_bloc.freezed.dart';
|
||||||
|
|
||||||
class DocBloc extends Bloc<DocEvent, DocState> {
|
class DocBloc extends Bloc<DocEvent, DocState> {
|
||||||
@ -37,17 +33,17 @@ class DocBloc extends Bloc<DocEvent, DocState> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Document _decodeListToDocument(Uint8List data) {
|
// Document _decodeListToDocument(Uint8List data) {
|
||||||
final json = jsonDecode(utf8.decode(data));
|
// final json = jsonDecode(utf8.decode(data));
|
||||||
final document = Document.fromJson(json);
|
// final document = Document.fromJson(json);
|
||||||
return document;
|
// return document;
|
||||||
}
|
// }
|
||||||
|
|
||||||
Document _decodeJsonToDocument(String data) {
|
// Document _decodeJsonToDocument(String data) {
|
||||||
final json = jsonDecode(data);
|
// final json = jsonDecode(data);
|
||||||
final document = Document.fromJson(json);
|
// final document = Document.fromJson(json);
|
||||||
return document;
|
// return document;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
|
@ -23,8 +23,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
return MultiBlocProvider(
|
return MultiBlocProvider(
|
||||||
providers: [
|
providers: [
|
||||||
BlocProvider<HomeAuthBloc>(
|
BlocProvider<HomeAuthBloc>(
|
||||||
create: (context) => getIt<HomeAuthBloc>(param1: user)
|
create: (context) => getIt<HomeAuthBloc>(param1: user)..add(const HomeAuthEvent.started()),
|
||||||
..add(const HomeAuthEvent.started()),
|
|
||||||
),
|
),
|
||||||
BlocProvider<HomeBloc>(create: (context) => getIt<HomeBloc>()),
|
BlocProvider<HomeBloc>(create: (context) => getIt<HomeBloc>()),
|
||||||
],
|
],
|
||||||
@ -46,8 +45,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
return FlowyContainer(
|
return FlowyContainer(
|
||||||
Theme.of(context).colorScheme.surface,
|
Theme.of(context).colorScheme.surface,
|
||||||
// Colors.white,
|
// Colors.white,
|
||||||
child: _buildBody(
|
child: _buildBody(state, context.read<HomeBloc>().state.forceCollapse),
|
||||||
state, context.read<HomeBloc>().state.forceCollapse),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -70,17 +68,12 @@ class HomeScreen extends StatelessWidget {
|
|||||||
layout: layout,
|
layout: layout,
|
||||||
context: context,
|
context: context,
|
||||||
);
|
);
|
||||||
return _layoutWidgets(
|
return _layoutWidgets(layout: layout, homePage: homePage, homeMenu: menu, editPannel: editPannel);
|
||||||
layout: layout,
|
|
||||||
homePage: homePage,
|
|
||||||
homeMenu: menu,
|
|
||||||
editPannel: editPannel);
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildHomeMenu(
|
Widget _buildHomeMenu({required HomeLayout layout, required BuildContext context}) {
|
||||||
{required HomeLayout layout, required BuildContext context}) {
|
|
||||||
final homeBloc = context.read<HomeBloc>();
|
final homeBloc = context.read<HomeBloc>();
|
||||||
Widget homeMenu = HomeMenu(
|
Widget homeMenu = HomeMenu(
|
||||||
pageContextChanged: (pageContext) {
|
pageContextChanged: (pageContext) {
|
||||||
@ -97,10 +90,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
return homeMenu;
|
return homeMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildEditPannel(
|
Widget _buildEditPannel({required HomeState homeState, required BuildContext context, required HomeLayout layout}) {
|
||||||
{required HomeState homeState,
|
|
||||||
required BuildContext context,
|
|
||||||
required HomeLayout layout}) {
|
|
||||||
final homeBloc = context.read<HomeBloc>();
|
final homeBloc = context.read<HomeBloc>();
|
||||||
Widget editPannel = EditPannel(
|
Widget editPannel = EditPannel(
|
||||||
context: homeState.editContext,
|
context: homeState.editContext,
|
||||||
@ -112,10 +102,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _layoutWidgets(
|
Widget _layoutWidgets(
|
||||||
{required HomeLayout layout,
|
{required HomeLayout layout, required Widget homeMenu, required Widget homePage, required Widget editPannel}) {
|
||||||
required Widget homeMenu,
|
|
||||||
required Widget homePage,
|
|
||||||
required Widget editPannel}) {
|
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
homeMenu
|
homeMenu
|
||||||
@ -123,21 +110,11 @@ class HomeScreen extends StatelessWidget {
|
|||||||
closeX: -layout.menuWidth,
|
closeX: -layout.menuWidth,
|
||||||
isClosed: !layout.showMenu,
|
isClosed: !layout.showMenu,
|
||||||
)
|
)
|
||||||
.positioned(
|
.positioned(left: 0, top: 0, width: layout.menuWidth, bottom: 0, animate: true)
|
||||||
left: 0,
|
|
||||||
top: 0,
|
|
||||||
width: layout.menuWidth,
|
|
||||||
bottom: 0,
|
|
||||||
animate: true)
|
|
||||||
.animate(layout.animDuration, Curves.easeOut),
|
.animate(layout.animDuration, Curves.easeOut),
|
||||||
homePage
|
homePage
|
||||||
.constrained(minWidth: 500)
|
.constrained(minWidth: 500)
|
||||||
.positioned(
|
.positioned(left: layout.homePageLOffset, right: layout.homePageROffset, bottom: 0, top: 0, animate: true)
|
||||||
left: layout.homePageLOffset,
|
|
||||||
right: layout.homePageROffset,
|
|
||||||
bottom: 0,
|
|
||||||
top: 0,
|
|
||||||
animate: true)
|
|
||||||
.animate(layout.animDuration, Curves.easeOut),
|
.animate(layout.animDuration, Curves.easeOut),
|
||||||
editPannel
|
editPannel
|
||||||
.animatedPanelX(
|
.animatedPanelX(
|
||||||
@ -145,8 +122,7 @@ class HomeScreen extends StatelessWidget {
|
|||||||
closeX: layout.editPannelWidth,
|
closeX: layout.editPannelWidth,
|
||||||
isClosed: !layout.showEditPannel,
|
isClosed: !layout.showEditPannel,
|
||||||
)
|
)
|
||||||
.positioned(
|
.positioned(right: 0, top: 0, bottom: 0, width: layout.editPannelWidth),
|
||||||
right: 0, top: 0, bottom: 0, width: layout.editPannelWidth),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import 'package:app_flowy/workspace/presentation/widgets/menu/menu_new_app.dart';
|
import 'package:app_flowy/workspace/presentation/widgets/menu/widget/top_bar.dart';
|
||||||
import 'package:app_flowy/workspace/presentation/widgets/menu/menu_top_bar.dart';
|
|
||||||
import 'package:dartz/dartz.dart';
|
import 'package:dartz/dartz.dart';
|
||||||
import 'package:flowy_infra/size.dart';
|
import 'package:flowy_infra/size.dart';
|
||||||
import 'package:flowy_infra_ui/widget/error_page.dart';
|
import 'package:flowy_infra_ui/widget/error_page.dart';
|
||||||
@ -14,11 +13,11 @@ import 'package:app_flowy/startup/startup.dart';
|
|||||||
import 'package:app_flowy/workspace/application/menu/menu_bloc.dart';
|
import 'package:app_flowy/workspace/application/menu/menu_bloc.dart';
|
||||||
import 'package:app_flowy/workspace/application/menu/menu_watch.dart';
|
import 'package:app_flowy/workspace/application/menu/menu_watch.dart';
|
||||||
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
|
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
|
||||||
import 'package:app_flowy/workspace/presentation/app/app_page.dart';
|
import 'package:app_flowy/workspace/presentation/widgets/menu/widget/user.dart';
|
||||||
import 'package:app_flowy/workspace/presentation/home/home_sizes.dart';
|
|
||||||
import 'package:app_flowy/workspace/presentation/widgets/menu/menu_user.dart';
|
|
||||||
|
|
||||||
import 'menu_list.dart';
|
import 'menu_list.dart';
|
||||||
|
import 'widget/app/app.dart';
|
||||||
|
import 'widget/app/create_button.dart';
|
||||||
|
|
||||||
class HomeMenu extends StatelessWidget {
|
class HomeMenu extends StatelessWidget {
|
||||||
final Function(HomeStackView?) pageContextChanged;
|
final Function(HomeStackView?) pageContextChanged;
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
|
import 'package:app_flowy/workspace/presentation/widgets/menu/widget/app/header.dart';
|
||||||
import 'package:expandable/expandable.dart';
|
import 'package:expandable/expandable.dart';
|
||||||
import 'package:flowy_infra_ui/widget/error_page.dart';
|
import 'package:flowy_infra_ui/widget/error_page.dart';
|
||||||
import 'package:flowy_sdk/protobuf/flowy-workspace/app_create.pb.dart';
|
import 'package:flowy_sdk/protobuf/flowy-workspace/app_create.pb.dart';
|
||||||
import 'package:flowy_sdk/protobuf/flowy-workspace/view_create.pb.dart';
|
import 'package:flowy_sdk/protobuf/flowy-workspace/view_create.pb.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:app_flowy/startup/startup.dart';
|
import 'package:app_flowy/startup/startup.dart';
|
||||||
import 'package:app_flowy/workspace/application/app/app_bloc.dart';
|
import 'package:app_flowy/workspace/application/app/app_bloc.dart';
|
||||||
import 'package:app_flowy/workspace/application/app/app_watch_bloc.dart';
|
import 'package:app_flowy/workspace/application/app/app_watch_bloc.dart';
|
||||||
import 'package:app_flowy/workspace/presentation/app/view_list_page.dart';
|
|
||||||
import 'package:app_flowy/workspace/presentation/widgets/menu/menu_list.dart';
|
import 'package:app_flowy/workspace/presentation/widgets/menu/menu_list.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
import 'app_header.dart';
|
|
||||||
|
import 'view/view_list.dart';
|
||||||
|
|
||||||
class AppPageSize {
|
class AppPageSize {
|
||||||
static double expandedIconSize = 16;
|
static double expandedIconSize = 16;
|
||||||
@ -21,18 +21,6 @@ class AppPageSize {
|
|||||||
static double get expandedPadding => expandedIconSize * scale + expandedIconRightSpace;
|
static double get expandedPadding => expandedIconSize * scale + expandedIconRightSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ViewListData extends ChangeNotifier {
|
|
||||||
List<View>? innerViews;
|
|
||||||
ViewListData();
|
|
||||||
|
|
||||||
set views(List<View> views) {
|
|
||||||
innerViews = views;
|
|
||||||
notifyListeners();
|
|
||||||
}
|
|
||||||
|
|
||||||
List<View> get views => innerViews ?? [];
|
|
||||||
}
|
|
||||||
|
|
||||||
class AppPageContext {
|
class AppPageContext {
|
||||||
final App app;
|
final App app;
|
||||||
final viewListData = ViewListData();
|
final viewListData = ViewListData();
|
@ -1,13 +1,12 @@
|
|||||||
import 'package:app_flowy/workspace/presentation/home/home_sizes.dart';
|
import 'package:app_flowy/workspace/presentation/home/home_sizes.dart';
|
||||||
import 'package:app_flowy/workspace/presentation/widgets/menu/create_app_dialog.dart';
|
|
||||||
import 'package:flowy_infra/image.dart';
|
import 'package:flowy_infra/image.dart';
|
||||||
import 'package:flowy_infra/size.dart';
|
import 'package:flowy_infra/size.dart';
|
||||||
import 'package:flowy_infra/theme.dart';
|
|
||||||
import 'package:flowy_infra_ui/style_widget/text.dart';
|
import 'package:flowy_infra_ui/style_widget/text.dart';
|
||||||
import 'package:flowy_infra_ui/widget/dialog/styled_dialogs.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
import 'package:app_flowy/workspace/presentation/widgets/menu/widget/app/create_dialog.dart';
|
||||||
|
import 'package:flowy_infra_ui/widget/dialog/styled_dialogs.dart';
|
||||||
import 'package:flowy_infra_ui/style_widget/extension.dart';
|
import 'package:flowy_infra_ui/style_widget/extension.dart';
|
||||||
import 'package:provider/provider.dart';
|
|
||||||
|
|
||||||
class NewAppButton extends StatelessWidget {
|
class NewAppButton extends StatelessWidget {
|
||||||
final Function(String)? press;
|
final Function(String)? press;
|
||||||
@ -15,7 +14,7 @@ class NewAppButton extends StatelessWidget {
|
|||||||
const NewAppButton({this.press, Key? key}) : super(key: key);
|
const NewAppButton({this.press, Key? key}) : super(key: key);
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = context.watch<AppTheme>();
|
// final theme = context.watch<AppTheme>();
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: HomeSizes.menuAddButtonHeight,
|
height: HomeSizes.menuAddButtonHeight,
|
||||||
child: Row(
|
child: Row(
|
@ -10,7 +10,7 @@ import 'package:flowy_sdk/protobuf/flowy-workspace/view_create.pb.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 'app_page.dart';
|
import 'app.dart';
|
||||||
|
|
||||||
class AppHeader extends StatelessWidget {
|
class AppHeader extends StatelessWidget {
|
||||||
final App app;
|
final App app;
|
@ -1,4 +1,3 @@
|
|||||||
import 'package:app_flowy/workspace/presentation/app/app_page.dart';
|
|
||||||
import 'package:flowy_log/flowy_log.dart';
|
import 'package:flowy_log/flowy_log.dart';
|
||||||
import 'package:flowy_sdk/protobuf/flowy-workspace/view_create.pb.dart';
|
import 'package:flowy_sdk/protobuf/flowy-workspace/view_create.pb.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
@ -7,7 +6,20 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:app_flowy/startup/startup.dart';
|
import 'package:app_flowy/startup/startup.dart';
|
||||||
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
|
import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
|
||||||
import 'package:app_flowy/workspace/presentation/view/view_page.dart';
|
|
||||||
|
import 'view_page.dart';
|
||||||
|
|
||||||
|
class ViewListData extends ChangeNotifier {
|
||||||
|
List<View>? innerViews;
|
||||||
|
ViewListData();
|
||||||
|
|
||||||
|
set views(List<View> views) {
|
||||||
|
innerViews = views;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<View> get views => innerViews ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
class ViewListNotifier with ChangeNotifier {
|
class ViewListNotifier with ChangeNotifier {
|
||||||
List<View> innerViews;
|
List<View> innerViews;
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:app_flowy/workspace/presentation/widgets/menu/widget/app/app.dart';
|
||||||
import 'package:flowy_infra/theme.dart';
|
import 'package:flowy_infra/theme.dart';
|
||||||
import 'package:flowy_infra_ui/style_widget/hover.dart';
|
import 'package:flowy_infra_ui/style_widget/hover.dart';
|
||||||
import 'package:flowy_infra_ui/style_widget/icon_button.dart';
|
import 'package:flowy_infra_ui/style_widget/icon_button.dart';
|
||||||
@ -6,7 +7,6 @@ import 'package:flowy_infra_ui/widget/spacing.dart';
|
|||||||
import 'package:flowy_sdk/protobuf/flowy-workspace/view_create.pb.dart';
|
import 'package:flowy_sdk/protobuf/flowy-workspace/view_create.pb.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:app_flowy/workspace/domain/image.dart';
|
import 'package:app_flowy/workspace/domain/image.dart';
|
||||||
import 'package:app_flowy/workspace/presentation/app/app_page.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
import 'package:styled_widget/styled_widget.dart';
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../menu_list.dart';
|
||||||
|
|
||||||
|
class MenuFav extends MenuItem {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// TODO: implement build
|
||||||
|
throw UnimplementedError();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
// TODO: implement type
|
||||||
|
MenuItemType get type => throw UnimplementedError();
|
||||||
|
}
|
@ -1,7 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
@ -15,8 +12,6 @@ class MyApp extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _MyAppState extends State<MyApp> {
|
class _MyAppState extends State<MyApp> {
|
||||||
String _platformVersion = 'Unknown';
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
@ -29,8 +24,8 @@ class _MyAppState extends State<MyApp> {
|
|||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text('Plugin example app'),
|
title: const Text('Plugin example app'),
|
||||||
),
|
),
|
||||||
body: Center(
|
body: const Center(
|
||||||
child: Text('Running on: $_platformVersion\n'),
|
child: Text(''),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
|
||||||
import 'dart:collection';
|
import 'dart:collection';
|
||||||
|
|
||||||
import 'package:quiver/core.dart';
|
import 'package:quiver/core.dart';
|
||||||
@ -209,9 +211,7 @@ class Attribute<T> {
|
|||||||
if (identical(this, other)) return true;
|
if (identical(this, other)) return true;
|
||||||
if (other is! Attribute) return false;
|
if (other is! Attribute) return false;
|
||||||
final typedOther = other;
|
final typedOther = other;
|
||||||
return key == typedOther.key &&
|
return key == typedOther.key && scope == typedOther.scope && value == typedOther.value;
|
||||||
scope == typedOther.scope &&
|
|
||||||
value == typedOther.value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -264,8 +264,7 @@ class ColorAttribute extends Attribute<String?> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class BackgroundAttribute extends Attribute<String?> {
|
class BackgroundAttribute extends Attribute<String?> {
|
||||||
BackgroundAttribute(String? val)
|
BackgroundAttribute(String? val) : super('background', AttributeScope.INLINE, val);
|
||||||
: super('background', AttributeScope.INLINE, val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This is custom attribute for hint
|
/// This is custom attribute for hint
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// ignore_for_file: unused_element
|
||||||
|
|
||||||
import 'package:dartz/dartz.dart' show Tuple3;
|
import 'package:dartz/dartz.dart' show Tuple3;
|
||||||
import 'package:flowy_infra_ui/src/flowy_overlay/overlay_layout_delegate.dart';
|
import 'package:flowy_infra_ui/src/flowy_overlay/overlay_layout_delegate.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
@ -12,15 +12,13 @@ class SecondaryTextButton extends StatelessWidget {
|
|||||||
final String label;
|
final String label;
|
||||||
final VoidCallback? onPressed;
|
final VoidCallback? onPressed;
|
||||||
|
|
||||||
const SecondaryTextButton(this.label, {Key? key, this.onPressed})
|
const SecondaryTextButton(this.label, {Key? key, this.onPressed}) : super(key: key);
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theme = context.watch<AppTheme>();
|
final theme = context.watch<AppTheme>();
|
||||||
TextStyle txtStyle = TextStyles.Footnote.textColor(theme.shader1);
|
TextStyle txtStyle = TextStyles.Footnote.textColor(theme.shader1);
|
||||||
return SecondaryButton(
|
return SecondaryButton(onPressed: onPressed, child: Text(label, style: txtStyle));
|
||||||
onPressed: onPressed, child: Text(label, style: txtStyle));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -31,7 +29,7 @@ class SecondaryIconButton extends StatelessWidget {
|
|||||||
final Color? color;
|
final Color? color;
|
||||||
|
|
||||||
const SecondaryIconButton(this.icon, {Key? key, this.onPressed, this.color})
|
const SecondaryIconButton(this.icon, {Key? key, this.onPressed, this.color})
|
||||||
: assert((icon is AssetImage) || (icon is IconData)),
|
: assert((icon is IconData)),
|
||||||
super(key: key);
|
super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
Loading…
Reference in New Issue
Block a user