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
const FlutterErrorDetails({ | |
required this.exception, | |
this.stack, | |
this.library = 'Flutter framework', | |
this.context, | |
this.stackFilter, | |
this.informationCollector, | |
this.silent = false, | |
}) : assert(exception != null); |
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
return MaterialApp( | |
..., | |
builder: (context, widget) { | |
// このbuilderを上書きするだけ | |
ErrorWidget.builder = (FlutterErrorDetails errorDetails) { | |
return CustomErrorPage(errorDetails: errorDetails); | |
}; | |
return widget!; | |
}, | |
home: ..., |
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
SingleChildScrollView( | |
child: Column( | |
children: [ | |
const Text('Hoge'), | |
ListView.builder( | |
shrinkWrap: true, // 肝は | |
physics: const NeverScrollableScrollPhysics(), // この2つ | |
itemCount: 100, | |
itemBuilder: (_, index) => Text( | |
'$index', |
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
static Route<void> route() { | |
return PageRouteBuilder<void>( | |
pageBuilder: (_, __, ___) => const SomeScreen(), | |
transitionDuration: Duration.zero, // ここ | |
); | |
} |
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
{ | |
"freezed snippet": { | |
"scope": "dart", | |
"prefix": "freezed", | |
"body": [ | |
"import 'package:flutter/foundation.dart';", | |
"import 'package:freezed_annotation/freezed_annotation.dart';", | |
"", | |
"part '$TM_FILENAME_BASE.freezed.dart';", | |
"part '$TM_FILENAME_BASE.g.dart';", |
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/foundation.dart'; | |
import 'package:freezed_annotation/freezed_annotation.dart'; | |
part 'sample_model.freezed.dart'; | |
part 'sample_model.g.dart'; | |
@freezed | |
class SampleModel with _$SampleModel { | |
factory SampleModel({ | |
required String 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
import 'dart:convert'; | |
import 'packages:http/http.dart' as http; | |
Future<void> fetchSomethingRequest() async { | |
const url = '...'; | |
final response = await http.get(url); | |
if (response.statusCode != 200) { | |
throw Exception('Something occurred.'); | |
} |
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 'dart:convert'; | |
import 'packages:http/http.dart' as http; | |
Futur<void> fetchSomethingRequest() async { | |
const url = '...'; | |
http.get(url).then((response) { | |
if (response.statusCode != 200) { | |
throw Exception('Something occurred.'); | |
} |
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 'dart:convert'; | |
import 'packages:http/http.dart' as http; | |
Future<void> fetchSomethingRequest() { | |
const url = '...'; | |
return http.get(url).then((response) { | |
if (response.statusCode != 200) { | |
throw Exception('Something occurred.'); | |
} |
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 'dart:convert'; | |
import 'packages:http/http.dart' as http; | |
void fetchSomethingRequest(BuildContext context) { | |
final scaffold = Scaffold.of(context); | |
const url = '...'; | |
http.get(url).then((response) { | |
if (response.statusCode != 200) { | |
throw Exception('Something occurred.'); |