Skip to content

Commit

Permalink
wip: Use OpenColors to replace ExtendedColors
Browse files Browse the repository at this point in the history
  • Loading branch information
lijy91 committed Aug 18, 2024
1 parent c3525c6 commit 206873c
Show file tree
Hide file tree
Showing 35 changed files with 149 additions and 491 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:biyi_app/widgets/list_tile.dart';
import 'package:biyi_app/widgets/widgets.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/widgets.dart';
import 'package:go_router/go_router.dart';
import 'package:reflect_ui/reflect_ui.dart';

Expand Down
16 changes: 8 additions & 8 deletions apps/biyi_app/lib/app/home/limited_functionality_banner.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:biyi_app/generated/locale_keys.g.dart';
import 'package:biyi_app/utils/extended_colors.dart';
import 'package:biyi_app/utils/utils.dart';
import 'package:biyi_app/widgets/alert/alert.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/gestures.dart';
import 'package:open_colors/open_colors.dart';
import 'package:reflect_ui/reflect_ui.dart' hide Alert;
import 'package:screen_capturer/screen_capturer.dart';
import 'package:screen_text_extractor/screen_text_extractor.dart';
Expand All @@ -29,7 +29,7 @@ class AllowAccessListItem extends StatelessWidget {
Widget build(BuildContext context) {
final ThemeData themeData = Theme.of(context);
final textStyle = themeData.textTheme.bodyMedium?.copyWith(
color: ExtendedColors.yellow.shade600,
color: OpenColors.yellow.shade600,
height: 24 / 14,
);
return GappedRow(
Expand All @@ -41,12 +41,12 @@ class AllowAccessListItem extends StatelessWidget {
child: allowed
? Icon(
FluentIcons.checkmark_circle_12_filled,
color: ExtendedColors.green.shade600,
color: OpenColors.green.shade600,
size: 20,
)
: Icon(
FluentIcons.dismiss_circle_12_filled,
color: ExtendedColors.red.shade600,
color: OpenColors.red.shade600,
size: 20,
),
),
Expand Down Expand Up @@ -87,9 +87,9 @@ class AllowAccessListItem extends StatelessWidget {
),
],
style: textStyle?.copyWith(
color: ExtendedColors.yellow.shade600,
color: OpenColors.yellow.shade600,
decoration: TextDecoration.underline,
decorationColor: ExtendedColors.yellow.shade600,
decorationColor: OpenColors.yellow.shade600,
fontWeight: FontWeight.w700,
fontSize: 13,
),
Expand Down Expand Up @@ -173,7 +173,7 @@ class LimitedFunctionalityBanner extends StatelessWidget {
},
actions: [
Button(
color: ExtendedColors.yellow,
color: OpenColors.yellow,
onPressed: onTappedRecheckIsAllowedAllAccess,
child: Text(LocaleKeys.app_home_limited_banner_btn_check_again.tr()),
),
Expand All @@ -183,7 +183,7 @@ class LimitedFunctionalityBanner extends StatelessWidget {
child: IconButton(
FluentIcons.question_circle_20_regular,
variant: IconButtonVariant.filled,
color: ExtendedColors.yellow,
color: OpenColors.yellow,
onPressed: () async {
Uri url = Uri.parse('${sharedEnv.webUrl}/docs');
if (await canLaunchUrl(url)) {
Expand Down
10 changes: 5 additions & 5 deletions apps/biyi_app/lib/app/home/new_version_found_banner.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:biyi_app/generated/locale_keys.g.dart';
import 'package:biyi_app/services/api_client.dart';
import 'package:biyi_app/utils/extended_colors.dart';
import 'package:biyi_app/utils/utils.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/gestures.dart';
import 'package:open_colors/open_colors.dart';
import 'package:reflect_ui/reflect_ui.dart';
import 'package:url_launcher/url_launcher.dart';

Expand Down Expand Up @@ -43,7 +43,7 @@ class NewVersionFoundBanner extends StatelessWidget {
.tr(args: [latestVersion.version]),
),
style: textTheme.bodyMedium!.copyWith(
color: ExtendedColors.white,
color: OpenColors.white,
fontWeight: FontWeight.w500,
),
),
Expand All @@ -54,10 +54,10 @@ class NewVersionFoundBanner extends StatelessWidget {
TextSpan(
text: LocaleKeys.app_home_newversion_banner_btn_update.tr(),
style: const TextStyle(
color: ExtendedColors.white,
color: OpenColors.white,
height: 1.3,
decoration: TextDecoration.underline,
decorationColor: ExtendedColors.white,
decorationColor: OpenColors.white,
),
recognizer: TapGestureRecognizer()
..onTap = () async {
Expand All @@ -74,7 +74,7 @@ class NewVersionFoundBanner extends StatelessWidget {
],
),
style: textTheme.bodyMedium!.copyWith(
color: ExtendedColors.white,
color: OpenColors.white,
),
),
],
Expand Down
4 changes: 2 additions & 2 deletions apps/biyi_app/lib/app/home/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import 'package:biyi_app/app/home/desktop_popup.dart';
import 'package:biyi_app/app/home/tab_homepage.dart';
import 'package:biyi_app/app/home/tab_settings.dart';
import 'package:biyi_app/app/home/tab_vocabulary.dart';
import 'package:biyi_app/utils/extended_colors.dart';
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/cupertino.dart';
import 'package:open_colors/open_colors.dart';
import 'package:reflect_ui/reflect_ui.dart';
import 'package:uni_platform/uni_platform.dart';

Expand Down Expand Up @@ -45,7 +45,7 @@ class _HomePageState extends State<HomePage> {
boxShadow: Theme.of(context).brightness == Brightness.light
? [
BoxShadow(
color: ExtendedColors.gray.withOpacity(0.2),
color: OpenColors.gray.withOpacity(0.2),
blurRadius: 16,
),
]
Expand Down
6 changes: 3 additions & 3 deletions apps/biyi_app/lib/app/home/toolbar_item_settings.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:biyi_app/app/router_config.dart';
import 'package:biyi_app/utils/extended_colors.dart';
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:go_router/go_router.dart';
import 'package:open_colors/open_colors.dart';
import 'package:reflect_ui/reflect_ui.dart';
import 'package:uni_platform/uni_platform.dart';
import 'package:window_manager/window_manager.dart';
Expand Down Expand Up @@ -34,8 +34,8 @@ class _ToolbarItemSettingsState extends State<ToolbarItemSettings> {
FluentIcons.settings_20_regular,
variant: IconButtonVariant.filled,
color: brightness == Brightness.light
? ExtendedColors.black
: ExtendedColors.gray,
? OpenColors.black
: OpenColors.gray,
// size: IconButtonSize.small,
onPressed: _handleClick,
);
Expand Down
7 changes: 3 additions & 4 deletions apps/biyi_app/lib/app/home/translation_input_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import 'dart:ui';

import 'package:biyi_app/generated/locale_keys.g.dart';
import 'package:biyi_app/models/settings_base.dart';
import 'package:biyi_app/utils/extended_colors.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:open_colors/open_colors.dart';
import 'package:reflect_ui/reflect_ui.dart';
import 'package:screen_capturer/screen_capturer.dart';

Expand Down Expand Up @@ -86,7 +85,7 @@ class TranslationInputView extends StatelessWidget {
child: const Text(
'AUTO',
style: TextStyle(
color: ExtendedColors.white,
color: OpenColors.white,
fontSize: 5.4,
fontWeight: FontWeight.w500,
),
Expand Down Expand Up @@ -197,7 +196,7 @@ class TranslationInputView extends StatelessWidget {
margin: EdgeInsets.zero,
child: Stack(
children: [
CupertinoTextField(
TextField(
focusNode: focusNode,
decoration: const BoxDecoration(
color: Color(0x00000000),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import 'dart:math' as math;

import 'package:biyi_app/models/settings_base.dart';
import 'package:biyi_app/utils/extended_colors.dart';
import 'package:biyi_app/utils/language_util.dart';
import 'package:biyi_app/widgets/widgets.dart';
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:open_colors/open_colors.dart';
import 'package:reflect_ui/reflect_ui.dart';

class AvailableLanguageSelector extends StatelessWidget {
Expand Down Expand Up @@ -40,7 +40,7 @@ class AvailableLanguageSelector extends StatelessWidget {
supportedLanguage,
flagSize: 18,
style: TextStyle(
color: !isSelected ? null : ExtendedColors.white,
color: !isSelected ? null : OpenColors.white,
),
);
return isSelected
Expand Down Expand Up @@ -183,7 +183,7 @@ class _TranslationTargetSelectViewState
child: const Icon(
FluentIcons.arrow_swap_20_regular,
size: 20,
color: ExtendedColors.black,
color: OpenColors.black,
),
),
onPressed: () {
Expand Down
10 changes: 5 additions & 5 deletions apps/biyi_app/lib/app/router_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import 'package:biyi_app/app/settings/translation_engines/page.dart';
import 'package:biyi_app/app/settings/translation_targets/new/page.dart';
import 'package:biyi_app/app/supported_languages/page.dart';
import 'package:biyi_app/models/translation_target.dart';
import 'package:biyi_app/utils/extended_colors.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart' show DialogRoute;
import 'package:go_router/go_router.dart';
import 'package:open_colors/open_colors.dart';
import 'package:reflect_ui/reflect_ui.dart';
import 'package:uni_platform/uni_platform.dart';

Expand Down Expand Up @@ -70,7 +70,7 @@ final routerConfig = GoRouter(
path: '/available-ocr-engines',
pageBuilder: (BuildContext context, GoRouterState state) {
return DialogPage(
barrierColor: ExtendedColors.black.withOpacity(0.5),
barrierColor: OpenColors.black.withOpacity(0.5),
builder: (_) => AvailableOcrEnginesPage(
selectedEngineId: state.uri.queryParameters['selectedEngineId'],
),
Expand All @@ -81,7 +81,7 @@ final routerConfig = GoRouter(
path: '/available-translation-engines',
pageBuilder: (BuildContext context, GoRouterState state) {
return DialogPage(
barrierColor: ExtendedColors.black.withOpacity(0.5),
barrierColor: OpenColors.black.withOpacity(0.5),
builder: (_) => AvailableTranslationEnginesPage(
selectedEngineId: state.uri.queryParameters['selectedEngineId'],
),
Expand All @@ -101,7 +101,7 @@ final routerConfig = GoRouter(
path: '/record-shortcut',
pageBuilder: (BuildContext context, GoRouterState state) {
return DialogPage(
barrierColor: ExtendedColors.black.withOpacity(0.5),
barrierColor: OpenColors.black.withOpacity(0.5),
builder: (_) => const RecordShortcutPage(),
);
},
Expand Down Expand Up @@ -275,7 +275,7 @@ final routerConfig = GoRouter(
path: '/supported-languages',
pageBuilder: (BuildContext context, GoRouterState state) {
return DialogPage(
barrierColor: ExtendedColors.black.withOpacity(0.5),
barrierColor: OpenColors.black.withOpacity(0.5),
builder: (_) => SupportedLanguagesPage(
selectedLanguage: state.uri.queryParameters['selectedLanguage'],
),
Expand Down
1 change: 0 additions & 1 deletion apps/biyi_app/lib/app/settings/appearance/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:biyi_app/widgets/list_section.dart';
import 'package:biyi_app/widgets/list_tile.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/material.dart' show ThemeMode;
import 'package:provider/provider.dart';
import 'package:reflect_ui/reflect_ui.dart';

Expand Down
4 changes: 2 additions & 2 deletions apps/biyi_app/lib/app/settings/layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import 'dart:async';

import 'package:biyi_app/app/router_config.dart';
import 'package:biyi_app/generated/locale_keys.g.dart';
import 'package:biyi_app/utils/extended_colors.dart';
import 'package:biyi_app/widgets/navigation_rail/navigation_rail.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter_adaptive_scaffold/flutter_adaptive_scaffold.dart';
import 'package:go_router/go_router.dart';
import 'package:open_colors/open_colors.dart';
import 'package:reflect_ui/reflect_ui.dart';
import 'package:uni_platform/uni_platform.dart';
import 'package:window_manager/window_manager.dart';
Expand All @@ -31,7 +31,7 @@ class _NavigationRailLeading extends StatelessWidget {
child: Text(
label,
style: TextStyle(
color: ExtendedColors.gray.shade500,
color: OpenColors.gray.shade500,
fontSize: 12,
fontWeight: FontWeight.w600,
),
Expand Down
1 change: 0 additions & 1 deletion apps/biyi_app/lib/app/settings/ocr_engine_types/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'package:biyi_app/widgets/list_tile.dart';
import 'package:biyi_app/widgets/ocr_engine_icon/ocr_engine_icon.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/widgets.dart';
import 'package:go_router/go_router.dart';
import 'package:reflect_ui/reflect_ui.dart';

Expand Down
7 changes: 3 additions & 4 deletions apps/biyi_app/lib/app/settings/ocr_engines/new/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ import 'package:biyi_app/generated/locale_keys.g.dart';
import 'package:biyi_app/services/api_client.dart';
import 'package:biyi_app/services/ocr_client/ocr_client.dart';
import 'package:biyi_app/states/settings.dart';
import 'package:biyi_app/utils/extended_colors.dart';
import 'package:biyi_app/widgets/customized_app_bar/customized_app_bar.dart';
import 'package:biyi_app/widgets/list_section.dart';
import 'package:biyi_app/widgets/list_tile.dart';
import 'package:biyi_app/widgets/ocr_engine_icon/ocr_engine_icon.dart';
import 'package:biyi_app/widgets/ocr_engine_name/ocr_engine_name.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/cupertino.dart';
import 'package:go_router/go_router.dart';
import 'package:ocr_engine_youdao/ocr_engine_youdao.dart';
import 'package:open_colors/open_colors.dart';
import 'package:provider/provider.dart';
import 'package:reflect_ui/reflect_ui.dart';
import 'package:shortid/shortid.dart';
Expand Down Expand Up @@ -136,7 +135,7 @@ class _OcrEnginesNewOrEditPageState extends State<OcrEnginesNewOrEditPage> {
children: [
for (var optionKey in _engineOptionKeys)
ListTile(
title: CupertinoTextField(
title: TextField(
controller: _textEditingControllerMap[optionKey],
placeholder: optionKey,
onChanged: (value) {
Expand All @@ -159,7 +158,7 @@ class _OcrEnginesNewOrEditPageState extends State<OcrEnginesNewOrEditPage> {
title: Center(
child: Text(
LocaleKeys.delete.tr(),
style: const TextStyle(color: ExtendedColors.red),
style: const TextStyle(color: OpenColors.red),
),
),
onTap: () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import 'package:biyi_app/widgets/list_tile.dart';
import 'package:biyi_app/widgets/widgets.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:fluentui_system_icons/fluentui_system_icons.dart';

import 'package:flutter/widgets.dart';
import 'package:go_router/go_router.dart';
import 'package:reflect_ui/reflect_ui.dart';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'package:biyi_app/widgets/translation_engine_icon/translation_engine_icon
import 'package:biyi_app/widgets/translation_engine_name/translation_engine_name.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:fluentui_system_icons/fluentui_system_icons.dart';
import 'package:flutter/cupertino.dart';
import 'package:go_router/go_router.dart';
import 'package:provider/provider.dart';
import 'package:reflect_ui/reflect_ui.dart';
Expand Down Expand Up @@ -175,12 +174,12 @@ class _TranslationEnginesNewOrEditPageState
.contains(scope)) {
return const Icon(
FluentIcons.dismiss_circle_20_filled,
// color: ExtendedColors.red,
// color: OpenColors.red,
);
}
return const Icon(
FluentIcons.checkmark_circle_16_filled,
// color: ExtendedColors.green,
// color: OpenColors.green,
);
},
),
Expand All @@ -196,7 +195,7 @@ class _TranslationEnginesNewOrEditPageState
children: [
for (var optionKey in _engineOptionKeys)
ListTile(
title: CupertinoTextField(
title: TextField(
controller: _textEditingControllerMap[optionKey],
placeholder: optionKey,
onChanged: (value) {
Expand All @@ -219,7 +218,7 @@ class _TranslationEnginesNewOrEditPageState
title: Center(
child: Text(
LocaleKeys.delete.tr(),
// style: const TextStyle(color: ExtendedColors.red),
// style: const TextStyle(color: OpenColors.red),
),
),
onTap: () async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class _TranslationTargetNewOrEditPageState
title: Center(
child: Text(
LocaleKeys.delete.tr(),
// style: const TextStyle(color: ExtendedColors.red),
// style: const TextStyle(color: OpenColors),
),
),
// accessoryView: Container(),
Expand Down
Loading

0 comments on commit 206873c

Please sign in to comment.