Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix deprecated styling in example #588

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,8 @@ class _CreateAuthorPageState extends State<CreateAuthorPage> {
const SizedBox(height: 16),
if (error != null)
Text(error!,
style: Theme.of(context)
.textTheme
.bodyText2!
.copyWith(color: Theme.of(context).errorColor)),
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: Theme.of(context).colorScheme.error)),
Consumer(builder: (context, ref, _) {
return ElevatedButton(
onPressed: loading
Expand Down
2 changes: 1 addition & 1 deletion examples/pokemon_explorer/lib/src/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class App extends StatelessWidget {
builder: (_) => PokemonDetailScreen(
id: (settings.arguments as Map)["id"]!));
default:
return MaterialPageRoute(builder: (_) => Scaffold());
return MaterialPageRoute(builder: (_) => const Scaffold());
}
},
);
Expand Down
8 changes: 4 additions & 4 deletions examples/pokemon_explorer/lib/src/pokemon_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import './graphql/__generated__/pokemon_card_fragment.data.gql.dart';
class PokemonCard extends StatelessWidget {
final GPokemonCard pokemon;

const PokemonCard({required this.pokemon});
const PokemonCard({super.key, required this.pokemon});

@override
Widget build(BuildContext context) {
Expand All @@ -30,15 +30,15 @@ class PokemonCard extends StatelessWidget {
),
Text(
pokemon.name,
style: Theme.of(context).textTheme.headline6,
style: Theme.of(context).textTheme.titleLarge,
),
Text(
'height: ${pokemon.height?.in_meter ?? 0}',
style: Theme.of(context).textTheme.subtitle1,
style: Theme.of(context).textTheme.titleMedium,
),
Text(
'weight: ${pokemon.weight?.in_kg ?? 0}',
style: Theme.of(context).textTheme.subtitle1,
style: Theme.of(context).textTheme.titleMedium,
)
],
),
Expand Down
16 changes: 8 additions & 8 deletions examples/pokemon_explorer/lib/src/pokemon_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PokemonDetailScreen extends StatelessWidget {

final int id;

PokemonDetailScreen({required this.id});
PokemonDetailScreen({super.key, required this.id});

@override
Widget build(BuildContext context) {
Expand All @@ -30,7 +30,7 @@ class PokemonDetailScreen extends StatelessWidget {
if (response!.loading)
return Scaffold(
appBar: AppBar(),
body: Center(child: CircularProgressIndicator()));
body: const Center(child: CircularProgressIndicator()));

final pokemon = response.data?.pokemon;

Expand All @@ -43,20 +43,20 @@ class PokemonDetailScreen extends StatelessWidget {
PokemonCard(
pokemon: pokemon,
),
Padding(
padding: const EdgeInsets.all(8.0),
const Padding(
padding: EdgeInsets.all(8.0),
),
Text(
'Height',
style: Theme.of(context).textTheme.headline6,
style: Theme.of(context).textTheme.titleLarge,
),
if (pokemon != null) Text('${pokemon.height?.in_meter ?? 0}'),
Padding(
padding: const EdgeInsets.all(8.0),
const Padding(
padding: EdgeInsets.all(8.0),
),
Text(
'Weight',
style: Theme.of(context).textTheme.headline6,
style: Theme.of(context).textTheme.titleLarge,
),
if (pokemon != null) Text('${pokemon.weight?.in_kg ?? 0}'),
],
Expand Down
4 changes: 3 additions & 1 deletion examples/pokemon_explorer/lib/src/pokemon_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ import './pokemon_card.dart';
class PokemonListScreen extends StatelessWidget {
final client = GetIt.I<TypedLink>();

PokemonListScreen({super.key});

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('All Pokemon'),
title: const Text('All Pokemon'),
),
body: Operation<GAllPokemonData, GAllPokemonVars>(
client: client,
Expand Down
2 changes: 1 addition & 1 deletion examples/pokemon_explorer/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: pokemon_explorer
version: 0.0.3-dev.4
publish_to: none
environment:
sdk: '>=2.12.0 <3.0.0'
sdk: '>=3.0.0 <4.0.0'
dependencies:
gql_link: '>=0.5.0 <2.0.0'
gql_http_link: '>=0.4.0 <2.0.0'
Expand Down
1 change: 0 additions & 1 deletion packages/ferry/lib/ferry_isolate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ class IsolateClient extends TypedLink {
_commandSendPort.send(DisposeCommand(receivePort.sendPort));
await receivePort.first;
receivePort.close();
_globalReceivePort.close();
_messageHandlerReceivePort?.close();
return super.dispose();
}
Expand Down
1 change: 1 addition & 0 deletions packages/ferry/lib/src/gql_typed_link.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class GqlTypedLink extends TypedLink {
: ServerException(
originalException: error,
parsedResponse: null,
originalStackTrace: stackTrace,
),
dataSource: DataSource.Link,
),
Expand Down
Loading