Skip to content

Commit

Permalink
Enable prefer_relative_imports rule
Browse files Browse the repository at this point in the history
  • Loading branch information
fujidaiti committed Apr 18, 2024
1 parent c96305a commit 722ccc2
Show file tree
Hide file tree
Showing 22 changed files with 65 additions and 58 deletions.
1 change: 1 addition & 0 deletions package/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ linter:
flutter_style_todos: false
cascade_invocations: false
join_return_with_assignment: false
prefer_relative_imports: true
2 changes: 1 addition & 1 deletion package/lib/smooth_sheets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export 'src/foundation/animation.dart';
export 'src/foundation/framework.dart';
export 'src/foundation/keyboard_dismissible.dart';
export 'src/foundation/notifications.dart';
export 'src/foundation/physics.dart';
export 'src/foundation/sheet_activity.dart';
export 'src/foundation/sheet_content_scaffold.dart';
export 'src/foundation/sheet_controller.dart' hide SheetControllerScope;
export 'src/foundation/sheet_extent.dart';
export 'src/foundation/physics.dart';
export 'src/foundation/theme.dart';
export 'src/modal/cupertino.dart';
export 'src/modal/modal_sheet.dart';
Expand Down
2 changes: 1 addition & 1 deletion package/lib/src/draggable/draggable_sheet.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:smooth_sheets/smooth_sheets.dart';
import '../../smooth_sheets.dart';

/// A sheet that can be dragged.
///
Expand Down
9 changes: 5 additions & 4 deletions package/lib/src/draggable/sheet_draggable.dart
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/widgets.dart';
import 'package:smooth_sheets/src/draggable/draggable_sheet.dart';
import 'package:smooth_sheets/src/foundation/sheet_activity.dart';
import 'package:smooth_sheets/src/foundation/sheet_extent.dart';
import 'package:smooth_sheets/src/scrollable/scrollable_sheet.dart';

import '../foundation/sheet_activity.dart';
import '../foundation/sheet_extent.dart';
import '../scrollable/scrollable_sheet.dart';
import 'draggable_sheet.dart';

/// A widget that makes its child as a drag-handle for a sheet.
///
Expand Down
4 changes: 2 additions & 2 deletions package/lib/src/foundation/animation.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/animation.dart';
import 'package:smooth_sheets/src/foundation/sheet_controller.dart';
import 'package:smooth_sheets/src/foundation/sheet_extent.dart';
import 'sheet_controller.dart';
import 'sheet_extent.dart';

class ExtentDrivenAnimation extends Animation<double> {
ExtentDrivenAnimation({
Expand Down
4 changes: 2 additions & 2 deletions package/lib/src/foundation/framework.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:smooth_sheets/src/foundation/sheet_controller.dart';
import 'package:smooth_sheets/src/foundation/sheet_extent.dart';
import 'sheet_controller.dart';
import 'sheet_extent.dart';

class SheetContainer extends StatelessWidget {
const SheetContainer({
Expand Down
4 changes: 2 additions & 2 deletions package/lib/src/foundation/keyboard_dismissible.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/widgets.dart';
import 'package:smooth_sheets/src/draggable/draggable_sheet.dart';
import 'package:smooth_sheets/src/foundation/notifications.dart';
import '../draggable/draggable_sheet.dart';
import 'notifications.dart';

/// A widget that dismisses the on-screen keyboard when the user
/// drags the sheet below this widget.
Expand Down
5 changes: 3 additions & 2 deletions package/lib/src/foundation/notifications.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/widgets.dart';
import 'package:smooth_sheets/src/foundation/sheet_extent.dart';
import 'package:smooth_sheets/src/foundation/physics.dart';

import 'physics.dart';
import 'sheet_extent.dart';

/// A [Notification] that is dispatched when the sheet extent changes.
///
Expand Down
5 changes: 3 additions & 2 deletions package/lib/src/foundation/physics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import 'dart:ui';
import 'package:collection/collection.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/widgets.dart';
import 'package:smooth_sheets/src/foundation/sheet_extent.dart';
import 'package:smooth_sheets/src/internal/double_utils.dart';

import '../internal/double_utils.dart';
import 'sheet_extent.dart';

const _minSettlingDuration = Duration(milliseconds: 160);
const _defaultSettlingSpeed = 600.0; // logical pixels per second
Expand Down
4 changes: 2 additions & 2 deletions package/lib/src/foundation/sheet_activity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import 'dart:math';
import 'package:flutter/gestures.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/widgets.dart';
import 'package:smooth_sheets/smooth_sheets.dart';
import 'package:smooth_sheets/src/foundation/sheet_status.dart';
import '../../smooth_sheets.dart';
import 'sheet_status.dart';

abstract class SheetActivity extends ChangeNotifier {
bool _mounted = false;
Expand Down
2 changes: 1 addition & 1 deletion package/lib/src/foundation/sheet_content_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:math';

import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:smooth_sheets/smooth_sheets.dart';
import '../../smooth_sheets.dart';

class SheetContentScaffold extends StatelessWidget {
const SheetContentScaffold({
Expand Down
2 changes: 1 addition & 1 deletion package/lib/src/foundation/sheet_controller.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/scheduler.dart';
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
import 'package:smooth_sheets/src/foundation/sheet_extent.dart';
import 'sheet_extent.dart';

class SheetController extends ChangeNotifier
implements ValueListenable<double?> {
Expand Down
7 changes: 4 additions & 3 deletions package/lib/src/foundation/sheet_extent.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import 'package:flutter/widgets.dart';
import 'package:smooth_sheets/smooth_sheets.dart';
import 'package:smooth_sheets/src/foundation/sheet_status.dart';
import 'package:smooth_sheets/src/internal/double_utils.dart';

import '../../smooth_sheets.dart';
import '../internal/double_utils.dart';
import 'sheet_status.dart';

/// A representation of a visible height of the sheet.
///
Expand Down
2 changes: 1 addition & 1 deletion package/lib/src/foundation/theme.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/widgets.dart';
import 'package:smooth_sheets/src/foundation/keyboard_dismissible.dart';
import 'keyboard_dismissible.dart';

/// A theme for descendant sheets.
///
Expand Down
6 changes: 3 additions & 3 deletions package/lib/src/modal/cupertino.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import 'dart:math';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:smooth_sheets/smooth_sheets.dart';
import 'package:smooth_sheets/src/internal/double_utils.dart';
import 'package:smooth_sheets/src/modal/modal_sheet.dart';
import '../../smooth_sheets.dart';
import '../internal/double_utils.dart';
import 'modal_sheet.dart';

const _minimizedViewportScale = 0.92;
const _cupertinoBarrierColor = Color(0x18000000);
Expand Down
8 changes: 4 additions & 4 deletions package/lib/src/modal/modal_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import 'dart:math';
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:smooth_sheets/src/foundation/sheet_controller.dart';
import 'package:smooth_sheets/src/foundation/sheet_status.dart';
import 'package:smooth_sheets/src/internal/double_utils.dart';
import 'package:smooth_sheets/src/internal/monodrag.dart';
import '../foundation/sheet_controller.dart';
import '../foundation/sheet_status.dart';
import '../internal/double_utils.dart';
import '../internal/monodrag.dart';

const _minFlingVelocityToDismiss = 1.0;
const _minDragDistanceToDismiss = 100.0; // Logical pixels.
Expand Down
10 changes: 5 additions & 5 deletions package/lib/src/navigation/navigation_route.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'package:flutter/material.dart';
import 'package:smooth_sheets/src/foundation/framework.dart';
import 'package:smooth_sheets/src/foundation/sheet_activity.dart';
import 'package:smooth_sheets/src/foundation/sheet_extent.dart';
import 'package:smooth_sheets/src/foundation/sheet_status.dart';
import 'package:smooth_sheets/src/navigation/navigation_sheet.dart';
import '../foundation/framework.dart';
import '../foundation/sheet_activity.dart';
import '../foundation/sheet_extent.dart';
import '../foundation/sheet_status.dart';
import 'navigation_sheet.dart';

mixin NavigationSheetRouteMixin<T> on NavigationSheetRoute<T> {
SheetExtentConfig get pageExtentConfig;
Expand Down
4 changes: 2 additions & 2 deletions package/lib/src/navigation/navigation_routes.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:smooth_sheets/smooth_sheets.dart';
import 'package:smooth_sheets/src/scrollable/scrollable_sheet.dart';
import '../../smooth_sheets.dart';
import '../scrollable/scrollable_sheet.dart';

class ScrollableNavigationSheetRoute<T> extends NavigationSheetRoute<T>
with NavigationSheetRouteMixin<T> {
Expand Down
19 changes: 10 additions & 9 deletions package/lib/src/navigation/navigation_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:smooth_sheets/src/foundation/framework.dart';
import 'package:smooth_sheets/src/foundation/keyboard_dismissible.dart';
import 'package:smooth_sheets/src/foundation/sheet_activity.dart';
import 'package:smooth_sheets/src/foundation/sheet_controller.dart';
import 'package:smooth_sheets/src/foundation/sheet_extent.dart';
import 'package:smooth_sheets/src/foundation/physics.dart';
import 'package:smooth_sheets/src/foundation/sheet_status.dart';
import 'package:smooth_sheets/src/foundation/theme.dart';
import 'package:smooth_sheets/src/internal/transition_observer.dart';

import '../foundation/framework.dart';
import '../foundation/keyboard_dismissible.dart';
import '../foundation/physics.dart';
import '../foundation/sheet_activity.dart';
import '../foundation/sheet_controller.dart';
import '../foundation/sheet_extent.dart';
import '../foundation/sheet_status.dart';
import '../foundation/theme.dart';
import '../internal/transition_observer.dart';

typedef NavigationSheetTransitionObserver = TransitionObserver;

Expand Down
4 changes: 2 additions & 2 deletions package/lib/src/scrollable/scrollable_sheet.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:meta/meta.dart';
import 'package:smooth_sheets/smooth_sheets.dart';
import 'package:smooth_sheets/src/scrollable/scrollable_sheet_extent.dart';
import '../../smooth_sheets.dart';
import 'scrollable_sheet_extent.dart';

class ScrollableSheet extends StatelessWidget {
const ScrollableSheet({
Expand Down
15 changes: 8 additions & 7 deletions package/lib/src/scrollable/scrollable_sheet_extent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import 'dart:math';

import 'package:flutter/material.dart';
import 'package:meta/meta.dart';
import 'package:smooth_sheets/src/foundation/sheet_activity.dart';
import 'package:smooth_sheets/src/foundation/sheet_extent.dart';
import 'package:smooth_sheets/src/foundation/physics.dart';
import 'package:smooth_sheets/src/foundation/sheet_status.dart';
import 'package:smooth_sheets/src/internal/double_utils.dart';
import 'package:smooth_sheets/src/scrollable/delegatable_scroll_position.dart';
import 'package:smooth_sheets/src/scrollable/scrollable_sheet_physics.dart';

import '../foundation/physics.dart';
import '../foundation/sheet_activity.dart';
import '../foundation/sheet_extent.dart';
import '../foundation/sheet_status.dart';
import '../internal/double_utils.dart';
import 'delegatable_scroll_position.dart';
import 'scrollable_sheet_physics.dart';

class ScrollableSheetExtentConfig extends SheetExtentConfig {
const ScrollableSheetExtentConfig({
Expand Down
4 changes: 2 additions & 2 deletions package/lib/src/scrollable/scrollable_sheet_physics.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:smooth_sheets/src/foundation/sheet_extent.dart';
import 'package:smooth_sheets/src/foundation/physics.dart';
import '../foundation/physics.dart';
import '../foundation/sheet_extent.dart';

class ScrollableSheetPhysics extends SheetPhysics {
const ScrollableSheetPhysics({
Expand Down

0 comments on commit 722ccc2

Please sign in to comment.