Skip to content

Commit

Permalink
🎨 refactoring code.
Browse files Browse the repository at this point in the history
  • Loading branch information
iota9star committed Nov 21, 2020
1 parent 625798d commit 6d567f9
Show file tree
Hide file tree
Showing 7 changed files with 517 additions and 504 deletions.
3 changes: 1 addition & 2 deletions lib/internal/extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ extension IterableExt<T> on Iterable<T> {
bool eq(Iterable<T> other) {
if (this == null) return other == null;
if (other == null || this.length != other.length) return false;
if (!identical(this, other)) return false;
for (int index = 0; index < this.length; index += 1) {
if (this.elementAt(index) != other.elementAt(index)) return false;
}
Expand All @@ -41,12 +40,12 @@ extension ListExt<T> on List<T> {
bool eq(List<T> other) {
if (this == null) return other == null;
if (other == null || this.length != other.length) return false;
if (!identical(this, other)) return false;
for (int index = 0; index < this.length; index += 1) {
if (this[index] != other[index]) return false;
}
return true;
}
static a(){}

bool ne(List<T> other) => !this.eq(other);
}
Expand Down
16 changes: 4 additions & 12 deletions lib/ui/fragments/index_fragment.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class IndexFragment extends StatelessWidget {
final Color backgroundColor = Theme.of(context).backgroundColor;
final Color scaffoldBackgroundColor =
Theme.of(context).scaffoldBackgroundColor;
final Color headline3Color = Theme.of(context).textTheme.subtitle1.color;
final Color subtitleColor = Theme.of(context).textTheme.subtitle1.color;
final IndexModel indexModel =
Provider.of<IndexModel>(context, listen: false);
return Scaffold(
Expand Down Expand Up @@ -99,7 +99,7 @@ class IndexFragment extends StatelessWidget {
return [
_buildWeekSection(
scaffoldBackgroundColor,
headline3Color,
subtitleColor,
bangumiRow,
),
BangumiSliverGridFragment(
Expand All @@ -118,7 +118,7 @@ class IndexFragment extends StatelessWidget {

Widget _buildWeekSection(
final Color scaffoldBackgroundColor,
final Color headline3Color,
final Color subtitleColor,
final BangumiRow bangumiRow,
) {
final simple = [
Expand All @@ -145,14 +145,6 @@ class IndexFragment extends StatelessWidget {
),
decoration: BoxDecoration(
color: scaffoldBackgroundColor,
// boxShadow: [
// BoxShadow(
// offset: Offset(0, 4.0),
// blurRadius: 12.0,
// spreadRadius: -12.0,
// color: Colors.black26,
// )
// ],
),
child: Row(
mainAxisSize: MainAxisSize.max,
Expand All @@ -173,7 +165,7 @@ class IndexFragment extends StatelessWidget {
child: Text(
simple,
style: TextStyle(
color: headline3Color,
color: subtitleColor,
fontSize: 12.0,
height: 1.25,
),
Expand Down
Loading

0 comments on commit 6d567f9

Please sign in to comment.