-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactoring and updates * Improvements and refactoring * New home screen * Format * Update config * Don't extract version from FVM * Removed intl_utils from CI
- Loading branch information
1 parent
c51ae3d
commit adf99cc
Showing
26 changed files
with
257 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"flutterSdkVersion": "3.16.0", | ||
"flavors": {} | ||
"flutterSdkVersion": "3.19.4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"flutter": "3.19.4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,27 +18,21 @@ jobs: | |
- name: 📚 Git Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get Flutter Version From FVM config | ||
id: get_flutter_version | ||
run: echo "::set-output name=version::$(cat .fvm/fvm_config.json | jq -r '.flutterSdkVersion')" | ||
|
||
- name: 🐦 Setup Flutter | ||
uses: subosito/[email protected] | ||
with: | ||
flutter-version: ${{ steps.get_flutter_version.outputs.version }} | ||
flutter-version: 3.19.4 | ||
channel: stable | ||
cache: true | ||
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }} | ||
|
||
- name: 📦 Install Dependencies | ||
run: | | ||
flutter pub global activate very_good_cli | ||
flutter pub global activate intl_utils | ||
flutter pub global activate coverage | ||
- name: 🦄 Generate Code | ||
run: | | ||
flutter pub global run intl_utils:generate | ||
dart run build_runner build --delete-conflicting-outputs | ||
- name: Install DCM | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,4 +140,6 @@ pubspec.lock | |
.metadata | ||
|
||
# FVM | ||
.fvm/flutter_sdk | ||
|
||
# FVM Version Cache | ||
.fvm/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
arb-dir: lib/src/core/localization/translations | ||
arb-dir: lib/src/core/constant/localization/translations | ||
template-arb-file: intl_en.arb | ||
output-localization-file: app_localizations.dart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export 'material_spacing.dart'; | ||
export 'window_size.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import 'dart:math' as math; | ||
|
||
import 'package:flutter/widgets.dart'; | ||
import 'package:sizzle_starter/src/core/utils/layout/layout.dart'; | ||
|
||
/// {@template material_spacer} | ||
/// A spacer refers to the space between two panes in a layout. | ||
/// | ||
/// Spacers measure 24dp wide. | ||
/// {@endtemplate} | ||
class MaterialSpacer extends StatelessWidget { | ||
/// {@macro material_spacer} | ||
const MaterialSpacer({super.key, this.spacing = 24}); | ||
|
||
/// Creates a spacer that is 24dp wide. | ||
final double spacing; | ||
|
||
@override | ||
Widget build(BuildContext context) => SizedBox(width: spacing); | ||
} | ||
|
||
/// {@template horizontal_spacing} | ||
/// Spacing that is applied to element to both the left and right. | ||
/// {@endtemplate} | ||
class HorizontalSpacing extends EdgeInsets { | ||
const HorizontalSpacing._(final double value) | ||
: super.symmetric(horizontal: value); | ||
|
||
/// Horizontal spacing for [WindowSize.compact]. | ||
const HorizontalSpacing.compact() : this._(16); | ||
|
||
/// Horizontal spacing for [WindowSize.medium]+. | ||
const HorizontalSpacing.mediumUp() : this._(24); | ||
|
||
/// Spacing that is used to center | ||
/// the element and keep at width of [maxWidth] | ||
/// | ||
/// [windowWidth] is the width of a window. | ||
factory HorizontalSpacing.centered( | ||
double windowWidth, [ | ||
double maxWidth = 768, | ||
]) => | ||
HorizontalSpacing._(math.max((windowWidth - maxWidth) / 2, 16)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import 'package:flutter/rendering.dart'; | ||
import 'package:flutter/widgets.dart'; | ||
|
||
/// A breakpoint that is used to determine the layout of the application. | ||
/// | ||
/// It follows the Material Design guidelines for breakpoints. | ||
/// | ||
/// See more: | ||
/// - https://m3.material.io/foundations/layout/applying-layout | ||
enum WindowSize { | ||
/// Layouts for compact window size classes | ||
/// are for screen widths smaller than 600dp. | ||
compact._(0, 600), | ||
|
||
/// Layouts for medium window size classes | ||
/// are for screen widths from 600dp to 839dp. | ||
medium._(600, 839), | ||
|
||
/// Layouts for expanded window size classes | ||
/// are for screen widths 840dp to 1199dp. | ||
expanded._(840, 1199), | ||
|
||
/// Layouts for large window size classes | ||
/// are for screen widths from 1200dp to 1599dp. | ||
large._(1200, 1599), | ||
|
||
/// Layouts for extra-large window size classes | ||
/// are for screen widths of 1600dp and larger. | ||
extraLarge._(1600, double.infinity); | ||
|
||
/// The minimum width of the breakpoint. | ||
final double min; | ||
|
||
/// The maximum width of the breakpoint. | ||
final double max; | ||
|
||
/// Returns whether the given width is in the range of the breakpoint. | ||
bool isInRange(double width) => width >= min && width <= max; | ||
|
||
/// Returns whether the given width isless than | ||
/// the minimum width of the breakpoint. | ||
bool operator <(WindowSize other) => max < other.min; | ||
|
||
/// Returns whether the given width is greater than | ||
/// the maximum width of the breakpoint. | ||
bool operator >(WindowSize other) => min > other.max; | ||
|
||
/// Returns whether the given width is less than | ||
/// or equal to the maximum width of the breakpoint. | ||
bool operator <=(WindowSize other) => max <= other.max; | ||
|
||
/// Returns whether the given width is greater than | ||
/// or equal to the minimum width of the breakpoint. | ||
bool operator >=(WindowSize other) => min >= other.min; | ||
|
||
/// If the breakpoint is compact. | ||
bool get isCompact => this == WindowSize.compact; | ||
|
||
/// If the breakpoint is medium. | ||
bool get isMedium => this == WindowSize.medium; | ||
|
||
/// If the breakpoint is expanded. | ||
bool get isExpanded => this == WindowSize.expanded; | ||
|
||
/// If the breakpoint is large. | ||
bool get isLarge => this == WindowSize.large; | ||
|
||
/// If the breakpoint is extra-large. | ||
bool get isExtraLarge => this == WindowSize.extraLarge; | ||
|
||
const WindowSize._(this.min, this.max); | ||
} | ||
|
||
/// A set of extensions for [WindowSize] on [BoxConstraints]. | ||
extension WindowSizeConstrainsExtension on BoxConstraints { | ||
/// Returns the [WindowSize] for the given constraints. | ||
WindowSize get materialBreakpoint { | ||
final side = biggest.width; | ||
|
||
if (WindowSize.compact.isInRange(side)) { | ||
return WindowSize.compact; | ||
} else if (WindowSize.medium.isInRange(side)) { | ||
return WindowSize.medium; | ||
} else if (WindowSize.expanded.isInRange(side)) { | ||
return WindowSize.expanded; | ||
} else if (WindowSize.large.isInRange(side)) { | ||
return WindowSize.large; | ||
} | ||
|
||
return WindowSize.extraLarge; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.