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 misbehave() { | |
try { | |
dynamic foo = true; | |
print(foo++); | |
} catch (e) { | |
print('misbehave() partially handled ${e.runtimeType}.'); | |
rethrow; | |
print('after rethrow'); // 呼ばれない | |
} | |
} |
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
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; | |
} |
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
... | |
... | |
... | |
... | |
[ ] 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. |
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
// OK | |
@Freezed(unionKey: 'type') | |
class FlightPlan with _$FlightPlan { | |
factory FlightPlan.first({ | |
required String type, | |
required String monitorMaker, | |
required bool baggageDeliveryAvailable, | |
}) = FirstClassFlightPlan; | |
factory FlightPlan.economy({ |
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:flutter/material.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
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:flutter/material.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
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
final valueProvider = Provider( | |
(ref) => 1, | |
); | |
void main() { | |
runApp( | |
ProviderScope( | |
overrides: [ | |
valueProvider.overrideWith( | |
(ref) => 2, |
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
final valueProvider = Provider( | |
(ref) => 1, | |
); | |
void main() { | |
runApp( | |
ProviderScope( | |
overrides: [ | |
valueProvider.overrideWithValue(2), | |
], |
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
final someRepositoryProvider = Provider( | |
(ref) => SomeRepository(ref.read), | |
); | |
class SomeRepository { | |
const SomeRepository(this._read); | |
final Ref _ref; | |
Future<void> fetch() async { |
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
final someRepositoryProvider = Provider(SomeRepository.new); | |
class SomeRepository { | |
const SomeRepository(this._read); | |
final Reader _read; | |
Future<void> fetch() async { | |
final response = _read(dioProvider).get(...); | |
// ... |
NewerOlder