Skip to content

Commit

Permalink
Code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cenomla committed Apr 27, 2021
1 parent 9d1c810 commit 6c7f683
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions flokk_src/lib/_internal/components/animated_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AnimatedPanel extends StatefulWidget {
final double closedY;
final double duration;
final Curve curve;
final Widget? child;
final Widget child;

const AnimatedPanel(
{Key? key,
Expand All @@ -16,7 +16,7 @@ class AnimatedPanel extends StatefulWidget {
this.closedY = 0,
this.duration = .35,
this.curve = Curves.easeOut,
this.child})
required this.child})
: super(key: key);

@override
Expand Down
4 changes: 2 additions & 2 deletions flokk_src/lib/_internal/components/fading_index_stack.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class FadingIndexedStack extends StatefulWidget {

const FadingIndexedStack({
Key? key,
this.index = 0,
this.children = const <Widget>[],
required this.index,
required this.children,
this.duration = const Duration(
milliseconds: 250,
),
Expand Down
2 changes: 1 addition & 1 deletion flokk_src/lib/_internal/components/pinned_stack.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PinnedStack extends StatelessWidget {

const PinnedStack(
{Key? key,
this.children = const <Widget>[],
required this.children,
this.fit = StackFit.expand,
this.alignment = Alignment.topLeft,
this.textDirection = TextDirection.ltr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ConstrainedFlexView extends StatelessWidget {
final EdgeInsets scrollPadding;

const ConstrainedFlexView(this.minSize,
{Key? key, required this.child, this.axis = Axis.vertical, required this.scrollPadding})
{Key? key, required this.child, this.axis = Axis.vertical, this.scrollPadding = const EdgeInsets.all(0)})
: super(key: key);

bool get isHz => axis == Axis.horizontal;
Expand Down
4 changes: 2 additions & 2 deletions flokk_src/lib/_internal/components/seperated_flexibles.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SeparatedRow extends StatelessWidget {

const SeparatedRow({
Key? key,
this.children = const <Widget>[],
required this.children,
this.separatorBuilder,
this.mainAxisAlignment = MainAxisAlignment.start,
this.crossAxisAlignment = CrossAxisAlignment.center,
Expand Down Expand Up @@ -54,7 +54,7 @@ class SeparatedColumn extends StatelessWidget {

const SeparatedColumn({
Key? key,
this.children = const <Widget>[],
required this.children,
this.separatorBuilder,
this.mainAxisAlignment = MainAxisAlignment.start,
this.crossAxisAlignment = CrossAxisAlignment.center,
Expand Down
2 changes: 1 addition & 1 deletion flokk_src/lib/_internal/components/simple_grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SimpleGrid extends StatelessWidget {
Key? key,
this.hSpace = 0,
this.vSpace = 0,
this.kids = const<Widget>[],
required this.kids,
this.colCount = 2,
this.kidHeight = 40,
this.align = CrossAxisAlignment.start,
Expand Down
3 changes: 2 additions & 1 deletion flokk_src/lib/_internal/utils/string_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import 'package:flutter/material.dart';

class StringUtils {
static bool isEmpty(String? s) {
return (s ?? "").trim().isEmpty;
if (s == null) return true;
return s.trim().isEmpty;
}

static bool isNotEmpty(String s) => !isEmpty(s);
Expand Down
2 changes: 1 addition & 1 deletion flokk_src/lib/_internal/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Utils {
static bool get isMouseConnected => RendererBinding.instance?.mouseTracker.mouseIsConnected ?? false;

static void unFocus() {
WidgetsBinding.instance?.focusManager.primaryFocus?.unfocus();
primaryFocus?.unfocus();
}

static void benchmark(String name, void Function() test) {
Expand Down

0 comments on commit 6c7f683

Please sign in to comment.