Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ refactor: RepoCountをtypedefからclassに変更
Issue #145
- Loading branch information
Showing
11 changed files
with
352 additions
and
105 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,21 @@ | ||
// Copyright 2022 susatthi All rights reserved. | ||
// Use of this source code is governed by a MIT license that can be | ||
// found in the LICENSE file. | ||
|
||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:number_display/number_display.dart'; | ||
|
||
part 'repo_count.freezed.dart'; | ||
|
||
/// カウント | ||
@freezed | ||
class RepoCount with _$RepoCount { | ||
const factory RepoCount( | ||
int value, | ||
) = _RepoCount; | ||
} | ||
|
||
extension RepoCountHelper on RepoCount { | ||
/// 表示用(例:35432 => 35.4k) | ||
String get display => createDisplay(length: 4)(value); | ||
} |
Oops, something went wrong.