Reduced the code
This commit is contained in:
@@ -61,50 +61,10 @@ The second type looks like this:
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
We can use a `Stack` for achieving this, here's a complete working implementation:
|
We can use a `Stack` for achieving this:
|
||||||
|
|
||||||
```dart
|
```dart
|
||||||
class MyApp extends StatelessWidget {
|
Stack(
|
||||||
const MyApp({
|
|
||||||
Key? key,
|
|
||||||
required this.client,
|
|
||||||
required this.channel,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
final StreamChatClient client;
|
|
||||||
|
|
||||||
final Channel channel;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) => MaterialApp(
|
|
||||||
theme: ThemeData.light(),
|
|
||||||
darkTheme: ThemeData.dark(),
|
|
||||||
builder: (context, widget) => StreamChat(
|
|
||||||
client: client,
|
|
||||||
child: widget,
|
|
||||||
streamChatThemeData: StreamChatThemeData().copyWith(
|
|
||||||
messageListViewTheme: const MessageListViewThemeData(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
home: StreamChannel(
|
|
||||||
channel: channel,
|
|
||||||
child: const ChannelPage(),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
class ChannelPage extends StatelessWidget {
|
|
||||||
const ChannelPage({
|
|
||||||
Key? key,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Scaffold(
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
body: Stack(
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
// Add your video implementation here
|
// Add your video implementation here
|
||||||
ShaderMask(
|
ShaderMask(
|
||||||
@@ -121,15 +81,17 @@ class ChannelPage extends StatelessWidget {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: const [
|
children: const [
|
||||||
Expanded(
|
Expanded(
|
||||||
|
child: MessageListViewTheme(
|
||||||
|
data: MessageListViewThemeData(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
),
|
||||||
child: MessageListView(),
|
child: MessageListView(),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
MessageInput(),
|
MessageInput(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user