Skip to content

Commit

Permalink
v3.8.1
Browse files Browse the repository at this point in the history
fix for flutter 3.22.2
+no longer need to use fvm for v3.19.6
-chatGPT demo is still broken tho :(, disable it for now...
  • Loading branch information
X-Wei committed Jun 9, 2024
1 parent fffb983 commit 1ffc05e
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 48 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/flutter-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 3.19.6
channel: stable
cache: true

- run: flutter pub get
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 3.19.6
channel: stable
cache: true

- run: flutter pub get
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## v3.8.1
[2024-06-09]
- add new examples: AI chat w/ Groq, download file via dio, show timeline UI
- fix bug in firebase chatroom and IAP example
- add reusable class/functions across examples
- add widget_with_codeview as git subtree
- build with latest flutter 3.22.2
- upgrade packages & other fixes


## v3.7.0
[2023-09-18]
- update app icon to resolve trademark issue(#144)
Expand Down
16 changes: 9 additions & 7 deletions lib/my_app_routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// "structure" of the group of example routes, in a const List<Tuple2> object.
// ignore_for_file: sort_child_properties_last
import 'package:community_material_icon/community_material_icon.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'constants.dart';
import 'home_page.dart';
Expand Down Expand Up @@ -1193,13 +1194,14 @@ const kMyAppRoutesAdvanced = <MyRouteGroup>[
'https://developers.google.com/ml-kit/vision/text-recognition',
},
),
MyRoute(
child: ChatGptExample(),
sourceFilePath: 'lib/routes/aiml_chatgpt_ex.dart',
title: "ChatGPT",
description: 'Interact with ChatGPT in Flutter',
links: {'pub.dev': 'https://pub.dev/packages/chat_gpt_sdk'},
),
if (kDebugMode) // TODO: re-enable until the 429 error is fixed
MyRoute(
child: ChatGptExample(),
sourceFilePath: 'lib/routes/aiml_chatgpt_ex.dart',
title: "ChatGPT",
description: 'Interact with ChatGPT in Flutter',
links: {'pub.dev': 'https://pub.dev/packages/chat_gpt_sdk'},
),
MyRoute(
sourceFilePath: 'lib/routes/aiml_groq_ex.dart',
child: GroqExample(),
Expand Down
10 changes: 5 additions & 5 deletions lib/routes/monetization_rewarded_ad_ex.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,20 @@ class _RewordedAdExampleState extends ConsumerState<RewordedAdExample> {
icon: _rewardedAd == null
? CircularProgressIndicator()
: Icon(Icons.emoji_events),
label: Text('Click to show ad for 10 coins'),
label: Text('Watch an ad to gain 10 coins'),
),
SizedBox(height: 32),
Text(
'💰 You currently have ${ref.watch(userCoinsProvider)} coins.',
'💰 You currently have ${ref.watch(userCoinsProvider)} coins and ${ref.watch(mySettingsProvider).chatGptTurns} AI chat turns.',
style: Theme.of(context).textTheme.titleLarge,
),
Card(
color: Colors.lightGreen,
child: ListTile(
title: Text('Consume 1 coin for 5 chatGPT turns quota'),
title: Text('Consume 1 coin for 10 AI chat turns quota'),
trailing: Icon(Icons.shopping_cart_checkout),
subtitle: Text(
'You have ${ref.watch(mySettingsProvider).chatGptTurns} free chatGPT turns.'),
'You have ${ref.watch(mySettingsProvider).chatGptTurns} AI chat turns.'),
onTap: () async {
final coins = ref.read(userCoinsProvider);
if (coins <= 0) {
Expand All @@ -167,7 +167,7 @@ class _RewordedAdExampleState extends ConsumerState<RewordedAdExample> {
return;
} else {
await addCoins(ref, -1);
ref.read(mySettingsProvider).chatGptTurns += 5;
ref.read(mySettingsProvider).chatGptTurns += 10;
}
},
),
Expand Down
4 changes: 2 additions & 2 deletions lib/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ThemeData _buildLightTheme() {
final colorScheme = const ColorScheme.light().copyWith(
primary: _primaryColor,
secondary: _secondaryColor,
background: Colors.white,
surface: Colors.white,
error: const Color(0xFFB00020),
);
return ThemeData(
Expand Down Expand Up @@ -42,7 +42,7 @@ ThemeData _buildDarkTheme() {
final colorScheme = const ColorScheme.dark().copyWith(
primary: _primaryColor,
secondary: _secondaryColor,
background: const Color(0xFF202124),
surface: const Color(0xFF202124),
error: const Color(0xFFB00020),
);
return ThemeData(
Expand Down
57 changes: 29 additions & 28 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ packages:
dependency: "direct main"
description:
name: chat_gpt_sdk
sha256: "5987788bdc92156ab6d72888747a27fa6d239d9d71caba5dd25dba54bbe79167"
sha256: "2b68d97354a0dde1a13844ff4e611be3b4aa9f9d8a8ea1fbd750bef3314a7d74"
url: "https://pub.dev"
source: hosted
version: "3.0.7"
version: "3.0.9"
checked_yaml:
dependency: transitive
description:
Expand Down Expand Up @@ -389,10 +389,10 @@ packages:
dependency: transitive
description:
name: device_frame
sha256: afe76182aec178d171953d9b4a50a43c57c7cf3c77d8b09a48bf30c8fa04dd9d
sha256: d031a06f5d6f4750009672db98a5aa1536aa4a231713852469ce394779a23d75
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.2.0"
device_info_plus:
dependency: transitive
description:
Expand All @@ -413,10 +413,10 @@ packages:
dependency: "direct main"
description:
name: device_preview
sha256: "2f097bf31b929e15e6756dbe0ec1bcb63952ab9ed51c25dc5a2c722d2b21fdaf"
sha256: a694acdd3894b4c7d600f4ee413afc4ff917f76026b97ab06575fe886429ef19
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.2.0"
device_preview_screenshot:
dependency: "direct main"
description:
Expand Down Expand Up @@ -508,10 +508,11 @@ packages:
feature_discovery:
dependency: "direct main"
description:
name: feature_discovery
sha256: c4008f3d78515883354ab095cabaefbd5116fb7005b150d28cead306f03f4b30
url: "https://pub.dev"
source: hosted
path: "."
ref: master
resolved-ref: "7f8a0c93711771a9067b3feb1d41bd9128f70d42"
url: "https://github.com/maheshmnj/feature_discovery.git"
source: git
version: "0.14.1"
ffi:
dependency: "direct main"
Expand Down Expand Up @@ -927,10 +928,10 @@ packages:
dependency: "direct main"
description:
name: flutter_quill
sha256: f5c56ca799bc80fd30ff2a279f6990df2af3aef398083ec8676a04ac89c2eb05
sha256: "1ecdb81f6fd93691cfa8e6af1f8fe47c53377e0a13137682a18548ddf9d437b6"
url: "https://pub.dev"
source: hosted
version: "9.3.11"
version: "9.3.21"
flutter_radar_chart:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1473,10 +1474,10 @@ packages:
dependency: "direct main"
description:
name: intl
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
url: "https://pub.dev"
source: hosted
version: "0.18.1"
version: "0.19.0"
introduction_screen:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1537,26 +1538,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
url: "https://pub.dev"
source: hosted
version: "10.0.0"
version: "10.0.4"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.3"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "2.0.1"
version: "3.0.1"
like_button:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1657,10 +1658,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.12.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -2126,10 +2127,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.7.0"
timelines_plus:
dependency: "direct main"
description:
Expand Down Expand Up @@ -2326,10 +2327,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
url: "https://pub.dev"
source: hosted
version: "13.0.0"
version: "14.2.1"
watcher:
dependency: transitive
description:
Expand Down Expand Up @@ -2450,5 +2451,5 @@ packages:
source: hosted
version: "3.0.2"
sdks:
dart: ">=3.3.4 <4.0.0"
flutter: ">=3.19.0"
dart: ">=3.4.1 <4.0.0"
flutter: ">=3.22.0"
14 changes: 10 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: flutter_catalog
description: An app showcasing Flutter components, with side-by-side source code view.

version: 3.8.0+104
version: 3.8.1+105

environment:
sdk: ">=3.3.3 <4.0.0"
Expand All @@ -16,14 +16,14 @@ dependencies:
backdrop: ^0.9.1
badges: ^3.1.2
cached_network_image: ^3.3.1
chat_gpt_sdk: ^3.0.4
chat_gpt_sdk: ^3.0.9
cloud_firestore: ^4.17.0
cloud_firestore_web: ^3.12.0
community_charts_flutter: ^1.0.2
community_material_icon: ^5.9.55
convex_bottom_bar: ^3.2.0
day_night_switcher: ^0.2.0+1
device_preview: ^1.1.0
device_preview: ^1.2.0
device_preview_screenshot: ^1.0.0
dio: ^5.4.3+1
edge_detection: ^1.1.3
Expand Down Expand Up @@ -78,7 +78,7 @@ dependencies:
image_picker: ^1.1.0
in_app_purchase: ^3.2.0
in_app_review: ^2.0.9
intl: ^0.18.1
intl: ^0.19.0
introduction_screen: ^3.1.14
like_button: ^2.0.5
local_auth: ^2.2.0
Expand Down Expand Up @@ -118,6 +118,12 @@ dev_dependencies:
json_serializable: ^6.7.1
lint: ^2.3.0

dependency_overrides:
feature_discovery: # to support flutter v3.22+
git:
url: https://github.com/maheshmnj/feature_discovery.git
ref: master

# $ dart run flutter_launcher_icons
# Cf. https://pub.dev/packages/flutter_launcher_icons
flutter_launcher_icons:
Expand Down

0 comments on commit 1ffc05e

Please sign in to comment.