Skip to content

Instantly share code, notes, and snippets.

View daiki1003's full-sized avatar
🏠
Working from home

ashdik daiki1003

🏠
Working from home
View GitHub Profile
void misbehave() {
try {
dynamic foo = true;
print(foo++);
} catch (e) {
print('misbehave() partially handled ${e.runtimeType}.');
rethrow;
print('after rethrow'); // 呼ばれない
}
}
enum Sample<T> {
hoge<int>(value: 0),
fuga<String>(value: 'I\'m fuga'),
withNull<int?>(value: null),
;
const Sample({required this.value});
final T value;
}
...
...
...
...
[ ] executing: /usr/bin/arch -arm64e xcrun xcodebuild -exportArchive -allowProvisioningDeviceRegistration -allowProvisioningUpdates -archivePath /path/to/repo/build/ios/archive/Runner.xcarchive -exportPath /path/to/repo/build/ios/ipa -exportOptionsPlist /var/folders/w6/qxkr32dx1lldsm0_9zhlhsqm0000gn/T/flutter_tools.D1BNO4/flutter_build_ios.WdfAVw/ExportOptions.plist
[+14308 ms] ** EXPORT FAILED **
2023-03-19 03:13:55.914 xcodebuild[87646:62234695] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/w6/qxkr32dx1lldsm0_9zhlhsqm0000gn/T/Runner_2023-03-19_03-13-55.914.xcdistributionlogs".
error: exportArchive: Provisioning profile "iOS Team Store Provisioning Profile: $$${PRODUCT_BUNDLE_IDENTIFIER}" doesn't match the entitlements file's value for the application-identifier entitlement.
// OK
@Freezed(unionKey: 'type')
class FlightPlan with _$FlightPlan {
factory FlightPlan.first({
required String type,
required String monitorMaker,
required bool baggageDeliveryAvailable,
}) = FirstClassFlightPlan;
factory FlightPlan.economy({
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
final valueProvider = Provider(
(ref) => 1,
);
void main() {
runApp(
ProviderScope(
overrides: [
valueProvider.overrideWith(
(ref) => 2,
final valueProvider = Provider(
(ref) => 1,
);
void main() {
runApp(
ProviderScope(
overrides: [
valueProvider.overrideWithValue(2),
],
final someRepositoryProvider = Provider(
(ref) => SomeRepository(ref.read),
);
class SomeRepository {
const SomeRepository(this._read);
final Ref _ref;
Future<void> fetch() async {
final someRepositoryProvider = Provider(SomeRepository.new);
class SomeRepository {
const SomeRepository(this._read);
final Reader _read;
Future<void> fetch() async {
final response = _read(dioProvider).get(...);
// ...