Skip to content

Commit

Permalink
Update non-quill parts
Browse files Browse the repository at this point in the history
  • Loading branch information
thelukewalton committed Jan 12, 2024
1 parent 23d4c83 commit 635dfb3
Show file tree
Hide file tree
Showing 28 changed files with 107 additions and 855 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
ref: ${{ github.head_ref }}
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.13.x"
flutter-version: "3.16.x"
channel: "stable"
- name: Setup flutter
run: flutter pub get
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# name: "Release"

<<<<<<< Updated upstream
# on:
# push:
# # tags:
Expand Down Expand Up @@ -29,3 +30,40 @@
# dart format .
# dart fix --apply
# dart pub publish
=======
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+*"
jobs:
clean_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.16.x"
channel: "stable"
- name: Setup flutter
run: flutter pub get
- name: build
run: |
cd example
flutter build web -o ../build --no-tree-shake-icons --base-href "/zds_flutter/"
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build
- name: Publish
run: |
dart format .
dart fix --apply
name: Publish to pub.dev
publish:
needs: clean_build
permissions:
id-token: write # Required for authentication using OIDC
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
with:
environment: "pub.dev"
>>>>>>> Stashed changes
782 changes: 0 additions & 782 deletions example/lib/pages/html_view.dart

This file was deleted.

12 changes: 8 additions & 4 deletions example/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,20 @@
#include "generated_plugin_registrant.h"

#include <file_selector_linux/file_selector_plugin.h>
#include <pasteboard/pasteboard_plugin.h>
#include <irondash_engine_context/irondash_engine_context_plugin.h>
#include <super_native_extensions/super_native_extensions_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
g_autoptr(FlPluginRegistrar) pasteboard_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "PasteboardPlugin");
pasteboard_plugin_register_with_registrar(pasteboard_registrar);
g_autoptr(FlPluginRegistrar) irondash_engine_context_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "IrondashEngineContextPlugin");
irondash_engine_context_plugin_register_with_registrar(irondash_engine_context_registrar);
g_autoptr(FlPluginRegistrar) super_native_extensions_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "SuperNativeExtensionsPlugin");
super_native_extensions_plugin_register_with_registrar(super_native_extensions_registrar);
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
Expand Down
3 changes: 2 additions & 1 deletion example/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

list(APPEND FLUTTER_PLUGIN_LIST
file_selector_linux
pasteboard
irondash_engine_context
super_native_extensions
url_launcher_linux
)

Expand Down
6 changes: 4 additions & 2 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import Foundation
import device_info_plus
import file_selector_macos
import flutter_image_compress_macos
import irondash_engine_context
import package_info_plus
import pasteboard
import path_provider_foundation
import shared_preferences_foundation
import sqflite
import super_native_extensions
import url_launcher_macos
import video_compress
import video_player_avfoundation
Expand All @@ -22,11 +23,12 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FlutterImageCompressMacosPlugin.register(with: registry.registrar(forPlugin: "FlutterImageCompressMacosPlugin"))
IrondashEngineContextPlugin.register(with: registry.registrar(forPlugin: "IrondashEngineContextPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
SuperNativeExtensionsPlugin.register(with: registry.registrar(forPlugin: "SuperNativeExtensionsPlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
VideoCompressPlugin.register(with: registry.registrar(forPlugin: "VideoCompressPlugin"))
FVPVideoPlayerPlugin.register(with: registry.registrar(forPlugin: "FVPVideoPlayerPlugin"))
Expand Down
4 changes: 4 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ dependencies:
intl: ^0.18.0
table_calendar: ^3.0.9
shared_preferences: ^2.2.2
flutter_quill: ^9.2.2
flutter_localizations:
sdk: flutter
zeta_flutter: ^0.1.1+1
zds_flutter:
path: ../

Expand Down
9 changes: 6 additions & 3 deletions example/windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
#include "generated_plugin_registrant.h"

#include <file_selector_windows/file_selector_windows.h>
#include <pasteboard/pasteboard_plugin.h>
#include <irondash_engine_context/irondash_engine_context_plugin_c_api.h>
#include <super_native_extensions/super_native_extensions_plugin_c_api.h>
#include <url_launcher_windows/url_launcher_windows.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
PasteboardPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("PasteboardPlugin"));
IrondashEngineContextPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("IrondashEngineContextPluginCApi"));
SuperNativeExtensionsPluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("SuperNativeExtensionsPluginCApi"));
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}
3 changes: 2 additions & 1 deletion example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

list(APPEND FLUTTER_PLUGIN_LIST
file_selector_windows
pasteboard
irondash_engine_context
super_native_extensions
url_launcher_windows
)

Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/atoms/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class ZdsButton extends StatelessWidget {
isOnDarkBackground = false,
isDangerButton = false;

/// The Widget that will go inside the button, typically a [Text] with style [Theme.textTheme.titleMedium].
/// The Widget that will go inside the button, typically a [Text] with style [TextTheme.titleMedium].
///
/// Must not be null.
final Widget child;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/atoms/expandable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Duration _kFadeDuration = Duration(milliseconds: 200);
///
/// See also:
///
/// * [readMore], an alternative way of making a collapsible widget.
/// * [ExpandableTextExtension.readMore], an alternative way of making a collapsible widget.
class ZdsExpandable extends StatelessWidget {
/// A widget that can be collapsed and expanded.
const ZdsExpandable({
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/atoms/unread_badge_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class UnreadBadge extends StatelessWidget {
: Directionality.of(context) == TextDirection.ltr
? '$maximumNumber+'
: '+$maximumNumber',
textScaleFactor: MediaQuery.of(context).textScaleFactor > 1.35 ? 1.35 : null,
textScaler: MediaQuery.textScalerOf(context).clamp(maxScaleFactor: 1.35),
style: themeData.textTheme.bodySmall?.copyWith(
color: foregroundColor ?? (backgroundColor ?? themeData.colorScheme.error).onColor,
fontSize: max(themeData.textTheme.bodySmall?.fontSize ?? 0, minHeight * 0.65),
Expand Down
8 changes: 4 additions & 4 deletions lib/src/components/molecules/block_table.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:linked_scroll_controller/linked_scroll_controller.dart';

import '../../../../zds_flutter.dart';
import '../../../zds_flutter.dart';

/// Defines a header for a [ZdsBlockTable]
class ZdsBlockTableHeader {
Expand Down Expand Up @@ -139,7 +139,7 @@ class _BlockTable extends State<ZdsBlockTable> with WidgetsBindingObserver {
_tableBody = _controllers.addAndGet();

WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {
headerHeight = widget.rowHeaderHeight * MediaQuery.of(context).textScaleFactor;
headerHeight = widget.rowHeaderHeight;
buildTable();
});

Expand Down Expand Up @@ -230,7 +230,7 @@ class _BlockTable extends State<ZdsBlockTable> with WidgetsBindingObserver {
Container(
alignment: Alignment.center,
width: _getDayColumnWidth(),
height: 28 * MediaQuery.of(context).textScaleFactor,
height: 28,
color: themeData.colorScheme.surface,
child: Text(
items[index].text,
Expand Down Expand Up @@ -416,7 +416,7 @@ class _BlockTable extends State<ZdsBlockTable> with WidgetsBindingObserver {
return Container(
alignment: Alignment.center,
width: _getAssocColumnWidth(),
height: 28 * MediaQuery.of(context).textScaleFactor,
height: 28,
color: Theme.of(context).colorScheme.surface,
).paddingOnly(right: 1);
}
Expand Down
12 changes: 3 additions & 9 deletions lib/src/components/molecules/date_range_picker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';

import '../../../zds_flutter.dart';

const Size _calendarPortraitDialogSize = Size(330, 518);
Expand Down Expand Up @@ -257,10 +256,6 @@ class _DatePickerDialogState extends State<DatePickerDialog> with RestorationMix
final MaterialLocalizations localizations = MaterialLocalizations.of(context);
final Orientation orientation = MediaQuery.of(context).orientation;
final TextTheme textTheme = theme.textTheme;
// Constrain the textScaleFactor to the largest supported value to prevent
// layout issues.
final double textScaleFactor = math.min(MediaQuery.of(context).textScaleFactor, 1.3);

final String dateText = localizations.formatMediumDate(_selectedDate.value);
final Color onPrimarySurface =
colorScheme.brightness == Brightness.light ? colorScheme.onPrimary : colorScheme.onSurface;
Expand Down Expand Up @@ -371,7 +366,7 @@ class _DatePickerDialogState extends State<DatePickerDialog> with RestorationMix
entryModeButton: entryModeButton,
);

final Size dialogSize = _dialogSize(context) * textScaleFactor;
final Size dialogSize = _dialogSize(context);
return Dialog(
insetPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
clipBehavior: Clip.antiAlias,
Expand All @@ -382,7 +377,7 @@ class _DatePickerDialogState extends State<DatePickerDialog> with RestorationMix
curve: Curves.easeIn,
child: MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaleFactor: textScaleFactor,
textScaler: MediaQuery.textScalerOf(context).clamp(maxScaleFactor: 1.3),
),
child: Builder(
builder: (BuildContext context) {
Expand Down Expand Up @@ -1305,7 +1300,6 @@ class _ZdsDateRangePickerDialogState extends State<ZdsDateRangePickerDialog> wit
Widget build(BuildContext context) {
final MediaQueryData mediaQuery = MediaQuery.of(context);
final Orientation orientation = mediaQuery.orientation;
final double textScaleFactor = math.min(mediaQuery.textScaleFactor, 1.3);
final MaterialLocalizations localizations = MaterialLocalizations.of(context);
final ColorScheme colorScheme = Theme.of(context).colorScheme;
final Color onPrimarySurface =
Expand Down Expand Up @@ -1427,7 +1421,7 @@ class _ZdsDateRangePickerDialogState extends State<ZdsDateRangePickerDialog> wit
curve: Curves.easeIn,
child: MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaleFactor: textScaleFactor,
textScaler: MediaQuery.textScalerOf(context).clamp(maxScaleFactor: 1.3),
),
child: Builder(
builder: (BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/molecules/fields_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ZdsFieldsListTile<T> extends StatelessWidget {

/// The textStyle used for the starting elements of each field.
///
/// Defaults to [TextTheme.titleSmall] with [$color.zeta.text.default] color.
/// Defaults to [TextTheme.titleSmall] with [ZetaColorSwatch.text] color.
final TextStyle? fieldsStartTextStyle;

/// The textStyle used for the end elements of each field.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/molecules/network_avatar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ZdsNetworkAvatar extends StatelessWidget implements PreferredSizeWidget {
final Center initialsWidget = Center(
child: Text(
initials,
textScaleFactor: 1,
textScaler: MediaQuery.textScalerOf(context).clamp(maxScaleFactor: 1),
style: textStyle ??
themeData.textTheme.displaySmall?.copyWith(
color: (backgroundColor ?? themeData.colorScheme.secondary).onColor,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/molecules/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import '../../../../zds_flutter.dart';

/// Variants of [ZdsSearchField].
enum ZdsSearchFieldVariant {
/// Creates a Search field with a border on all edges of color [ZetaColors.warm.60].
/// Creates a Search field with a border on all edges of color `ZetaColors.warm.60`.
outlined,

/// Creates a Search field with a box shadow around the edges with a radius of 4.
Expand Down
4 changes: 2 additions & 2 deletions lib/src/components/molecules/selectable_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import '../../../../zds_flutter.dart';
///
/// There are two variants:
/// * [ZdsSelectableListTile], which returns a list tile that changes its color when selected.
/// When a listTile is marked as selected, its background will be colored with the [Theme.colorScheme.secondary] at 10%
/// opacity. When it's unselected, the background will use [Theme.colorScheme.surface]
/// When a listTile is marked as selected, its background will be colored with the [ColorScheme.secondary] at 10%
/// opacity. When it's unselected, the background will use [ColorScheme.surface]
/// * [ZdsSelectableListTile.checkable], which returns a list tile that adds a check at the end of the tile when selected.
///
/// This widget does not manage its own state, but should rather be rebuilt by the parent widget's state through
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/molecules/sheet_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ZdsSheetHeader extends StatelessWidget implements PreferredSizeWidget {
headerText,
style: headerTextStyle ?? themeData.textTheme.headlineMedium,
overflow: TextOverflow.ellipsis,
textScaleFactor: MediaQuery.of(context).textScaleFactor > 2 ? 2 : null,
textScaler: MediaQuery.textScalerOf(context).clamp(maxScaleFactor: 2),
),
).paddingOnly(bottom: 5),
if (leading != null)
Expand Down
5 changes: 2 additions & 3 deletions lib/src/components/molecules/slidable_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,8 @@ class CustomSlidableAction extends StatelessWidget {
/// {@template slidable.actions.foregroundColor}
/// The foreground color of this action.
///
/// Defaults to [Colors.black] if [backgroundColor]'s brightness is
/// [Brightness.light], or to [Colors.white] if [backgroundColor]'s brightness is
/// [Brightness.dark].
/// Defaults to [Colors.black] if the background brightness is [Brightness.light],
/// or to [Colors.white] if background brightness is [Brightness.dark].s
/// {@endtemplate}
final Color? foregroundColor;

Expand Down
3 changes: 1 addition & 2 deletions lib/src/components/molecules/stats_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ class ZdsStatCard extends StatelessWidget {
final ZdsCardVariant? cardVariant;

bool _isVertical(BuildContext context, BoxConstraints constraints) {
final double scale = MediaQuery.of(context).textScaleFactor;
final double totalPadding = stats.length * 2 * _padding;
final double totalDividers = _dividerWidth * 0.5 * (stats.length - 1);
final double width = ((totalDividers + totalPadding - constraints.maxWidth) / -stats.length) / scale;
final double width = (totalDividers + totalPadding - constraints.maxWidth) / -stats.length;
for (int i = 0; i < stats.length; i++) {
final bool description = hasTextOverflow(stats[i].description, Theme.of(context).textTheme.bodySmall!, width);
final bool value = hasTextOverflow(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/components/organisms/bottom_tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class _ZdsBottomTabBarTile extends StatelessWidget {
child: Text(
label,
style: labelStyle,
textScaleFactor: MediaQuery.of(context).textScaleFactor > 1.35 ? 1.35 : null,
textScaler: MediaQuery.textScalerOf(context).clamp(maxScaleFactor: 1.35),
),
),
],
Expand Down
Loading

0 comments on commit 635dfb3

Please sign in to comment.