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'; | |
import 'package:location/location.dart'; | |
import 'package:flutter_map/flutter_map.dart'; | |
import 'package:latlong2/latlong.dart'; | |
/////////////////////////////// | |
void main() => runApp(MyApp()); | |
/////////////////////////////// |
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 'package:flutter/material.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
/////////////////////////////// | |
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 'dart:convert'; | |
void main() { | |
var mapObj = {"title":"TODO-1", "status":true}; | |
print(mapObj); | |
var jsonStr = jsonEncode(mapObj); | |
print(jsonStr); | |
var mapObj2 = jsonDecode(jsonStr); |
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'; | |
import 'package:http/http.dart' as http; | |
import 'dart:convert' as convert; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
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
// ① APIの利用に必要なライブラリをインポートする | |
import 'package:http/http.dart' as http; | |
import 'dart:convert' as convert; | |
void main() async { | |
// ② APIにアクセスする | |
var url = Uri.parse( | |
'https://mocha-api.t.u-tokyo.ac.jp/resource/channel/utokyo_all/congestion'); | |
var response = await http.get(url); |
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'; | |
import 'package:sensors/sensors.dart'; | |
/////////////////////////////// | |
void main() => runApp(MyApp()); | |
/////////////////////////////// | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
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'; | |
/////////////////////////////// | |
void main() => runApp(MyApp()); | |
/////////////////////////////// | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp(theme: ThemeData(), home: MyHomePage()); |
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 _textFieldController = TextEditingController(); | |
Future<String?> _showTextInputDialog(BuildContext context) async { | |
return showDialog( | |
context: context, | |
builder: (context) { | |
return AlertDialog( | |
title: const Text('タイトル'), | |
content: TextField( | |
controller: _textFieldController, |
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'; | |
// ① 必要なライブラリをインポート | |
import 'package:shared_preferences/shared_preferences.dart'; | |
/////////////////////////////// | |
void main() => runApp(MyApp()); | |
/////////////////////////////// | |
class MyApp extends StatelessWidget { |
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'; | |
/////////////////////////////// | |
// ① Main:Flutterアプリもmain()からコードが実行されます。 | |
// `void main() => runApp(MyApp());` でも意味は同じです。 | |
void main() { | |
return runApp(MyApp()); | |
} | |
/////////////////////////////// |
NewerOlder