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
MyClass nonConstMyClass(int value) => MyClass(value); | |
void main() { | |
test('ValueEquality', (){ | |
final a = nonConstMyClass(1); | |
final b = nonConstMyClass(2); | |
expect(a, b); | |
}); | |
} |
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
void main() { | |
test('Value equality', () { | |
const a = MyClass(1); | |
const b = MyClass(1); | |
expect(a, b); // The props is not invoked. | |
}); | |
} |
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
abstract class Equatable { | |
/// {@macro equatable} | |
const Equatable(); | |
... | |
@override | |
bool operator ==(Object other) => | |
identical(this, other) || | |
other is Equatable && | |
runtimeType == other.runtimeType && |
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
class MyClass extends Equatable { | |
const MyClass(this.id); | |
final int id; | |
@override | |
List<Object> get props => [id]; | |
} |
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
class ConstantClass{ | |
const ConstantClass({ | |
required this.arg1, | |
required this.arg2, | |
required this.arg3, | |
}); | |
final int arg1; | |
final int arg2; | |
final int arg3; |
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
empty |
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
Widget _kDefaultWidget<T>(T value, BuildContext _) => Text('Error.'); | |
typedef BuilderFunction<T> = Widget Function(T value, BuildContext context); | |
typedef ListenerFunction<T> = void Function(T value, BuildContext context); | |
class MatchCase<Q> { | |
MatchCase( | |
this.matcher, | |
this.builder, |
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
class NewIntCaseWidget extends CaseWidget<int> { | |
NewIntCaseWidget({ | |
super.key, | |
required int super.value, | |
}) { | |
onEquals(0, (value, context) => Text('Value is zero')); | |
onEquals(1, (value, context) => Text('Value is 1')); | |
onLessThan(1, (value, context) => Text('Value is less than 1')); | |
onGreaterThan(1, (value, context) => Text('Value is greater than 1')); |
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
import 'package:injectable/injectable.dart'; | |
/// {@template app_environment} | |
/// Use [AppEnvironment] to provide/access some information about the Environment app is | |
/// running. | |
/// | |
/// Access [AppEnvironment] name with the [name] property. | |
/// | |
/// Currently has supported 3 environments: | |
/// 1. [AppEnvironment.development] : Use it for develop dependencies. This is |
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
// GENERATED CODE - DO NOT MODIFY BY HAND | |
// ************************************************************************** | |
// InjectableConfigGenerator | |
// ************************************************************************** | |
// ignore_for_file: no_leading_underscores_for_library_prefixes | |
import 'package:app_version_config_repository/app_version_config_repository.dart' | |
as _i7; | |
import 'package:flutter_boilerplate/domain/app_versioning/service_contracts/app_versioning_service_contract.dart' |
NewerOlder