1
0
mirror of https://github.com/flutter/samples.git synced 2026-03-22 04:17:50 +00:00
Files
samples/experimental/web_dashboard
dependabot[bot] 796978d526 Bump firebase_core from 2.24.2 to 2.25.5 in /experimental/web_dashboard (#2178)
Bumps
[firebase_core](https://github.com/firebase/flutterfire/tree/master/packages/firebase_core)
from 2.24.2 to 2.25.5.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/firebase/flutterfire/blob/master/CHANGELOG.md">firebase_core's
changelog</a>.</em></p>
<blockquote>
<h4><code>firebase_core</code> - <code>v2.25.5</code></h4>
<ul>
<li><strong>FIX</strong>(core,web): fix compatibility with TrustedTypes
(<a
href="https://redirect.github.com/firebase/flutterfire/issues/12383">#12383</a>).
(<a
href="6c1f73d0c8">6c1f73d0</a>)</li>
</ul>
<h4><code>firebase_core_web</code> - <code>v2.11.5</code></h4>
<ul>
<li><strong>FIX</strong>(core,web): fix compatibility with TrustedTypes
(<a
href="https://redirect.github.com/firebase/flutterfire/issues/12383">#12383</a>).
(<a
href="6c1f73d0c8">6c1f73d0</a>)</li>
<li><strong>FIX</strong>(auth,web): lower SDK minimum version constraint
to &quot;3.2.0&quot; (<a
href="https://redirect.github.com/firebase/flutterfire/issues/12369">#12369</a>).
(<a
href="fa412b4482">fa412b44</a>)</li>
</ul>
<h4><code>firebase_messaging</code> - <code>v14.7.17</code></h4>
<ul>
<li><strong>FIX</strong>(messaging,android): revert changes made to
potential fix as it was causing ANR reports for users (<a
href="https://redirect.github.com/firebase/flutterfire/issues/12396">#12396</a>).
(<a
href="07ef487971">07ef4879</a>)</li>
</ul>
<h4><code>firebase_storage</code> - <code>v11.6.7</code></h4>
<ul>
<li><strong>FIX</strong>(storage): <code>Task.cancel()</code> method
wasn't properly updating <code>task.snapshot</code> and
<code>cancel()</code> wasn't working in certain conditions. (<a
href="https://redirect.github.com/firebase/flutterfire/issues/12322">#12322</a>).
(<a
href="c3ca5d101b">c3ca5d10</a>)</li>
</ul>
<h4><code>firebase_storage_platform_interface</code> -
<code>v5.1.10</code></h4>
<ul>
<li><strong>FIX</strong>(storage): <code>Task.cancel()</code> method
wasn't properly updating <code>task.snapshot</code> and
<code>cancel()</code> wasn't working in certain conditions. (<a
href="https://redirect.github.com/firebase/flutterfire/issues/12322">#12322</a>).
(<a
href="c3ca5d101b">c3ca5d10</a>)</li>
</ul>
<h2>2024-02-19</h2>
<h3>Changes</h3>
<hr />
<p>Packages with breaking changes:</p>
<ul>
<li>There are no breaking changes in this release.</li>
</ul>
<p>Packages with other changes:</p>
<ul>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#_flutterfire_internals---v1322"><code>_flutterfire_internals</code>
- <code>v1.3.22</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#cloud_firestore---v4155"><code>cloud_firestore</code>
- <code>v4.15.5</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#cloud_firestore_platform_interface---v616"><code>cloud_firestore_platform_interface</code>
- <code>v6.1.6</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#cloud_firestore_web---v3105"><code>cloud_firestore_web</code>
- <code>v3.10.5</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#firebase_auth_web---v595"><code>firebase_auth_web</code>
- <code>v5.9.5</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#firebase_storage_web---v370"><code>firebase_storage_web</code>
- <code>v3.7.0</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#firebase_crashlytics_platform_interface---v3622"><code>firebase_crashlytics_platform_interface</code>
- <code>v3.6.22</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#firebase_auth_platform_interface---v715"><code>firebase_auth_platform_interface</code>
- <code>v7.1.5</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#firebase_in_app_messaging_platform_interface---v02422"><code>firebase_in_app_messaging_platform_interface</code>
- <code>v0.2.4+22</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#firebase_database_platform_interface---v02522"><code>firebase_database_platform_interface</code>
- <code>v0.2.5+22</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#firebase_dynamic_links_platform_interface---v02622"><code>firebase_dynamic_links_platform_interface</code>
- <code>v0.2.6+22</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#firebase_messaging_web---v365"><code>firebase_messaging_web</code>
- <code>v3.6.5</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#firebase_remote_config_platform_interface---v1422"><code>firebase_remote_config_platform_interface</code>
- <code>v1.4.22</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#firebase_messaging_platform_interface---v4524"><code>firebase_messaging_platform_interface</code>
- <code>v4.5.24</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#firebase_app_installations_web---v01322"><code>firebase_app_installations_web</code>
- <code>v0.1.3+22</code></a></li>
<li><a
href="https://github.com/firebase/flutterfire/blob/master/#firebase_analytics_platform_interface---v396"><code>firebase_analytics_platform_interface</code>
- <code>v3.9.6</code></a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="15d8a1c59e"><code>15d8a1c</code></a>
chore(release): prepare for release (<a
href="https://github.com/firebase/flutterfire/tree/master/packages/firebase_core/issues/12406">#12406</a>)</li>
<li><a
href="6c1f73d0c8"><code>6c1f73d</code></a>
fix(core, web): fix compatibility with TrustedTypes (<a
href="https://github.com/firebase/flutterfire/tree/master/packages/firebase_core/issues/12383">#12383</a>)</li>
<li><a
href="fa412b4482"><code>fa412b4</code></a>
fix(auth, web): lower SDK minimum version constraint to
&quot;3.2.0&quot; (<a
href="https://github.com/firebase/flutterfire/tree/master/packages/firebase_core/issues/12369">#12369</a>)</li>
<li><a
href="886c39a3e9"><code>886c39a</code></a>
chore(release): publish packages (<a
href="https://github.com/firebase/flutterfire/tree/master/packages/firebase_core/issues/12294">#12294</a>)</li>
<li><a
href="0e67a1a466"><code>0e67a1a</code></a>
fix(core, web): remove unused import that could lead to compilation
error (<a
href="https://github.com/firebase/flutterfire/tree/master/packages/firebase_core/issues/1">#1</a>...</li>
<li><a
href="e864acebf7"><code>e864ace</code></a>
chore(release): publish packages (<a
href="https://github.com/firebase/flutterfire/tree/master/packages/firebase_core/issues/12276">#12276</a>)</li>
<li><a
href="c395da524d"><code>c395da5</code></a>
fix(core, web): fix an incompatibility with Flutter Beta that would
occur whe...</li>
<li><a
href="8d944a25e4"><code>8d944a2</code></a>
fix(core, web): fix null safety issue in typing JS Interop (<a
href="https://github.com/firebase/flutterfire/tree/master/packages/firebase_core/issues/12266">#12266</a>)</li>
<li><a
href="8f49afcb80"><code>8f49afc</code></a>
chore(release): publish packages (<a
href="https://github.com/firebase/flutterfire/tree/master/packages/firebase_core/issues/12251">#12251</a>)</li>
<li><a
href="d0d30405a8"><code>d0d3040</code></a>
fix(auth, web): fix null safety issue in typing JS Interop (<a
href="https://github.com/firebase/flutterfire/tree/master/packages/firebase_core/issues/12250">#12250</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/firebase/flutterfire/commits/firebase_core-v2.25.5/packages/firebase_core">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=firebase_core&package-manager=pub&previous-version=2.24.2&new-version=2.25.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-01 14:04:43 +11:00
..
2023-11-16 08:55:44 +10:00
2022-05-11 12:48:11 -07:00
2020-03-02 16:04:10 -08:00
2020-03-02 16:04:10 -08:00

web_dashboard

In progress

A dashboard app that displays daily entries.

  1. How to use an AdaptiveScaffold adaptive layout for large, medium, and small screens.
  2. How to use Firebase Cloud Firestore database with Google Sign-In.
  3. How to use charts to display data.
  4. (in progress) How to set up routing for a web app

This app is web-first, and isn't guaranteed to run on iOS, Android or desktop platforms.

Running

Normal mode (DDC):

flutter run -d chrome

Skia / CanvasKit mode:

flutter run -d chrome --release --dart-define=FLUTTER_WEB_USE_SKIA=true

Running JSON code generator

flutter pub run grinder generate

Add Firebase

Step 1: Create a new Firebase project

Go to console.firebase.google.com and create a new Firebase project.

Step 2: Enable Google Sign In for your project

In the Firebase console, go to "Authentication" and enable Google sign in. Click on "Web SDK Configuration" and copy down your Web client ID.

Step 3: Add Client ID to index.html

Uncomment this line in index.html and replace <YOUR WEB CLIENT ID> with the client ID from Step 2:

  <!-- Uncomment and add Firebase client ID here: -->
  <!-- <meta name="google-signin-client_id" content="<YOUR WEB CLIENT ID>"> -->

Step 4: Create a web app

In the Firebase console, under "Project overview", click "Add app", select Web, and replace the contents of web/firebase_init.js.

// web/firebase_init.js
var firebaseConfig = {
    apiKey: "",
    authDomain: "",
    databaseURL: "",
    projectId: "",
    storageBucket: "",
    messagingSenderId: "",
    appId: ""
};

// Initialize Firebase
firebase.initializeApp(firebaseConfig);

Step 4: Create Cloud Firestore

Create a new Cloud Firestore database and add the following rules to disallow users from reading/writing other users' data:

rules_version = '2';

service cloud.firestore {
  match /databases/{database}/documents {
    // Make sure the uid of the requesting user matches name of the user
    // document. The wildcard expression {userId} makes the userId variable
    // available in rules.
    match /users/{userId}/{document=**} {
      allow read, update, delete: if request.auth.uid == userId;
      allow create: if request.auth.uid != null;
    }
  }
}

Step 5: Run the app

Run the app on port 5000:

flutter run -d chrome --web-port=5000

If you see CORS errors in your browser's console, go to the Services section in the Google Cloud console, go to Credentials, and verify that localhost:5000 is whitelisted.

(optional) Step 7: Set up iOS and Android

If you would like to run the app on iOS or Android, make sure you've installed the appropriate configuration files described at firebase.google.com/docs/flutter/setup from step 1, and follow the instructions detailed in the google_sign_in README