Skip to content

Commit

Permalink
Flutter 3.22.x Support (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickypid authored Jun 19, 2024
1 parent b5a557f commit 776059c
Show file tree
Hide file tree
Showing 12 changed files with 2,138 additions and 1,157 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/deploy-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: doc
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -21,9 +18,14 @@ jobs:

- name: Install dependencies
run: npm install
working-directory: doc

- name: Build site
run: npm run build
working-directory: doc

- name: Add CNAME file
run: cp ./CNAME ./doc/build/CNAME

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/flutter-analyze.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: Flutter analyze

on:
push:
branches: [main]
pull_request:
branches: [main]
branches: [main, dev]

jobs:
flutter-analyze:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## [1.0.0] - 2024-06-19
#### [@rickypid](https://github.com/rickypid)

### Fixed

* Fixed schema migration (#3)
* Fixed example theme variables, now support Flutter > 3.22.x

## [0.10.0] - 2024-04-04
#### [@rickypid](https://github.com/rickypid)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Try this, thanks to the magnificent [Supabase](https://supabase.com/) platform a

---

Flyer Chat is a platform for creating in-app chat experiences using Flutter or [React Native](https://github.com/flyerhq/react-native-supabase-chat-core). This repository contains Supabase BaaS implementation for Flutter. We are also working on our more advanced SaaS and self-hosted solutions.
Flyer Chat is a platform for creating in-app chat experiences using Flutter. This repository contains Supabase BaaS implementation for Flutter. We are also working on our more advanced SaaS and self-hosted solutions.

* **Free, open-source and community-driven**. We offer no paid plugins and strive to create an easy-to-use, almost drop-in chat experience for any application. Contributions are more than welcome! Please read our [Contributing Guide](CONTRIBUTING.md).

Expand Down
3,125 changes: 2,073 additions & 1,052 deletions doc/package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions doc/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flutter-supabase-chat-core",
"version": "0.0.0",
"version": "1.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand All @@ -15,19 +15,19 @@
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "3.1.1",
"@docusaurus/preset-classic": "3.1.1",
"@mdx-js/react": "^3.0.0",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.3.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"@docusaurus/core": "3.4.0",
"@docusaurus/preset-classic": "3.4.0",
"@mdx-js/react": "^3.0.1",
"clsx": "^2.1.1",
"prism-react-renderer": "^2.3.1",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.1.1",
"@docusaurus/tsconfig": "3.1.1",
"@docusaurus/types": "3.1.1",
"typescript": "~5.2.2"
"@docusaurus/module-type-aliases": "3.4.0",
"@docusaurus/tsconfig": "3.4.0",
"@docusaurus/types": "3.4.0",
"typescript": "~5.4.5"
},
"browserslist": {
"production": [
Expand Down
8 changes: 2 additions & 6 deletions example/lib/color_schemes.g.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ const lightColorScheme = ColorScheme(
errorContainer: Color(0xFFF9DEDC),
onErrorContainer: Color(0xFF410E0B),
outline: Color(0xFF79747E),
background: Color(0xFFFFFBFE),
onBackground: Color(0xFF1C1B1F),
surface: Color(0xFFFFFBFE),
onSurface: Color(0xFF1C1B1F),
surfaceVariant: Color(0xFFE7E0EC),
surfaceContainerHighest: Color(0xFFE7E0EC),
onSurfaceVariant: Color(0xFF49454F),
inverseSurface: Color(0xFF313033),
onInverseSurface: Color(0xFFF4EFF4),
Expand Down Expand Up @@ -53,11 +51,9 @@ const darkColorScheme = ColorScheme(
errorContainer: Color(0xFF8C1D18),
onErrorContainer: Color(0xFFF9DEDC),
outline: Color(0xFF938F99),
background: Color(0xFF1C1B1F),
onBackground: Color(0xFFE6E1E5),
surface: Color(0xFF1C1B1F),
onSurface: Color(0xFFE6E1E5),
surfaceVariant: Color(0xFF49454F),
surfaceContainerHighest: Color(0xFF49454F),
onSurfaceVariant: Color(0xFFCAC4D0),
inverseSurface: Color(0xFFE6E1E5),
onInverseSurface: Color(0xFF313033),
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ publish_to: 'none'
version: 1.0.0+1

environment:
sdk: '>=2.19.0 <4.0.0'
sdk: '>=3.4.1 <4.0.0'

dependencies:
cupertino_icons: ^1.0.6
Expand Down
2 changes: 1 addition & 1 deletion example/utils/prepare.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

while getopts h:p:d:U flag
while getopts h:p:d:U: flag
do
case "${flag}" in
h) hostname=${OPTARG};;
Expand Down
36 changes: 7 additions & 29 deletions example/utils/sql/01_database_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -140,35 +140,13 @@ GRANT ALL ON TABLE chats.users TO anon;
GRANT ALL ON TABLE chats.users TO authenticated;
GRANT ALL ON TABLE chats.users TO service_role;

ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON SEQUENCES TO postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON SEQUENCES TO anon;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON SEQUENCES TO authenticated;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON SEQUENCES TO service_role;

ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA chats GRANT ALL ON SEQUENCES TO postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA chats GRANT ALL ON SEQUENCES TO anon;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA chats GRANT ALL ON SEQUENCES TO authenticated;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA chats GRANT ALL ON SEQUENCES TO service_role;

ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON FUNCTIONS TO postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON FUNCTIONS TO anon;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON FUNCTIONS TO authenticated;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON FUNCTIONS TO service_role;

ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA chats GRANT ALL ON FUNCTIONS TO postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA chats GRANT ALL ON FUNCTIONS TO anon;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA chats GRANT ALL ON FUNCTIONS TO authenticated;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA chats GRANT ALL ON FUNCTIONS TO service_role;

ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON TABLES TO postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON TABLES TO anon;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON TABLES TO authenticated;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON TABLES TO service_role;

ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA chats GRANT ALL ON TABLES TO postgres;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA chats GRANT ALL ON TABLES TO anon;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA chats GRANT ALL ON TABLES TO authenticated;
ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA chats GRANT ALL ON TABLES TO service_role;
GRANT USAGE ON SCHEMA chats TO anon, authenticated, service_role;
GRANT ALL ON ALL TABLES IN SCHEMA chats TO anon, authenticated, service_role;
GRANT ALL ON ALL ROUTINES IN SCHEMA chats TO anon, authenticated, service_role;
GRANT ALL ON ALL SEQUENCES IN SCHEMA chats TO anon, authenticated, service_role;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON TABLES TO anon, authenticated, service_role;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON ROUTINES TO anon, authenticated, service_role;
ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA chats GRANT ALL ON SEQUENCES TO anon, authenticated, service_role;

ALTER PUBLICATION supabase_realtime ADD TABLE ONLY chats.messages;

Expand Down
69 changes: 24 additions & 45 deletions example/web/index.html
Original file line number Diff line number Diff line change
@@ -1,59 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">

<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">

<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="example">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="example">
<link rel="apple-touch-icon" href="icons/Icon-192.png">

<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>

<title>example</title>
<link rel="manifest" href="manifest.json">

<script>
// The value below is injected by flutter build, do not touch.
const serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
<title>example</title>
<link rel="manifest" href="manifest.json">
</head>
<body>
<script>
window.addEventListener('load', function(ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
},
onEntrypointLoaded: function(engineInitializer) {
engineInitializer.initializeEngine().then(function(appRunner) {
appRunner.runApp();
});
}
});
});
</script>
<script src="flutter_bootstrap.js" async></script>
</body>
</html>
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: flutter_supabase_chat_core
description: >
Actively maintained, community-driven Supabase BaaS for chat applications
with an optional chat UI.
version: 0.10.0
version: 1.0.0
homepage: https://flutter-supabase-chat-core.insideapp.it
repository: https://github.com/insideapp-srl/flutter_supabase_chat_core

environment:
sdk: '>=3.0.0 <4.0.0'
flutter: '>=3.0.0'
sdk: '>=3.4.1 <4.0.0'
flutter: '>=3.22.0'

dependencies:
flutter:
Expand Down

0 comments on commit 776059c

Please sign in to comment.