{"id":4790,"date":"2023-07-30T18:31:45","date_gmt":"2023-07-30T09:31:45","guid":{"rendered":"https:\/\/www.wetch.co.jp\/note\/?p=4790"},"modified":"2023-08-01T10:53:27","modified_gmt":"2023-08-01T01:53:27","slug":"%e6%88%91%e6%b5%81flutter%e5%ad%a6%e7%bf%92%e3%82%b9%e3%83%86%e3%83%83%e3%83%97%ef%bc%88%ef%bc%92%ef%bc%89riverpod%e3%81%a8gorouter","status":"publish","type":"post","link":"https:\/\/www.wetch.co.jp\/note\/%e6%88%91%e6%b5%81flutter%e5%ad%a6%e7%bf%92%e3%82%b9%e3%83%86%e3%83%83%e3%83%97%ef%bc%88%ef%bc%92%ef%bc%89riverpod%e3%81%a8gorouter\/","title":{"rendered":"\u6211\u6d41Flutter\u5b66\u7fd2\u30b9\u30c6\u30c3\u30d7\uff08\uff12\uff09Riverpod\u3068GoRouter"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u524d\u56de\u3001Flutter\u5b66\u7fd2\u306e\u300c\u8d85\u57fa\u790e\u300d\u3068\u3057\u3066\u300c\uff12\u3064\u306e\u30da\u30fc\u30b8\u3092\u884c\u304d\u6765\u3067\u304d\u308b\u30a2\u30d7\u30ea\u300d\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u304c\u3001\u3053\u3053\u3067\u306f\u300c\u72b6\u614b\u300d\u306e\u6982\u5ff5\u3092\u5168\u304f\u7121\u8996\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c\u72b6\u614b\u300d\u304c\u3069\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3042\u308b\u304b\u306b\u3064\u3044\u3066\u306f\u3001\u4f8b\u306b\u3088\u3063\u3066Bard\u3055\u3093\u306e\u89e3\u8aac\u3092\u5f15\u7528\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Flutter\u306e\u300c\u72b6\u614b\u300d\u3068\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306eUI\u304c\u5909\u5316\u3059\u308b\u539f\u56e0\u3068\u306a\u308b\u30c7\u30fc\u30bf\u3067\u3059\u3002\u72b6\u614b\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u5165\u529b\u3084\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u304b\u3089\u306e\u5fdc\u7b54\u306a\u3069\u3001\u69d8\u3005\u306a\u8981\u56e0\u306b\u3088\u3063\u3066\u5909\u5316\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u72b6\u614b\u306e\u5909\u5316\u306f\u3001\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u30c4\u30ea\u30fc\u306e\u518d\u69cb\u7bc9\u3092\u30c8\u30ea\u30ac\u30fc\u3057\u3001UI\u306e\u66f4\u65b0\u3092\u4fc3\u3057\u307e\u3059\u3002\n\n\u72b6\u614b\u306f\u3001StatefulWidget\u30af\u30e9\u30b9\u3067\u7ba1\u7406\u3057\u307e\u3059\u3002StatefulWidget\u30af\u30e9\u30b9\u306f\u3001\u72b6\u614b\u3092\u4fdd\u6301\u3059\u308bState\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3057\u307e\u3059\u3002State\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3001\u72b6\u614b\u306e\u5909\u66f4\u3092\u691c\u51fa\u3057\u3001\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u30c4\u30ea\u30fc\u306e\u518d\u69cb\u7bc9\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002\n\n\u72b6\u614b\u7ba1\u7406\u306f\u3001Flutter\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u306e\u91cd\u8981\u306a\u6982\u5ff5\u3067\u3059\u3002\u72b6\u614b\u3092\u9069\u5207\u306b\u7ba1\u7406\u3059\u308b\u3053\u3068\u3067\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306eUI\u3092\u52b9\u7387\u7684\u306b\u66f4\u65b0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6975\u3081\u3066\u30b7\u30f3\u30d7\u30eb\u306b\u8a00\u3048\u3070\u3001\u753b\u9762\u3092\u518d\u63cf\u753b\u3059\u308b\u304d\u3063\u304b\u3051\u3068\u306a\u308b\u30c7\u30fc\u30bf\u3001\u5f53\u8a72\u30c7\u30fc\u30bf\u304c\u66f4\u65b0\u3055\u308c\u308b\u3053\u3068\u3067\u5bfe\u5fdc\u3059\u308b\u753b\u9762\u304c\u518d\u63cf\u753b\u3055\u308c\u308b\u3088\u3046\u306a\u30c7\u30fc\u30bf\u3001\u3068\u8a00\u3063\u305f\u3068\u3053\u308d\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u7136\u306a\u304c\u3089\u3001\u72b6\u614b\u306b\u95a2\u3057\u3066\u306f\u66f4\u65b0\u3084\u76e3\u8996\u304c\u5fc5\u8981\u3067\u3001\u305d\u306e\u8fba\u306b\u95a2\u3057\u3066\u306f\u57fa\u672c\u7684\u306b\u306fStatefulWidget\u306a\u308b\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u3066\u5b9f\u88c5\u3059\u308b\u3088\u3046\u3067\u3059\u304c\u3001\u5358\u72ec\u306eWidget\u3067\u72b6\u614b\u7ba1\u7406\u3057\u3066\u3044\u308b\u3060\u3051\u306a\u3089\u307e\u3060\u3057\u3082\u3001\u8907\u6570\u306eWidget\u3067\u72b6\u614b\u3092\u5171\u6709\u3059\u308b\u3088\u3046\u306a\u3053\u3068\u3082\u8003\u3048\u51fa\u3059\u3068\u5b9f\u88c5\u304c\u7169\u96d1\u306b\u306a\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3088\u3063\u3066\u3001\u57fa\u672c\u5f62\u306f\u30d1\u30b9\u3057\u3066\u3001\u521d\u624b\u304b\u3089\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u983c\u308a\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u306e\u624b\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u4f55\u7a2e\u304b\u3042\u308b\u3088\u3046\u3067\u3059\u304c\u3001\u6700\u3082\u4eba\u6c17\u304c\u3042\u308b\uff08by Bard\uff09\u300cProvider\u300d\u306a\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5b58\u5728\u3057\u3001\u3055\u3089\u306b\u305d\u306e\u300cProvider\u300d\u3092\u6539\u826f\u3057\u305f\u300cRiverpod\u300d\u306a\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u3042\u308b\u306e\u3067\u3001\u3053\u308c\u3092\u4f7f\u3063\u3066\u884c\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u306b\u3088\u3063\u3066Riverpod\u306e\u89e3\u8aac\u3092Bard\u3055\u3093\u306b\u304a\u9858\u3044\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Riverpod\u306f\u3001Flutter\u306e\u72b6\u614b\u7ba1\u7406\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\nProvider\u3068\u3044\u3046\u6982\u5ff5\u3092\u7528\u3044\u3066\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u72b6\u614b\u3092\u7ba1\u7406\u3057\u307e\u3059\u3002\nProvider\u306f\u3001\u5024\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u305d\u306e\u5024\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3001Widget\u30c4\u30ea\u30fc\u306e\u3069\u3053\u304b\u3089\u3067\u3082\u53c2\u7167\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\nRiverpod\u306f\u3001\u72b6\u614b\u306e\u5909\u66f4\u3092\u81ea\u52d5\u7684\u306b\u691c\u51fa\u3057\u3001Widget\u30c4\u30ea\u30fc\u3092\u518d\u69cb\u7bc9\u3059\u308b\u305f\u3081\u3001\u52b9\u7387\u7684\u306a\u72b6\u614b\u7ba1\u7406\u304c\u53ef\u80fd\u3067\u3059\u3002<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u3060\u3051\u3067\u306f\u300cWidget\u30c4\u30ea\u30fc\u306e\u3069\u3053\u304b\u3089\u3067\u3082\u53c2\u7167\u53ef\u80fd\u306a\u72b6\u614b\u3092\u7ba1\u7406\u3067\u304d\u308b\u300d\u304f\u3089\u3044\u3057\u304b\u5206\u304b\u308a\u307e\u305b\u3093\u304c\u3001\u5177\u4f53\u7684\u306a\u7528\u6cd5\u306f\u5f8c\u8ff0\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u3092\u898b\u306a\u304c\u3089\u89e3\u8aac\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br>\u306a\u304a\u3001\u4e0a\u8a18\u306b\u3042\u308b\u3088\u3046\u306bRiverpod\u306b\u304a\u3051\u308b\u72b6\u614b\u7ba1\u7406\u306e\u4ed5\u7d44\u307f\u306e\u3053\u3068\u3092\u300cProvider\u300d\u3068\u547c\u3073\u307e\u3059\u304c\u3001\u300cProvider\u300d\u306b\u3082\u3044\u304f\u3064\u304b\u7a2e\u985e\u304c\u3042\u308a\u3001\u305d\u306e\u4e2d\u306e\uff11\u3064\u304c\u300cProvider\u300d\u3068\u3044\u3046\u65b9\u5f0f\u306b\u306a\u308a\u307e\u3059\u3002<br>\u3084\u3084\u3053\u3057\u3044\u306e\u3067\u3001\u4ed5\u7d44\u307f\u306b\u5168\u4f53\u306b\u95a2\u3057\u3066\u8a00\u53ca\u3059\u308b\u5834\u5408\u306f\u300c\u30d7\u30ed\u30d0\u30a4\u30c0\u300d\u3068\u30ab\u30bf\u30ab\u30ca\u8868\u8a18\u3057\u3001\u30d7\u30ed\u30d0\u30a4\u30c0\u306e\u5177\u4f53\u7684\u306a\u65b9\u5f0f\u306e\uff11\u3064\u3067\u3042\u308b\u300cProvider\u300d\u306b\u8a00\u53ca\u3059\u308b\u5834\u5408\u306f\u3001\u3053\u306e\u3088\u3046\u306b\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\u8868\u8a18\u3068\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305f\u3001\u524d\u56de\u306e\u6295\u7a3f\u3067\u3082\u89e6\u308c\u305f\u753b\u9762\u9077\u79fb\uff08\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\uff09\u306b\u95a2\u3057\u3066\u3082\u3001Riverpod\u3068\u76f8\u6027\u304c\u826f\u3044\u300cGoRouter\u300d\u306a\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5b58\u5728\u3057\u3001\u3053\u308c\u3092\u4f7f\u7528\u3057\u305f\u65b9\u304c\u7ba1\u7406\u3057\u3084\u3059\u305d\u3046\u306a\u306e\u3067\u3001\u5408\u308f\u305b\u3066\u4f7f\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">GoRouter\u306b\u95a2\u3057\u3066\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002\uff08by Bard\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GoRouter \u306f\u3001Flutter \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0 \u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\nGoRouter \u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u5b9a\u7fa9\u3059\u308b\u305f\u3081\u306e\u7c21\u6f54\u3067\u308f\u304b\u308a\u3084\u3059\u3044\u69cb\u6587\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\n\u307e\u305f\u3001GoRouter \u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u52d5\u7684\u306b\u5909\u66f4\u3059\u308b\u305f\u3081\u306e API \u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\nGoRouter \u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306e\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Riverpod\u3068GoRouter\u306e\u76f8\u6027\u306b\u3064\u3044\u3066\u3082\u805e\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002\uff08by Bard\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Riverpod\u3092\u4f7f\u7528\u3057\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u72b6\u614b\u3092\u7ba1\u7406\u3057\u3001GoRouter\u3092\u4f7f\u7528\u3057\u3066\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u7ba1\u7406\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\nGoRouter\u3092\u4f7f\u7528\u3057\u3066\u30eb\u30fc\u30c8\u5909\u66f4\u304c\u767a\u751f\u3059\u308b\u3068\u3001Riverpod\u306f\u81ea\u52d5\u7684\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u72b6\u614b\u3092\u66f4\u65b0\u3057\u307e\u3059\u3002\n\u3053\u308c\u306b\u3088\u308a\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u72b6\u614b\u3068\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u304c\u5e38\u306b\u540c\u671f\u72b6\u614b\u3092\u4fdd\u3064\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6587\u7ae0\u306b\u3088\u308b\u89e3\u8aac\u3060\u3051\u3067\u306f\u3042\u307e\u308a\u30d4\u30f3\u3068\u6765\u307e\u305b\u3093\u306d\u3002<br>\u3053\u306e\u8fba\u3082\u5b9f\u88c5\u3057\u306a\u304c\u3089\u8003\u3048\u3066\u884c\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Riverpod\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># flutter pub add hooks_riverpod<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8aac\u660e\u3092\u7aef\u6298\u3063\u3066\u3044\u307e\u3059\u304c\u3001Riverpod\u306e\u4f7f\u3044\u65b9\u3068\u3057\u3066\u3044\u304f\u3064\u304b\u65b9\u6cd5\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u304c\u3001\u540c\u3058\u72b6\u614b\u7ba1\u7406\u652f\u63f4\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3042\u308bHook\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u5229\u4fbf\u6027\u304c\u3055\u3089\u306b\u5411\u4e0a\u3059\u308b\u3088\u3046\u306a\u306e\u3067\u3001\u4e0a\u8a18\u3067\u306f\u305d\u306e\u3088\u3046\u306a\u7528\u6cd5\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u95a2\u9023\u30d1\u30c3\u30b1\u30fc\u30b8\u542b\u3081\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65b9\u3001GoRouter\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># flutter pub add go_router<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3063\u3061\u306f\u305d\u306e\u307e\u307e\u3067\u3059\u306d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u51e6\u7406\u5185\u5bb9<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Riverpod\u3068GoRouter\u3092\u4f7f\u7528\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br>\u5185\u5bb9\u7684\u306b\u306f\u524d\u56de\u6295\u7a3f\u3057\u305f\u300c\uff12\u3064\u306e\u30da\u30fc\u30b8\u3092\u884c\u304d\u6765\u3067\u304d\u308b\u30a2\u30d7\u30ea\u300d\u3068\u540c\u7b49\u3067\u3059\u304c\u3001\u72b6\u614b\u7ba1\u7406\u3092\u7d61\u3081\u308b\u305f\u3081\u306b\u305d\u308c\u305e\u308c\u30da\u30fc\u30b8\u306b\u30ab\u30a6\u30f3\u30bf\u30fc\u3092\u8a2d\u7f6e\u3057\u3001\u304b\u3064\uff12\u3064\u306e\u30da\u30fc\u30b8\u3067\u540c\u30ab\u30a6\u30f3\u30bf\u30fc\u3092\u5171\u6709\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30a8\u30f3\u30c8\u30ea\u30dd\u30a4\u30f3\u30c8\uff08lib\/main.dart\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305a\u306f\u30a8\u30f3\u30c8\u30ea\u30dd\u30a4\u30f3\u30c8\u3067\u3042\u308b\u300clib\/main.dart\u300d\u306e\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'package:flutter\/material.dart';\nimport 'package:hooks_riverpod\/hooks_riverpod.dart';\n\nimport 'app.dart';\n\nvoid main() {\n  runApp(\n    const ProviderScope(\n      child: MyApp(),\n    ),\n  );\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u524d\u56de\u306e\u4f8b\u3067\u306frunApp\u306e\u5f15\u6570\u3068\u3057\u3066\u76f4\u63a5MyApp\u306e\u5b9f\u884c\u7d50\u679c\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306fProviderScope\u306a\u308bWidget\u3092\u8a2d\u5b9a\u3057\u3001\u305d\u306e\u5b50Widget\u3068\u3057\u3066MyApp\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<br>\u3053\u306e\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067MyApp\u914d\u4e0b\u306e\u5168Widget\u3067Riverpod\u304c\u63d0\u4f9b\u3059\u308b\u72b6\u614b\u7ba1\u7406\u6a5f\u80fd\u304c\u4f7f\u7528\u53ef\u80fd\u306b\u306a\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Widget\u30c4\u30ea\u30fc\u306e\u30eb\u30fc\u30c8\u751f\u6210\uff08lib\/app.dart\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b21\u306bMyApp\u306e\u5b9f\u88c5\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'package:flutter\/material.dart';\nimport 'package:hooks_riverpod\/hooks_riverpod.dart';\n\nimport 'router.dart';\n\nclass MyApp extends HookConsumerWidget {\n  const MyApp({super.key});\n\n  @override\n  Widget build(BuildContext context, WidgetRef ref) {\n    final router = ref.read(routerProvider);\n    return MaterialApp.router(\n      routeInformationProvider: router.routeInformationProvider,\n      routeInformationParser: router.routeInformationParser,\n      routerDelegate: router.routerDelegate,\n      title: 'Sample App',\n    );\n  }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305a\u3001MyApp\u304cHookConsumerWidget\u3092\u7d99\u627f\u3059\u308b\u30af\u30e9\u30b9\u306b\u5909\u66f4\u3055\u308c\u307e\u3057\u305f\u3002<br>\u3053\u306e\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u3067\u3001Riverpod\u3068Hook\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u6a5f\u80fd\u304c\u540cWidget\u5185\u3067\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u305f\u3001\u4e0a\u8a18\u95a2\u4fc2\u3067build\u30e1\u30bd\u30c3\u30c9\u306b\u7b2c\u4e8c\u5f15\u6570\u300cWidgetRef ref\u300d\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002<br>\u3053\u306e\u5f15\u6570\u306b\u3088\u3063\u3066Riverpod\u306eProvider\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u5177\u4f53\u7684\u306b\u306f\u4ee5\u4e0b\u306e\u7b87\u6240\u304c\u305d\u308c\u306b\u3042\u305f\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>final router = ref.read(routerProvider);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u3067\u306f\u30d7\u30ed\u30d0\u30a4\u30c0\u300crouterProvider\u300d\u304c\u7ba1\u7406\u3059\u308b\u72b6\u614b\uff08GoRouter\uff09\u306brouter\u3068\u3044\u3046\u5909\u6570\u7d4c\u7531\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br>\u300crouterProvider\u300d\u306e\u5b9f\u88c5\u304a\u3088\u3073GoRouter\u306e\u4ed5\u69d8\u306b\u95a2\u3057\u3066\u306f\u5f8c\u8ff0\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Widget\u30c4\u30ea\u30fc\u306e\u30eb\u30fc\u30c8\u751f\u6210\u306b\u95a2\u3057\u3066\u306f\u3001\u524d\u56de\u306fMaterialApp\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306f\u300cMaterialApp.router\u300d\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<br>\u3053\u308c\u306fMaterialApp\u3092\u62e1\u5f35\u3057\u3001\u3088\u308a\u9ad8\u5ea6\u306a\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u53ef\u80fd\u306b\u3057\u305f\u3082\u306e\u306e\u3088\u3046\u3067\u3059\u3002<br>\u7279\u306b\u4ee5\u4e0b\u306e\uff13\u3064\u306e\u5f15\u6570\u304c\u91cd\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>routeInformationProvider<\/td><td>\u73fe\u5728\u306e\u30eb\u30fc\u30c8\u60c5\u5831\uff08Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306fURL\u306b\u76f8\u5f53\uff09<\/td><\/tr><tr><td>routeInformationParser<\/td><td>\u30eb\u30fc\u30c8\u60c5\u5831\u3092\u89e3\u6790\u3059\u308b\u305f\u3081\u306e\u30d1\u30fc\u30b5\u30fc<\/td><\/tr><tr><td>routerDelegate<\/td><td>\u30eb\u30fc\u30c8\u304c\u5909\u66f4\u3055\u308c\u305f\u3068\u304d\u306b\u65b0\u3057\u3044\u30a6\u30a3\u30b8\u30a7\u30c3\u30c8\u3092\u30d3\u30eb\u30c9\u3057\u3066\u8868\u793a<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u306a\u304a\u3001GoRouter\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u4e0a\u8a18\u306e\u3088\u3046\u306b\u305d\u308c\u305e\u308c\u306e\u5f15\u6570\u306b\u5bfe\u3057\u3066\u306fGoRouter\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u540c\u540d\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u6307\u5b9a\u3059\u308c\u3070\u826f\u3044\u3089\u3057\u3044\u306e\u3067\u3001\u3053\u306e\u8fba\u306f\u56fa\u5b9a\u30d1\u30bf\u30fc\u30f3\u3068\u3057\u3066\u899a\u3048\u3066\u304a\u3051\u3070\u826f\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\uff08lib\/router.dart\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u524d\u8ff0\u3057\u305f\u72b6\u614b\uff08GoRouter\uff09\u3068\u3001\u305d\u308c\u3092\u7ba1\u7406\u3059\u308b\u30d7\u30ed\u30d0\u30a4\u30c0\u300crouterProvider\u300d\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u76ee\u7684\u306b\u306a\u308a\u307e\u3059\u3002<br>\u5177\u4f53\u7684\u306b\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'package:flutter\/material.dart';\nimport 'package:go_router\/go_router.dart';\nimport 'package:hooks_riverpod\/hooks_riverpod.dart';\n\nimport 'ui\/screens\/screen_base.dart';\nimport 'ui\/screens\/top.dart';\nimport 'ui\/screens\/sub.dart';\n\nfinal routerProvider = Provider((ref) =&gt; GoRouter(\n      initialLocation: '\/',\n      routes: &#91;\n        ShellRoute(\n          builder: (BuildContext context, GoRouterState state, Widget child) =&gt;\n              ScreenBase(child: child),\n          routes: &#91;\n            GoRoute(\n              path: '\/',\n              builder: (BuildContext context, GoRouterState state) =&gt;\n                  const TopScreen(),\n            ),\n            GoRoute(\n              path: '\/sub',\n              builder: (BuildContext context, GoRouterState state) =&gt;\n                  const SubScreen(),\n            ),\n          ],\n        ),\n      ],\n    ));<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d7\u30ed\u30d0\u30a4\u30c0\u306b\u95a2\u3057\u3066\u306f\u3044\u304f\u3064\u304b\u7a2e\u985e\u304c\u3042\u3063\u3066\u3001\u4e0a\u8a18\u300cProvider\u300d\u306f\u4e0d\u5909\uff08immutable\uff09\u306a\u72b6\u614b\u3092\u7ba1\u7406\u3059\u308b\u3082\u306e\u3067\u3059\u3002<br>\u300c\u72b6\u614b\u300d\u3068\u3044\u3046\u540d\u79f0\u304b\u3089\u57fa\u672c\u7684\u306b\u306f\u53ef\u5909\uff08mutable\uff09\u306a\u5370\u8c61\u304c\u3042\u308a\u307e\u3059\u304c\u3001Riverpod\u3067\u306f\u4e0a\u8a18\u306e\u3088\u3046\u306b\u4e0d\u5909\u306a\u300c\u72b6\u614b\u300d\u306e\u7ba1\u7406\u3082\u3067\u304d\u307e\u3059\u3002<br>\u3053\u306e\u5834\u5408\u3001\u7ba1\u7406\u3055\u308c\u308b\u72b6\u614b\u306f\u5b9a\u6570\u7684\u306a\u6271\u3044\u3068\u306a\u308a\u307e\u3059\u3002<br>\u306a\u304a\u3001\u4ed6\u306e\u30d7\u30ed\u30d0\u30a4\u30c0\u3082\u542b\u3081\u3066\u3001\u30d7\u30ed\u30d0\u30a4\u30c0\u306e\u5b9f\u88c5\u65b9\u6cd5\u3068\u3057\u3066\u306f\u4e0a\u8a18\u306e\u3088\u3046\u306b\u30b0\u30ed\u30fc\u30d0\u30eb\u5909\u6570\uff08\u4e0a\u8a18\u3067\u306frouterProvider\uff09\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3001\u540c\u30d5\u30a1\u30a4\u30eb\u3092import\u3057\u305f\u4ed6\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u30af\u30e9\u30b9\u3084\u95a2\u6570\u304b\u3089\u53c2\u7167\u3059\u308b\u5f62\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6539\u3081\u3066\u4e0a\u8a18\u51e6\u7406\u3092\u3056\u3063\u304f\u308a\u89e3\u8aac\u3059\u308b\u3068\u3001GoRouter\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3057\u3001\u305d\u308c\u3092Provider\u300crouterProvider\u300d\u3067\u7ba1\u7406\u3059\u308b\u300c\u72b6\u614b\u300d\u3068\u3057\u3066\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3068\u3044\u3063\u305f\u3068\u3053\u308d\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">initialLocation\u306b\u306f\u30a2\u30d7\u30ea\u8d77\u52d5\u6642\u306e\u521d\u671f\u753b\u9762\u306b\u8a72\u5f53\u3059\u308b\u30eb\u30fc\u30c8\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br>\u3053\u306e\u5834\u5408\u3001TopScreen\u306b\u3088\u308a\u751f\u6210\u3055\u308c\u308b\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">routes\u306b\u306f\u30eb\u30fc\u30c8\u60c5\u5831\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u304c\u3001\u305d\u306e\u65b9\u6cd5\u306b\u306fGoRoute\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3068ShellRoute\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306e\uff12\u30d1\u30bf\u30fc\u30f3\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">GoRoute\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u5358\u7d14\u306bpath\u3067\u6307\u5b9a\u3057\u305f\u30eb\u30fc\u30c8\u306b\u5bfe\u5fdc\u3059\u308bWidget\uff08\u306e\u30d3\u30eb\u30c9\u51e6\u7406\uff09\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ShellRoute\u306b\u95a2\u3057\u3066\u306f\u3001\u8907\u6570\u306e\u30eb\u30fc\u30c8\u306b\u5bfe\u3057\u3066\u5171\u901a\u7684\u306a\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u9069\u7528\u3067\u304d\u307e\u3059\u3002<br>\u4e0a\u8a18\u4f8b\u3067\u306f\u3001ShellRoute\u5185\u306eroutes\u3067\u6307\u5b9a\u3057\u305f\uff12\u3064\u306eWidget\uff08TopScreen,SubScreen\uff09\u306f\u3001\u305d\u308c\u305e\u308cScreenBase\u306e\u5b50Widget\u3068\u3057\u3066\u914d\u7f6e\u3055\u308c\u307e\u3059\u3002<br>\u305d\u306e\u7d50\u679c\u3001ScreenBase\u3067\u6307\u5b9a\u3057\u305f\u753b\u9762\u306e\u69cb\u6210\u60c5\u5831\u304c\u3001routes\u3067\u6307\u5b9a\u3055\u308c\u305f\uff12\u3064\u306e\u30d1\u30b9\uff08&#8217;\/&#8217;, &#8216;\/sub&#8217;\uff09\u306e\u753b\u9762\u8868\u793a\u6642\u306b\u5171\u901a\u7684\u306b\u9069\u7528\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5171\u901a\u30ec\u30a4\u30a2\u30a6\u30c8\uff08lib\/ui\/screens\/screen_base.dart\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u524d\u8ff0\u3057\u305f\u5171\u901a\u30ec\u30a4\u30a2\u30a6\u30c8\u90e8\u5206\u306b\u95a2\u3057\u3066\u8a73\u3057\u304f\u898b\u3066\u884c\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'package:flutter\/material.dart';\nimport 'package:hooks_riverpod\/hooks_riverpod.dart';\n\nclass ScreenBase extends HookConsumerWidget {\n  final Widget child;\n  const ScreenBase({required this.child, Key? key}) : super(key: key);\n\n  @override\n  Widget build(BuildContext context, WidgetRef ref) {\n    return Scaffold(\n      appBar: AppBar(\n        title: const Text(\"\u30c6\u30b9\u30c8APP\"),\n      ),\n      body: child,\n    );\n  }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f15\u6570child\u3068\u3057\u3066\u6e21\u3055\u308c\u3066\u304f\u308b\u306e\u304cShellRoute\u306eroutes\u3067\u6307\u5b9a\u3055\u308c\u3066\u3044\u305f\u305d\u308c\u305e\u308c\u306eWidget\u306b\u306a\u308a\u307e\u3059\u3002<br>\u3053\u3053\u3067\u306f\u30d8\u30c3\u30c0\u30fc\uff08AppBar\uff09\u3068\u3057\u3066\u300c\u30c6\u30b9\u30c8APP\u300d\u3068\u5171\u901a\u7684\u306b\u8868\u793a\u3057\u3064\u3064\u3001\u305d\u306e\u4ed6\u306e\u8868\u793a\u5185\u5bb9\u306fchild\u3067\u6307\u5b9a\u3055\u308c\u305fWidget\u306e\u751f\u6210\u5185\u5bb9\u306b\u6e96\u305a\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u524d\u56de\u306e\u6295\u7a3f\u3067\u306fAppBar\u3092\u5171\u901a\u90e8\u54c1\uff08component\uff09\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3001\u305d\u308c\u3092\u5404\u30da\u30fc\u30b8\u304b\u3089\u547c\u3073\u51fa\u3059\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u3053\u3061\u3089\u306e\u65b9\u5f0f\u306e\u65b9\u304c\u52b9\u7387\u7684\u3067\u67d4\u8edf\u6027\u306b\u3082\u5bcc\u3093\u3067\u3044\u308b\u3068\u601d\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u72b6\u614b\uff08\u30ab\u30a6\u30f3\u30bf\u30fc\uff09\u7ba1\u7406\uff08lib\/state\/counter.dart\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5404\u30da\u30fc\u30b8\u306e\u5b9f\u88c5\u5185\u5bb9\u3092\u898b\u308b\u524d\u306b\u3001\u305d\u308c\u3089\u30da\u30fc\u30b8\u306e\u63cf\u753b\u306b\u95a2\u4fc2\u3059\u308b\u72b6\u614b\uff08\u30ab\u30a6\u30f3\u30bf\u30fc\uff09\u306e\u5b9f\u88c5\u306b\u95a2\u3057\u3066\u898b\u3066\u304a\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'package:hooks_riverpod\/hooks_riverpod.dart';\n\nfinal counterProvider = StateNotifierProvider&lt;CounterNotifier, CounterState&gt;(\n    (ref) =&gt; CounterNotifier());\n\nclass CounterState {\n  int count;\n  CounterState(this.count);\n}\n\nclass CounterNotifier extends StateNotifier&lt;CounterState&gt; {\n  CounterNotifier() : super(CounterState(0));\n\n  increment() {\n    state = CounterState(state.count + 1);\n  }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Riverpod\u3067\u306f\u7ba1\u7406\u5bfe\u8c61\u3068\u3059\u308b\u72b6\u614b\u306e\u7279\u6027\u306a\u3069\u306b\u3088\u308a\uff16\u7a2e\u985e\u306e\u30d7\u30ed\u30d0\u30a4\u30c0\u304c\u5b58\u5728\u3057\u307e\u3059\u304c\u3001\u7279\u306b\u91cd\u8981\u306a\u306e\u306f\u4ee5\u4e0b\u306e\uff12\u3064\u3068\u8a00\u3063\u3066\u3082\u5dee\u3057\u652f\u3048\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Provider<\/td><td>immutable\u306a\u72b6\u614b\u3092\u7ba1\u7406\u3059\u308b\u30d7\u30ed\u30d0\u30a4\u30c0<\/td><\/tr><tr><td>StateNotifierProvider<\/td><td>mutable\u306a\u72b6\u614b\u3092\u7ba1\u7406\u3059\u308b\u30d7\u30ed\u30d0\u30a4\u30c0<br>\u300cStateNotifier\u300d\u3068\u3044\u3046\u72b6\u614b\u7ba1\u7406\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u3066\u72b6\u614b\u3092\u7ba1\u7406<br>\u72b6\u614b\u304c\u66f4\u65b0\u3055\u308c\u308b\u3068\u540c\u72b6\u614b\u3092\u53c2\u7167\u3059\u308bWidget\u3092\u518d\u30d3\u30eb\u30c9\u3059\u308b<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Provider\u306e\u5b9f\u88c5\u65b9\u6cd5\u306b\u95a2\u3057\u3066\u306f\u524d\u8ff0\u3057\u305f\u300c\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u300d\u306e\u5185\u5bb9\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">StateNotifierProvider\u306b\u95a2\u3057\u3066\u306f\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306b\u7ba1\u7406\u5bfe\u8c61\u3067\u3042\u308b\u300c\u72b6\u614b\u300d\u3068\u3001\u305d\u308c\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306e\u300cStateNotifier\u300d\u306e\u30bb\u30c3\u30c8\u3067\u5b9f\u88c5\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u4f8b\u3067\u306f\u72b6\u614b\u3092\u30af\u30e9\u30b9\uff08CounterState\uff09\u3068\u3057\u3066\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u5b9f\u969b\u306e\u7ba1\u7406\u5bfe\u8c61\u306fint\u578b\u306e\u30c7\u30fc\u30bf\u300ccount\u300d\u306e\u307f\u3067\u3059\u3002<br>\u5b9f\u306f\u3001\u3053\u306eint\u578b\u306e\u30c7\u30fc\u30bf\u81ea\u4f53\u3092\u72b6\u614b\u3068\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002\u305d\u306e\u5834\u5408\u3001CounterNotifier\u306f\u300c StateNotifier&lt;int&gt;\u300d\u3092\u7d99\u627f\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br>\u305f\u3060\u3001\u72b6\u614b\u3092\u30af\u30e9\u30b9\u306b\u3057\u3066\u304a\u304f\u3053\u3068\u3067\u53c2\u7167\u306b\u969b\u3057\u3066\u5185\u5bb9\u3092\u52a0\u5de5\u3057\u306a\u304c\u3089\u63d0\u4f9b\u3059\u308bgetter\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u3053\u306e\u3088\u3046\u306a\u5f62\u3092\u9078\u629e\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">StateNotifier\u3092\u7d99\u627f\u3059\u308bCounterNotifier\u3067\u306f\u300cstate\u300d\u3068\u3044\u3046\u72b6\u614b\u3092\u6301\u3061\u3001\u540c\u72b6\u614b\u304c\u5909\u66f4\u3055\u308c\u305f\u969b\u306b\u540c\u72b6\u614b\u3092\u53c2\u7167\u3059\u308bWidget\u306e\u518d\u30d3\u30eb\u30c9\u3092\u884c\u3044\u307e\u3059\u3002<br>\u3053\u3053\u3067\u91cd\u8981\u306a\u306e\u306f\u3001\u3042\u304f\u307e\u3067\u300cstate\u300d\u306e\u5909\u66f4\u304c\u76e3\u8996\u3055\u308c\u3066\u3044\u308b\u3068\u3044\u3046\u70b9\u3067\u3059\u3002<br>\u4e0a\u8a18\u4f8b\u3067\u306f\u300cincrement\u300d\u3068\u3044\u3046setter\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u5b9f\u969b\u306e\u66f4\u65b0\u5bfe\u8c61\u3067\u3042\u308b\u72b6\u614b\u300ccount\u300d\u3092\u6301\u3064\u306e\u306fCounterState\u3067\u3042\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>state.count += 1;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">state\u306b\u306fCounterState\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u540c\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u6301\u3064\u300ccount\u300d\u3092\u76f4\u63a5\u52a0\u7b97\u3059\u308b\u5f62\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br>\u3057\u304b\u3057\u3001\u4e0a\u8a18\u51e6\u7406\u3067\u306f\u300cstate\u300d\u81ea\u4f53\u306f\u540c\u3058\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u6307\u3057\u7d9a\u3051\u3066\u3044\u308b\u305f\u3081\u5909\u5316\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u3088\u3063\u3066\u3001\u540c\u66f4\u65b0\u306b\u3088\u308b\u95a2\u9023Widget\u306e\u518d\u30d3\u30eb\u30c9\u3082\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3064\u307e\u308a\u3001StateNotifierProvider\u3067\u306fmutable\uff08\u53ef\u5909\uff09\u306a\u72b6\u614b\u300cstate\u300d\u3092\u7ba1\u7406\u3057\u307e\u3059\u304c\u3001\u305d\u3053\u306b\u8a2d\u5b9a\u3055\u308c\u308b\u60c5\u5831\u81ea\u4f53\u306fimmutable\uff08\u4e0d\u5909\uff09\u306a\u6027\u8cea\u3092\u6301\u3064\u5fc5\u8981\u304c\u3042\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\uff08\u3084\u3084\u3053\u3057\u3044\u3067\u3059\u304c\uff09\u3002<br>\u3082\u3068\u3082\u3068immutable\u306a\u6027\u8cea\u3092\u6301\u3064\u6587\u5b57\u5217\u3084\u6570\u5024\u3092\u6271\u3046\u5834\u5408\u306f\u826f\u3044\u3067\u3059\u304c\u3001mutable\u306a\u6027\u8cea\u3092\u6301\u3064\u914d\u5217\u3084\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6271\u3046\u5834\u5408\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u306a\u304a\u3001StateNotifierProvider\u3068\u985e\u4f3c\u3057\u305f\u30d7\u30ed\u30d0\u30a4\u30c0\u306bStateProvider\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u975e\u5e38\u306b\u5927\u96d1\u628a\u306a\u8a00\u3044\u65b9\u3092\u3059\u308c\u3070StateNotifierProvider\u3092\u5358\u7d14\u5316\u3057\u305f\u3082\u306e\u3067\u3001StateProvider\u81ea\u4f53\u304c\u72b6\u614b\u300cstate\u300d\u3092\u6301\u3061\u307e\u3059\u3002<br>StateNotifierProvider\u3067\u306fStateNotifier\u7d4c\u7531\u3067\u72b6\u614b\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u3001\u72b6\u614b\u306e\u5909\u66f4\u3092\u5236\u5fa1\u3059\u308b\u305f\u3081\u306e\u72ec\u81ea\u30e1\u30bd\u30c3\u30c9\uff08\u4e0a\u8a18\u4f8b\u3067\u306fincrement\uff09\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u304c\u3001StateProvider\u3067\u306f\u300cstate\u300d\u306b\u5bfe\u3057\u3066\u76f4\u63a5\u7684\u306b\u66f4\u65b0\u5f8c\u306e\u30c7\u30fc\u30bf\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3057\u304b\u3067\u304d\u307e\u305b\u3093\u3002<br>\u3054\u304f\u30b7\u30f3\u30d7\u30eb\u306a\u72b6\u614b\u7ba1\u7406\u3067\u3042\u308c\u3070StateProvider\u3067\u3082\u652f\u969c\u306e\u306a\u3044\u30b1\u30fc\u30b9\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u5f8c\u3005\u306e\u62e1\u5f35\u6027\u306a\u3069\u3082\u8003\u616e\u3059\u308b\u3068StateNotifierProvider\u306e\u65b9\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4f7f\u7528\u3059\u308b\u3068\u3044\u3046\u65b9\u91dd\u3067\u554f\u984c\u306a\u3044\u304b\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\uff08lib\/ui\/screens\/top.dart\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'package:flutter\/material.dart';\nimport 'package:go_router\/go_router.dart';\nimport 'package:hooks_riverpod\/hooks_riverpod.dart';\nimport 'package:sample\/state\/counter.dart';\n\nclass TopScreen extends HookConsumerWidget {\n  const TopScreen({super.key});\n\n  @override\n  Widget build(BuildContext context, WidgetRef ref) {\n    return Column(\n      children: &#91;\n        const Text(\"Top Screen\"),\n        Text(\"COUNT : ${ref.watch(counterProvider).count}\"),\n        ElevatedButton(\n          onPressed: () => ref.read(counterProvider.notifier).increment(),\n          child: const Icon(Icons.add),\n        ),\n        ElevatedButton(\n          onPressed: () => context.push('\/sub'),\n          child: const Text('\u6b21\u306e\u30da\u30fc\u30b8'),\n        ),\n      ],\n    );\n  }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u3067\u3082\u3001Riverpod\u306b\u3088\u308b\u72b6\u614b\u7ba1\u7406\u3092\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u3001HookConsumerWidget\u3092\u7d99\u627f\u3057\u305f\u30af\u30e9\u30b9\u306b\u3057\u3066\u3044\u307e\u3059\u3002<br>\u3053\u3053\u3067\u300c\u72b6\u614b\u300d\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u306e\u306f\u30ab\u30a6\u30f3\u30bf\u30fc\u3067\u3001StateNotifierProvider\u3067\u3042\u308bcounterProvider\u3068\u3057\u3066\u7ba1\u7406\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Column\u306e\u8981\u7d20\u306f\uff14\u3064\u3067\u3001\u4e0a\u304b\u3089<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u753b\u9762\u306e\u540d\u79f0<\/li>\n\n\n\n<li>\u30ab\u30a6\u30f3\u30bf\u30fc\u306e\u6570\u5024\u306e\u8868\u793a<\/li>\n\n\n\n<li>\u30ab\u30a6\u30f3\u30bf\u30fc\u306e\u52a0\u7b97\u30dc\u30bf\u30f3<\/li>\n\n\n\n<li>\u30da\u30fc\u30b8\u79fb\u52d5\u30dc\u30bf\u30f3<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30ab\u30a6\u30f3\u30bf\u30fc\u306e\u6570\u5024\u306e\u8868\u793a\u306b\u304a\u3044\u3066\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51e6\u7406\u3067\u5bfe\u8c61\u3068\u306a\u308b\u6570\u5024\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ref.watch(counterProvider).count<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u300cWidget\u30c4\u30ea\u30fc\u306e\u30eb\u30fc\u30c8\u751f\u6210\u300d\u3067\u306f\u72b6\u614b\u306e\u53c2\u7167\u306b\u300cref.read()\u300d\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u304c\u3001\u4e0a\u8a18\u3067\u306f\u300cref.watch()\u300d\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<br>\u524d\u8005\u306f\u5358\u306b\u540c\u51e6\u7406\u3092\u5b9f\u884c\u3057\u305f\u969b\u306b\u30d7\u30ed\u30d0\u30a4\u30c0\u304c\u6301\u3064\u72b6\u614b\u3092\u53d6\u5f97\u3067\u304d\u308b\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u304c\u3001\u5f8c\u8005\u3067\u306f\u72b6\u614b\u53d6\u5f97\u306b\u52a0\u3048\u3066\u3001\u72b6\u614b\u306e\u76e3\u8996\u3092\u884c\u3044\u3001\u5909\u66f4\u3055\u308c\u305f\u5834\u5408\u306f\u5f53\u8a72Widget\u306e\u518d\u30d3\u30eb\u30c9\u304c\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br>\u3064\u307e\u308a\u3001\u4e0a\u8a18\u306e\u51e6\u7406\u306b\u3088\u3063\u3066counterProvider\u304c\u7ba1\u7406\u3059\u308b\u72b6\u614b\u3092\u53d6\u5f97\u3059\u308b\u3068\u540c\u6642\u306bconterProvider\u304c\u7ba1\u7406\u3059\u308b\u72b6\u614b\u306e\u5909\u66f4\u76e3\u8996\u3092\u884c\u3046\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u8a33\u3067\u3059\u3002<br>\u306a\u304a\u3001counterProvider\u304c\u7ba1\u7406\u3059\u308b\u72b6\u614b\u306f\u5148\u306b\u793a\u3057\u305f\u3088\u3046\u306bCounterState\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u3042\u308a\u3001\u5b9f\u969b\u306e\u30ab\u30a6\u30f3\u30bf\u30fc\u306f\u540c\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3067\u3042\u308b\u300ccount\u300d\u306b\u306a\u308a\u307e\u3059\u3002\u3088\u3063\u3066\u30ab\u30a6\u30f3\u30bf\u30fc\u306e\u5024\u53d6\u5f97\u306f\u4e0a\u8a18\u306e\u3088\u3046\u306a\u8a18\u8ff0\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u65b9\u3067\u3001\u30ab\u30a6\u30f3\u30bf\u30fc\u306e\u52a0\u7b97\u306b\u304a\u3044\u3066\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u51e6\u7406\u3092\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ref.read(counterProvider.notifier).increment()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u300cref.read()\u300d\u306e\u5f15\u6570\u304ccounterProvider\u3067\u3042\u308c\u3070\u3001\u623b\u308a\u306fcounterProvider\u304c\u7ba1\u7406\u3059\u308b\u72b6\u614b\uff08CounterState\uff09\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306b\u300ccounterProvider.notifier\u300d\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001\u623b\u308a\u306f\u5f53\u8a72StateNotifierProvider\u306eStateNotifier\uff08\u3053\u306e\u5834\u5408\u306fCounterNotifier\uff09\u306b\u306a\u308a\u307e\u3059\u3002<br>\u300c\u72b6\u614b\uff08\u30ab\u30a6\u30f3\u30bf\u30fc\uff09\u7ba1\u7406\u300d\u3067\u3082\u89e6\u308c\u305f\u3088\u3046\u306b\u3001StateNotifierProvider\u3067\u306e\u72b6\u614b\u7ba1\u7406\u306b\u304a\u3044\u3066\u306fStateNotifier\u304c\u6301\u3064\u72ec\u81ea\u30e1\u30bd\u30c3\u30c9\uff08\u3053\u306e\u5834\u5408\u306fincrement\uff09\u3092\u4f7f\u7528\u3057\u3066\u72b6\u614b\u306e\u66f4\u65b0\u3092\u884c\u3046\u3088\u3046\u306b\u6e96\u5099\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306bCounterNotifier\u3092\u53d6\u5f97\u3057\u3001\u305d\u306e\u66f4\u65b0\u7528\u30e1\u30bd\u30c3\u30c9\u3067\u3042\u308bincrement\u3092\u547c\u3073\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u306a\u304a\u3001\u5148\u306b\u793a\u3057\u305f\u3088\u3046\u306bcounterProvider\u306f\u76e3\u8996\u5bfe\u8c61\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u4e0a\u8a18increment\u306e\u5b9f\u884c\u306b\u3088\u308a\u81ea\u8eab\u306e\u518d\u30d3\u30eb\u30c9\u3082\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b5\u30d6\u30da\u30fc\u30b8\uff08lib\/ui\/screens\/sub.dart\uff09<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b5\u30d6\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import 'package:flutter\/material.dart';\nimport 'package:go_router\/go_router.dart';\nimport 'package:hooks_riverpod\/hooks_riverpod.dart';\nimport 'package:sample\/state\/counter.dart';\n\nclass SubScreen extends HookConsumerWidget {\n  const SubScreen({super.key});\n\n  @override\n  Widget build(BuildContext context, WidgetRef ref) {\n    return Column(\n      children: &#91;\n        const Text(\"Sub Screen\"),\n        Text(\"COUNT : ${ref.watch(counterProvider).count}\"),\n        ElevatedButton(\n          onPressed: () => ref.read(counterProvider.notifier).increment(),\n          child: const Icon(Icons.add),\n        ),\n        ElevatedButton(\n          onPressed: () => context.pop(),\n          child: const Text('\u524d\u306e\u30da\u30fc\u30b8'),\n        )\n      ],\n    );\n  }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">counterProvider\u3067\u7ba1\u7406\u3059\u308b\u72b6\u614b\u300ccount\u300d\u306e\u53c2\u7167\u30fb\u66f4\u65b0\u306b\u95a2\u3057\u3066\u306f\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u3068\u540c\u69d8\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8a18\u3067\u3001\uff12\u3064\u306e\u30da\u30fc\u30b8\u3092\u884c\u304d\u6765\u3057\u3064\u3064\u3001\u305d\u308c\u305e\u308c\u306e\u30da\u30fc\u30b8\u3067\u30ab\u30a6\u30f3\u30bf\u30fc\u306e\u8868\u793a\u304a\u3088\u3073\u52a0\u7b97\u304c\u53ef\u80fd\u3067\u3042\u308a\u3001\u304b\u3064\u30ab\u30a6\u30f3\u30bf\u30fc\u306e\u5024\u306f\u4e21\u30da\u30fc\u30b8\u3067\u5171\u6709\u3055\u308c\u308b\u3001\u3068\u3044\u3046\u30a2\u30d7\u30ea\u306e\u5b9f\u88c5\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">GoRouter\u306f\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u60c5\u5831\u3092\u5358\u72ec\u3067\u307e\u3068\u3081\u3066\u5b9a\u7fa9\u3067\u304d\u305d\u3046\u306a\u70b9\u304c\u826f\u3044\u3067\u3059\u3002<br>\u524d\u56de\u306e\u8a18\u4e8b\u306e\u3088\u3046\u306bMaterialApp\u306eroutes\u3068\u3057\u3066\u8a18\u8ff0\u3057\u305f\u5834\u5408\u3001\u30eb\u30fc\u30c8\u306e\u6570\u304c\u5897\u3048\u305f\u5834\u5408\u306b\u5f53\u8a72\u7b87\u6240\u306e\u8a18\u8ff0\u304c\u968f\u5206\u6df7\u6c8c\u3068\u3057\u305f\u3053\u3068\u306b\u306a\u308a\u305d\u3046\u306a\u4e88\u611f\u304c\u3057\u3066\u3044\u307e\u3057\u305f\u306e\u3067\u3002<br>Laravel\u306b\u304a\u3051\u308broutes\u3067\u306e\u5b9a\u7fa9\u306e\u3088\u3046\u306a\u30a4\u30e1\u30fc\u30b8\u3067\u3001\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30a8\u30f3\u30b8\u30cb\u30a2\u3068\u3057\u3066\u3082\u306f\u89aa\u3057\u307f\u3084\u3059\u3044\u3067\u3059\u3002<br>ShellRoute\u306b\u3082\u671f\u5f85\u3067\u304d\u305d\u3046\u3067\u3059\u3002<br>Web\u3067\u306e\u753b\u9762\u69cb\u7bc9\u3067\u306f\u30d8\u30c3\u30c0\u3084\u30d5\u30c3\u30bf\u7b49\u3001\u307b\u3068\u3093\u3069\u306e\u30da\u30fc\u30b8\u3067\u5171\u6709\u3055\u308c\u308b\u90e8\u5206\u304c\u3042\u3063\u3066\u3001\u3053\u308c\u3089\u5171\u6709\u90e8\u5206\u3092\u30da\u30fc\u30b8\u56fa\u6709\u306e\u5185\u5bb9\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u306f\u57fa\u672c\u3067\u3057\u305f\u3002<br>Flutter\u3067\u4f5c\u6210\u3059\u308b\u30a2\u30d7\u30ea\u5168\u822c\u306bWeb\u306b\u304a\u3051\u308b\u753b\u9762\u69cb\u7bc9\u306e\u767a\u60f3\u304c\u305d\u306e\u307e\u307e\u9069\u7528\u3067\u304d\u308b\u3082\u306e\u3067\u306f\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u305d\u308c\u3067\u3082\u3053\u306e\u3088\u3046\u306a\u69cb\u9020\u7684\u306a\u753b\u9762\u69cb\u7bc9\u65b9\u6cd5\u304c\u6709\u52b9\u306a\u5c40\u9762\u306f\u591a\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u63a8\u6e2c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Riverpod\u306b\u95a2\u3057\u3066\u3082\u3001StatefulWidget\u306e\u6a19\u6e96\u7684\u306a\u66f8\u304d\u65b9\u3092\u6bd4\u8f03\u3057\u3066\u3001\u304b\u306a\u308a\u30b9\u30c3\u30ad\u30ea\u66f8\u3051\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u611f\u3058\u307e\u3059\u3002<br>\u300c\u72b6\u614b\u300d\uff08\u53ef\u5909\u60c5\u5831\uff09\u306e\u7ba1\u7406\u3068\u305d\u308c\u306b\u4f34\u3046Widget\u306e\u518d\u30d3\u30eb\u30c9\u306b\u95a2\u3057\u3066\u306fStateNotifierProvider\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4f7f\u7528\u3057\u3066\u3044\u304f\u3068\u3044\u3046\u3053\u3068\u3067\u826f\u3055\u305d\u3046\u3067\u3059\u3002<br>\u7ba1\u7406\u5bfe\u8c61\u3067\u3042\u308b\u300c\u72b6\u614b\u300d\u306e\u5b9f\u88c5\u65b9\u6cd5\u3068\u3057\u3066\u3082\u4eca\u56de\u306e\u30b5\u30f3\u30d7\u30eb\u306e\u3088\u3046\u306b\u30af\u30e9\u30b9\u3068\u3057\u3066\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u304c\u826f\u3055\u305d\u3046\u3067\u3059\u304c\u3001\u3053\u306e\u5834\u5408\u306f\u5f53\u8a72\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092immutable\u3068\u3057\u3066\u6271\u3046\u3053\u3068\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<br>\u3053\u306e\u8fba\u306b\u95a2\u3057\u3066\u306f\u3001freezed\u306a\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3067immutable\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u751f\u6210\u304c\u3067\u304d\u308b\u3088\u3046\u306a\u306e\u3067\u3001\u3044\u305a\u308c\u306f\u305d\u306e\u8fba\u306b\u95a2\u3057\u3066\u3082\u8a18\u4e8b\u306b\u3067\u304d\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u3001Flutter\u5b66\u7fd2\u306e\u300c\u8d85\u57fa\u790e\u300d\u3068\u3057\u3066\u300c\uff12\u3064\u306e\u30da\u30fc\u30b8\u3092\u884c\u304d\u6765\u3067\u304d\u308b\u30a2\u30d7\u30ea\u300d\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u304c\u3001\u3053\u3053\u3067\u306f\u300c\u72b6\u614b\u300d\u306e\u6982\u5ff5\u3092\u5168\u304f\u7121\u8996\u3057\u3066\u3044\u307e\u3057\u305f\u3002 \u300c\u72b6\u614b\u300d\u304c\u3069\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3042\u308b\u304b\u306b\u3064\u3044\u3066\u306f\u3001\u4f8b\u306b\u3088\u3063\u3066Bard\u3055\u3093\u306e\u89e3\u8aac\u3092\u5f15 [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":4791,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[214],"tags":[],"class_list":["post-4790","post","type-post","status-publish","format-standard","has-post-thumbnail","category-214"],"_links":{"self":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts\/4790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/comments?post=4790"}],"version-history":[{"count":0,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts\/4790\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/media\/4791"}],"wp:attachment":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/media?parent=4790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/categories?post=4790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/tags?post=4790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}