Skip to content

Commit f149fd6

Browse files
committed
Merge branch 'develop' of https://github.com/GetStream/stream-feed-flutter into enriched_activity_generics
1 parent aecebcb commit f149fd6

File tree

2 files changed

+48
-23
lines changed

2 files changed

+48
-23
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ example/pubspec.lock
3131
coverage.lcov
3232
coverage/
3333
packages/stream_feed_flutter/example/.flutter-plugins-dependencies
34+
packages/stream_feed_flutter/example/.flutter-plugins-dependencies

example/lib/main.dart

+47-23
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import 'package:example/app_user.dart';
2-
import 'extension.dart';
2+
import 'package:example/client_provider.dart';
3+
import 'package:example/extension.dart';
4+
import 'package:example/home.dart';
5+
import 'package:flutter/foundation.dart';
36
import 'package:flutter/material.dart';
47
import 'package:stream_feed/stream_feed.dart';
58

6-
import 'client_provider.dart';
7-
import 'home.dart';
8-
99
void main() {
1010
WidgetsFlutterBinding.ensureInitialized();
1111
final _key = String.fromEnvironment('key');
@@ -18,22 +18,41 @@ void main() {
1818
);
1919
}
2020

21+
//ignore: public_member_api_docs
2122
class MyApp extends StatelessWidget {
22-
const MyApp({Key? key, required this.client}) : super(key: key);
23+
//ignore: public_member_api_docs
24+
const MyApp({
25+
required this.client,
26+
Key? key,
27+
}) : super(key: key);
28+
29+
//ignore: public_member_api_docs
2330
final StreamFeedClient client;
2431

2532
@override
33+
//ignore: prefer_expression_function_bodies
2634
Widget build(BuildContext context) {
2735
return MaterialApp(
2836
title: 'Stream Feed Demo',
29-
home: LoginScreen(),
30-
builder: (context, child) =>
31-
ClientProvider(client: client, child: child!),
37+
home: const LoginScreen(),
38+
builder: (context, child) => ClientProvider(
39+
client: client,
40+
child: child!,
41+
),
3242
);
3343
}
44+
45+
@override
46+
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
47+
super.debugFillProperties(properties);
48+
properties.add(DiagnosticsProperty<StreamFeedClient>('client', client));
49+
}
3450
}
3551

52+
//ignore: public_member_api_docs
3653
class LoginScreen extends StatefulWidget {
54+
//ignore: public_member_api_docs
55+
const LoginScreen({Key? key}) : super(key: key);
3756
@override
3857
_LoginScreenState createState() => _LoginScreenState();
3958
}
@@ -46,28 +65,28 @@ class _LoginScreenState extends State<LoginScreen> {
4665
return Scaffold(
4766
// backgroundColor: Colors.grey.shade100,
4867
body: Padding(
49-
padding: const EdgeInsets.symmetric(horizontal: 24.0),
50-
child: Container(
68+
padding: const EdgeInsets.symmetric(horizontal: 24),
69+
child: SizedBox(
5170
width: size.width,
5271
height: size.height,
5372
child: Column(
5473
mainAxisAlignment: MainAxisAlignment.center,
5574
children: [
56-
Text(
75+
const Text(
5776
'Login with a User',
5877
style: TextStyle(
5978
fontSize: 42,
6079
fontWeight: FontWeight.w500,
6180
),
6281
),
63-
SizedBox(height: 42),
82+
const SizedBox(height: 42),
6483
for (final user in appUsers)
6584
Padding(
66-
padding: const EdgeInsets.all(8.0),
67-
child: RaisedButton(
85+
padding: const EdgeInsets.all(8),
86+
child: ElevatedButton(
6887
onPressed: () async {
6988
ScaffoldMessenger.of(context).showSnackBar(
70-
SnackBar(
89+
const SnackBar(
7190
content: Text('Loading User'),
7291
),
7392
);
@@ -76,7 +95,7 @@ class _LoginScreenState extends State<LoginScreen> {
7695
getOrCreate: true,
7796
);
7897
ScaffoldMessenger.of(context).showSnackBar(
79-
SnackBar(
98+
const SnackBar(
8099
content: Text('User Loaded'),
81100
),
82101
);
@@ -88,25 +107,30 @@ class _LoginScreenState extends State<LoginScreen> {
88107
),
89108
);
90109
},
91-
padding: const EdgeInsets.symmetric(horizontal: 4.0),
92-
color: Colors.white,
93-
shape: RoundedRectangleBorder(
94-
borderRadius: BorderRadius.circular(24.0),
110+
style: ElevatedButton.styleFrom(
111+
padding: const EdgeInsets.symmetric(horizontal: 4),
112+
primary: Colors.white,
113+
shape: RoundedRectangleBorder(
114+
borderRadius: BorderRadius.circular(24),
115+
),
95116
),
96117
child: Padding(
97118
padding: const EdgeInsets.symmetric(
98-
vertical: 36.0, horizontal: 24.0),
119+
vertical: 36, horizontal: 24),
99120
child: Row(
100121
mainAxisAlignment: MainAxisAlignment.spaceBetween,
101122
children: [
102123
Text(
103124
user.name,
104-
style: TextStyle(
125+
style: const TextStyle(
105126
fontSize: 24,
106127
color: Colors.blue,
107128
),
108129
),
109-
Icon(Icons.arrow_forward_ios)
130+
Icon(
131+
Icons.arrow_forward_ios,
132+
color: Theme.of(context).colorScheme.onSurface,
133+
)
110134
],
111135
),
112136
),

0 commit comments

Comments
 (0)