Skip to content

Commit

Permalink
Merge branch 'feature/tooltip' of https://github.com/forus-labs/forui
Browse files Browse the repository at this point in the history
…into feature/tooltip
  • Loading branch information
Pante committed Aug 31, 2024
2 parents cb4cb9e + 6c15c7b commit e94c4b8
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 28 deletions.
4 changes: 3 additions & 1 deletion forui/lib/src/foundation/platform.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:flutter/foundation.dart';

import 'package:meta/meta.dart';

@internal

/// The platforms that are primarily touch enabled. It isn't 100% accurate but it is a good approximation.
const touchPlatforms = { TargetPlatform.android, TargetPlatform.iOS, TargetPlatform.fuchsia };
const touchPlatforms = {TargetPlatform.android, TargetPlatform.iOS, TargetPlatform.fuchsia};
29 changes: 16 additions & 13 deletions forui/lib/src/theme/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,25 +103,28 @@ class FTheme extends StatelessWidget {
data: data,
child: Directionality(
textDirection: textDirection ?? Directionality.of(context),
child: Overlay.maybeOf(context) == null ? Overlay( // TODO: temporary until we create FApp.
initialEntries: [
OverlayEntry(
builder: (context) => DefaultTextStyle(
child: Overlay.maybeOf(context) == null
? Overlay(
// TODO: temporary until we create FApp.
initialEntries: [
OverlayEntry(
builder: (context) => DefaultTextStyle(
style: data.typography.base.copyWith(
fontFamily: data.typography.defaultFontFamily,
color: data.colorScheme.foreground,
),
child: child,
),
),
],
)
: DefaultTextStyle(
style: data.typography.base.copyWith(
fontFamily: data.typography.defaultFontFamily,
color: data.colorScheme.foreground,
),
child: child,
),
),
],
) : DefaultTextStyle(
style: data.typography.base.copyWith(
fontFamily: data.typography.defaultFontFamily,
color: data.colorScheme.foreground,
),
child: child,
),
),
);

Expand Down
2 changes: 1 addition & 1 deletion forui/lib/src/widgets/popover.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:forui/src/foundation/platform.dart';

import 'package:meta/meta.dart';

import 'package:forui/forui.dart';
import 'package:forui/src/foundation/platform.dart';

/// A controller that controls whether a [FPopover] is shown or hidden.
final class FPopoverController extends ChangeNotifier {
Expand Down
2 changes: 1 addition & 1 deletion forui/lib/src/widgets/resizable/resizable.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:forui/src/foundation/platform.dart';

import 'package:meta/meta.dart';
import 'package:sugar/sugar.dart';

import 'package:forui/forui.dart';
import 'package:forui/src/foundation/platform.dart';
import 'package:forui/src/widgets/resizable/divider.dart';

/// A resizable allows its children to be resized along either the horizontal or vertical main axis.
Expand Down
22 changes: 12 additions & 10 deletions forui/lib/src/widgets/tabs/tabs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ class _FTabsState extends State<FTabs> with SingleTickerProviderStateMixin {
@override
void initState() {
super.initState();
_controller = widget.controller ?? FTabController(
initialIndex: widget.initialIndex,
length: widget.tabs.length,
vsync: this,
);
_controller = widget.controller ??
FTabController(
initialIndex: widget.initialIndex,
length: widget.tabs.length,
vsync: this,
);
}

@override
Expand All @@ -123,11 +124,12 @@ class _FTabsState extends State<FTabs> with SingleTickerProviderStateMixin {
_controller.dispose();
}

_controller = widget.controller ?? FTabController(
initialIndex: widget.initialIndex,
length: widget.tabs.length,
vsync: this,
);
_controller = widget.controller ??
FTabController(
initialIndex: widget.initialIndex,
length: widget.tabs.length,
vsync: this,
);
}
}

Expand Down
4 changes: 3 additions & 1 deletion forui/lib/src/widgets/tooltip.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';

import 'package:meta/meta.dart';

import 'package:forui/forui.dart';
import 'package:forui/src/foundation/platform.dart';
import 'package:meta/meta.dart';

/// A controller that controls whether a [FPopover] is shown or hidden.
final class FTooltipController extends ChangeNotifier {
Expand Down
2 changes: 1 addition & 1 deletion forui/test/src/widgets/tooltip/tooltip_golden_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ void main() {
});
});
}
}
}

0 comments on commit e94c4b8

Please sign in to comment.