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(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({Key? key}) : super(key: key); | |
@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'; | |
void main() { | |
runApp( | |
const MyApp(), | |
); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |
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:math'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
void main() { | |
runApp( | |
const ProviderScope(child: 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 'package:flutter/material.dart'; | |
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
import 'package:flutter_hooks/flutter_hooks.dart'; | |
const Duration _kExpand = Duration(milliseconds: 300); | |
final counterProvider = | |
StateNotifierProvider<CounterNotifier, CounterState>((ref) { | |
return CounterNotifier(); | |
}); |
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'; | |
/* | |
ここではflutterとflutter_riverpodをインポートしています。 | |
flutter_riverpod: ^2.3.6を使用してます。 | |
*/ | |
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
/* | |
flutter_hooksはFlutterのパッケージで、より簡単にウィジェットの状態のライフサイクルを管理することを助けます。新しい種類のウィジェットであるHookWidgetを導入しており、 | |
これはStatefulWidgetやStatelessWidgetの代わりに使い、より良い状態管理を行うことができます。 | |
flutter_hooksパッケージには、ウィジェットで使用できるいくつかの異なる種類のフックがあります: |
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:math'; | |
import 'package:flutter/material.dart'; | |
const Duration _kExpand = Duration(milliseconds: 1000); <- at any speed | |
void main() { | |
runApp(const 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 'package:flutter/material.dart'; | |
/* | |
ここではflutterとflutter_riverpodをインポートしています。 | |
flutter_riverpod: ^2.3.6を使用してます。 | |
*/ | |
import 'package:flutter_riverpod/flutter_riverpod.dart'; | |
/* | |
CounterStateクラスはカウンターの状態を保持します。ここでは整数のcounterValueを保持しています。 | |
*/ |
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:async'; | |
import 'package:flutter/material.dart'; | |
/* | |
BLoC(Business Logic Component)パターンは、状態管理パターンの一種であり、 | |
アプリケーション内の状態管理とビジネスロジックを分離することを目的としています。 | |
BLoCパターンのメリットやデメリットについて説明します。 | |
メリット: | |
分離された責務: BLoCパターンは、ビジネスロジックと状態管理を分離するため、アプリケーションのコードをより構造化し、保守性を向上させます。 |
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(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@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'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override |
NewerOlder