Skip to content

Commit

Permalink
chore: fix deprecated styling in example
Browse files Browse the repository at this point in the history
  • Loading branch information
knaeckeKami committed Apr 5, 2024
1 parent 814fe90 commit 9d5c0d9
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 19 deletions.
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: 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

0 comments on commit 9d5c0d9

Please sign in to comment.