diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c95801..15d215d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v1.0.1 (Jan 2, 2025) +- Updated `README.md` + ## v1.0.0 (Dec 6, 2024) - GA diff --git a/README.md b/README.md index 70da9bd..86407e1 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Add following dependencies and fonts for `SendbirdIcons` in `pubspec.yaml`. ```yaml dependencies: - sendbird_uikit: ^1.0.0 + sendbird_uikit: ^1.0.1 sendbird_chat_sdk: ^4.2.30 flutter: @@ -64,12 +64,7 @@ void main() async { await SendbirdUIKit.init(appId: 'YOUR_APP_ID'); await SendbirdUIKit.connect('YOUR_USER_ID'); - runApp(SendbirdUIKit.provider( - child: const MaterialApp( - debugShowCheckedModeBanner: false, - home: MyApp(), // This class will be implemented below. - ), - )); + runApp(const MyApp()); } ``` @@ -81,6 +76,27 @@ You can easily add `SBUGroupChannelListScreen`, `SBUGroupChannelCreateScreen` an class MyApp extends StatelessWidget { const MyApp({super.key}); + @override + Widget build(BuildContext context) { + return MaterialApp( + debugShowCheckedModeBanner: false, + builder: (context, child) { + return SendbirdUIKit.provider( + child: Navigator( + onGenerateRoute: (settings) => MaterialPageRoute( + builder: (context) => child!, + ), + ), + ); + }, + home: const HomeScreen(), // Separate screen widget + ); + } +} + +class HomeScreen extends StatelessWidget { + const HomeScreen({super.key}); + @override Widget build(BuildContext context) { return Scaffold( @@ -98,29 +114,35 @@ class MyApp extends StatelessWidget { } void moveToGroupChannelCreateScreen(BuildContext context) { - Navigator.of(context).push(MaterialPageRoute( - builder: (_) => Scaffold( - body: SafeArea( - child: SBUGroupChannelCreateScreen( - onChannelCreated: (channel) { - moveToGroupChannelScreen(context, channel.channelUrl); - }, + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => Scaffold( + body: SafeArea( + child: SBUGroupChannelCreateScreen( + onChannelCreated: (channel) { + moveToGroupChannelScreen(context, channel.channelUrl); + }, + ), ), ), ), - )); + ); } void moveToGroupChannelScreen(BuildContext context, String channelUrl) { - Navigator.of(context).push(MaterialPageRoute( - builder: (_) => Scaffold( - body: SafeArea( - child: SBUGroupChannelScreen( - channelUrl: channelUrl, + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => Scaffold( + body: SafeArea( + child: SBUGroupChannelScreen( + channelUrl: channelUrl, + ), ), ), ), - )); + ); } } ``` diff --git a/lib/src/public/sendbird_uikit.dart b/lib/src/public/sendbird_uikit.dart index b9a6598..644f243 100644 --- a/lib/src/public/sendbird_uikit.dart +++ b/lib/src/public/sendbird_uikit.dart @@ -18,7 +18,7 @@ import 'package:sendbird_uikit/src/internal/utils/sbu_reply_manager.dart'; /// SendbirdUIKit class SendbirdUIKit { /// UIKit version - static const version = '1.0.0'; + static const version = '1.0.1'; SendbirdUIKit._(); diff --git a/pubspec.yaml b/pubspec.yaml index 6d3c6b2..ec18253 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: sendbird_uikit description: With Sendbird UIKit for Flutter, you can easily build an in-app chat with all the essential messaging features. -version: 1.0.0 +version: 1.0.1 homepage: https://sendbird.com repository: https://github.com/sendbird/sendbird-uikit-flutter documentation: https://sendbird.com/docs/chat/uikit/v3/flutter/overview