💙🔥 FlutterFire commons repository, makes FlutterFire app development faster, easier, and more fun!

Overview

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them.

Features

TODO: List what your package can do. Maybe include images, gifs, or videos.

Getting started

TODO: List prerequisites and provide or point to information on how to start using the package.

Usage

TODO: Include short and useful examples for package users. Add longer examples to /example folder.

const like = 'sample';

Additional information

TODO: Tell users more about the package: where to find more information, how to contribute to the package, how to file issues, what response they can expect from the package authors, and more.

Comments
  • fix: fvmの設定ファイルを追加

    fix: fvmの設定ファイルを追加

    • https://zenn.dev/riscait/articles/melos-for-multiple-packages-dart-projects
    • https://zenn.dev/riscait/articles/flutter-version-management

    こちら参考にfvmの設定ファイル追加、 .fvm/flutter_sdk をignoreしました。 stable にするとどうもうまくいかなかった(過去に入れたstableが使われてしまった)ため明示的にバージョン入れています。

    opened by hndrr 2
  • go_routerを使ったBottomNavigationBar永続化のサンプル

    go_routerを使ったBottomNavigationBar永続化のサンプル

    テストを書けなかったのが心残りですが、気になる部分やもし間違っている部分あればご指摘頂ければ!

    GoRouterを使ったBottomNavigationBar永続化のサンプル

    ※ こちらはNavigator1.0とNavigator2.0を併用させたアプローチになります

    アプローチ

    1. GoRouterクラスのnavigationBuilderを活用
    2. NavigatorクラスでラップしたBottomNavigationBarをメインのページスタックの上に表示
    3. タブでの画面遷移に見える様、ページ遷移時のアニメーションを調整

    navigationBuilderパラメータではメインのページスタックの上にWidgetを重ねる事が出来ます。 https://gorouter.dev/navigator-builder

    こちらを活用し、BottomNavigationBarを全てのページスタックの上に重ねて表示しています。

    BottomNavigationBarMaterialPage配下に配置されている必要がある為、Navigatorクラスでラップする必要があります。

    肝となるのはGoRouterの以下部分です。

      GoRouter(
        ...,
        navigatorBuilder: (context, state, child) {
          return Navigator(
            onPopPage: (route, dynamic __) => false,
            pages: [
              MaterialPage<Widget>(
                child: BottomNav(
                  child: child,
                ),
              ),
            ],
          );
        },
      )
    

    またタブでの画面遷移に見える様、トップレベルのページのみ遷移時のアニメーションを調整しています。 https://gorouter.dev/transitions

      GoRoute(
        name: 'simple',
        path: '/simple',
        pageBuilder: (context, state) => CustomTransitionPage(
            key: state.pageKey,
            child: const SimpleNavigationScreen(),
            transitionDuration: Duration.zero, // <= Duration.zeroで遷移する様、調整
            transitionsBuilder:
                (context, animation, secondaryAnimation, child) => child),
    

    ページ別動作のサンプル

    BottomNavigationBarの各タブではそれぞれ異なる画面遷移のサンプルを用意しました。

    Simple Navigation Screen

    サブルートへの画面遷移 https://gorouter.dev/sub-routes

      GoRoute(
        name: 'simple',
        ...,
        routes: [ // routes内に定義する事でsub-routeを繋げる
          GoRoute( 
            name: 'login',
            path: 'login',
            pageBuilder: (context, state) => MaterialPage(
              key: state.pageKey,
              child: const LoginScreen(),
            ),
          ),
          ...,
        ],
      ),
    

    引数を渡した画面遷移 https://gorouter.dev/parameters

      GoRoute(
        name: 'simple',
        ...,
        routes: [
          ...,
          GoRoute(
            name: 'number',
            path: 'number/:id', // 引数を含むパスを定義
            builder: (context, state) {
              final id = state.params['id']!; // stateから引数を取り出す
              return NumberScreen(number: id);
            },
          ),
        ],
      ),
    

    引数を含むパスで遷移

    onTap: () => context.go('/simple/number/$id');
    

    Overlay Navigation Screen

    DialogやModalBottomSheetの挙動のサンプルです。

    DialogやModalBottomSheetはGoRouterで定義されたページスタックではなく、navigatorBuilder内に定義されたNavigatorクラス上に被さります

    その為、これらをクローズする場合はGoRouter.of(context).pop()ではなく、Navigator.of(context).pop()を使います

      await showDialog<void>(
        context: context,
        builder: (context) {
          return AlertDialog(
            title: const Text('This is the Dialog'),
            content: const Text('This is the content'),
            actions: [
              TextButton(
                child: const Text('Cancel'),
                onPressed: () => Navigator.of(context).pop(), // Navigatorのpopを使用
              ),
              TextButton(
                child: const Text('OK'),
                onPressed: () => Navigator.of(context).pop(),
              ),
            ],
          );
        },
      );
    

    またshowModalBottomSheetではuseRootNavigatorパラメータを使う事で、Navigatorクラスの上に被せるか、GoRouterクラスの上に被せるかを操作出来ます

      await showModalBottomSheet<bool>(
        context: context,
        // trueでNavigatorの上、デフォルトのfalseでGoRouterの上に表示
        useRootNavigator: true, 
        builder: (context) {
          ...
        },
      );
    

    TabBar Navigation Screen

    BottomNavigationBarTabBarを併用した挙動のサンプルです。

    TabBarView内からネストした画面へも問題なく遷移出来ます

    問題点

    ・ブラウザバックに非対応

    本アプローチではBottomNavigationBarの選択中インデックスをアイコンをタップする事で変更しています。

    その為、Webのブラウザバックに対し、選択中インデックスの更新がされません。

    Navigator2.0だけでの対応

    本アプローチはNavigator1.0とNavigator2.0を併用したアプローチになります。

    Navigator1.0と2.0の併用については公式ドキュメントでも「併用可」とする記述がある為、問題はないと思いますが、可能であれば一本化したい所。 https://stackoverflow.com/a/68579883/18124943

    ですが現状、Nabigator2.0のみでTabBarBottomNavigationBarの永続化は行えません。

    ただ以下の通り、対応について度々議論されている為、将来的に対応される可能性は十分ありそうです。

    https://github.com/csells/go_router/issues/133 https://github.com/csells/go_router/discussions/222

    opened by heyhey1028 1
  • Feature/routing with riverpod sample

    Feature/routing with riverpod sample

    内容

    package/routing_with_riverpod/example にサンプルアプリを作成しました。

    Riverpod を用いたルーティングに関するサンプルです。

    ProviderScope.overrides と Provider.dependencies を工夫して使用することで、ページ遷移の際に次のページに渡したいパラメータを、その新しいページクラスのコンストラクタに含めることなく、パスパラメータやクエリパラメータを appRouterStateProvider から取得できるようにしています。ウィジェットテストは書いていませんが、これによって各画面の結合が疎になるので、テストしやすかったり、保守しやすかったりするメリットを享受できます。

    go_router パッケージを少し真似して作っていて、AppRouterStateGoRouterState クラス、AppRoute クラスは GoRoute クラスに似ています。パスパラメータの解析は go_router と同じ path_to_regexp パッケージを用いています。

    具体的には、GitHub のリポジトリ API を題材として、

    パターン 1:Repository 一覧画面で取得済みの Repo インスタンスを使用して、Repository 一覧画面では API をコールして再取得することなく画面遷移するパターン

    // Repo インスタンスが取得済みである場合
    final repo = Repo(...);
    
    // arguments に Repo インスタンスを指定する。
    Navigator.pushNamed<void>('/repo/KosukeSaigusa/flutterfire-commons', arguments: repo);
    

    パターン 2:取得済みの Repo インスタンスはなく、パスパラメータから Get a repository API をコールして Repo インスタンスを取得して画面遷移するパターン

    // Repo インスタンスが取得できていない場合
    // arguments に Repo インスタンスがないので、パスパラメータを指定しておけば
    // パスパラメータを解析して、必要な Get a repository API がコールされる。
    Navigator.pushNamed<void>('/repo/KosukeSaigusa/flutterfire-commons');
    

    のような両パターンでよしなに画面遷移を行えます。

    動作

    1. Repository 一覧の取得済み Repo インスタンスを使用して遷移
    2. /repo/KosukeSaigusa/flutterfire-commons のロケーションだけを指定して遷移
    3. /repo/susatthi/github-search のロケーションだけを指定して遷移
    4. /repo/susatthi/random のような存在しないロケーションを指定して遷移

    https://user-images.githubusercontent.com/13669049/174464038-d09eb9d6-d2e5-4770-bdc5-dd16345dd510.mp4

    その他

    HTTP クライアントには Dio を使用しており、個人的によく使うインターセプタを lib/utils/dio/ に記述しているので、参考になれば見てみてください(上記の画面収録でもデバッグコンソールにリクエストの curl 出力や、レスポンスのステータスコードとステータスメッセージが表示されているものもそれです)。

    opened by KosukeSaigusa 1
  • Riverpodのlistenメソッドを使ったサンプルを実装する

    Riverpodのlistenメソッドを使ったサンプルを実装する

    概要

    Riverpodのlistenメソッドを使ったサンプルを実装する。 listenを使ってダイアログ表示、SnackBar表示などをしてみる。

    詳細

    参考 https://github.com/susatthi/flutter-sandbox/blob/main/lib/main_riverpod_launch_snackbar.dart

    1. feature 
    opened by susatthi 0
  • Measureクラスを使ったUIサンプルを作成

    Measureクラスを使ったUIサンプルを作成

    opened by shimizu-saffle 0
  • sealedサンプルつくってみた

    sealedサンプルつくってみた

    Androidでよく使われている(?)sealedをFlutterで実装してみました! freezedのwhenの内部を書いたような感じです。

    https://qiita.com/b4tchkn/items/f12a4894ca1b3ac66d9c

    参考にした記事 https://medium.com/@reginfell/flutter-sealed-classes-257d46b3c0e

    opened by MatsumaruTsuyoshi 0
  • LifeCycle widget を作成

    LifeCycle widget を作成

    opened by yamatatsu10969 0
  • WheelUIのサンプル

    WheelUIのサンプル

    概要

    iPodのWheel UIを再現するようなSample

    • https://d1v1b.com/swiftui/ipod_classic_ui
    • https://play.google.com/store/apps/details?id=com.jamesob.ipod

    詳細

    音楽系だとシーク、Volume調整、リストの送り(prev,next)などを行う ギャラリー系などにも機能としては使えると思う タッチによるフィードバックをバイブレーションなどでつけたい リリースで使うのにはそっくりのものを作ってもiOS側でリリースできないので何かしらのデザイン変更が必要

    1. feature 
    opened by hndrr 2
Owner
Kosuke Saigusa
Kosuke Saigusa
Encode App-Dev is a open source project which contains different projects of Application development, Android development, IOS development, Flutter, Kotlin, Dart, Java, Swift etc.

HACKTOBERFEST 2022 Encode App-Dev is an open source project which contains different projects of Application development, Android development, IOS dev

null 4 Dec 4, 2022
News App developed with Flutter featuring beautiful UI, category-based news, story for faster news reading, inbuilt article viewer, share feature, and more.

Ariel News App developed with Flutter featuring beautiful UI, category-based news, story for faster news reading, inbuilt article viewer, share featur

Hash Studios 30 Nov 9, 2022
Android Debug Drawer for faster development

Android Debug Drawer Faster development with Debug Drawer Features DeviceModule - common information about your device BuildModule - app build informa

Mantas Palaima 1.2k Nov 21, 2022
This package helps developer to sort the flutter/dart packages and plugins alphabetically, This makes it easier when managing too many packages and when working with teams

Package helps to sort the flutter/dart packages and plugins alphabetically, This makes it easier when managing too many packages and when working with

DANCHE 7 Dec 21, 2022
A draggable Flutter widget that makes implementing a Sliding up and fully-stretchable much easier.

Draggable Home A draggable Flutter widget that makes implementing a Sliding up and fully-stretchable much easier! Based on the Scaffold and Sliver. Us

Devs On Flutter 106 Dec 12, 2022
A set of Flutter widgets that makes grouping Checkboxes and Radio Buttons much easier!

grouped_buttons A set of Flutter widgets that makes grouping Checkboxes and Radio Buttons much easier! Installing Add the following to your pubspec.ya

Akshath Jain 102 Dec 28, 2022
Response Parser makes it easier to parse data and error response from server.

Response Parser makes it easier to parse data and error response from server. Getting started Do you want to write this pretty functions... Future<Eit

Qyre AB 4 Nov 5, 2022
A platform similar to iFood that makes it easier for the consumers to find a list of generators with solar plates system available for rent

iEnergy App A platform similar to iFood that makes it easier for the consumers to find a list of generators with solar plates system available for ren

André Diogo 1 Jun 7, 2022
Addons to supabase dart (and Flutter), to make development easier.

supabase_addons Make great apps with a great backend! Supabase is an open source Firebase alternative. It has support for auth, database and storage u

Bruno D'Luka 20 Dec 3, 2022
Quickly is build as a tool to enhance your Flutter UI development experience and make code easier

Quickly is build as a tool to enhance your Flutter UI development experience and make code easier. It is highly inspired by Bootstrap and Tailwind CSS. It also provide lots of extension methods on String, List and Map.

Aniket Khote 11 Oct 24, 2022
Succu - This is a flutter app that makes it a breeze to know your pet plant more.

succu This is a flutter app that makes it a breeze to know your pet plant more. Are you struggling to keep your succulents alive? Or maybe you’re just

Francis Miguel A. Herlaban 81 Dec 13, 2022
A CLI to help with using FlutterFire in your Flutter applications.

FlutterFire CLI Documentation • License A CLI to help with using FlutterFire in your Flutter applications. Local development setup To setup and use th

Invertase 100 Dec 12, 2022
FlutterFire-note - A Flutter based simple cross platform note application

FlutterFire Note Overview FlutterFire Note is a Flutter based simple cross platf

Mahim Safa 1 Jan 31, 2022
Weather app using Bloc architecture pattern & generic HTTP client with interface implementation and much more for more detail read Readme

weather Weather application for current weather, hourly forecast for 48 hours, Daily forecast for 7 days and national weather alerts. How to Run Insta

Jibran Ahmed SiddiQui 9 Oct 29, 2022
More than 130+ pages in this beautiful app and more than 45 developers has contributed to it.

flutter-ui-nice ❤️ Star ❤️ the repo to support the project or ?? Follow Me.Thanks! Facebook Page Twitter Medium QQ Group Flutter Open NieBin Flutter O

Flutter开源社区 3.4k Jan 3, 2023
More than 130+ pages in this beautiful app and more than 45 developers has contributed to it.

flutter-ui-nice ❤️ Star ❤️ the repo to support the project or ?? Follow Me.Thanks! Facebook Page Twitter Medium QQ Group Flutter Open NieBin Flutter O

Flutter开源社区 3.4k Jan 5, 2023
An extended version of Flutter Colors with more swatches and more flexibility to generate your own custom swatch.

Colours An extended version of Flutter Colors with more swatches and more flexibility to generate your own custom swatch. Getting Started In your flut

Salman S 4 Nov 23, 2021
A package help you to make api call and handle error faster, also you can check for internet before call api.

http_solver ##not for production use, only for learning purpose. A package help you to make api call and handle error faster, also you can check for i

Abdelrahman Saed 1 Jun 18, 2020