import 'package:flutter/material.dart';
void main() {
runApp(const PixelPage());
}
class PixelPage extends StatelessWidget {
const PixelPage({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: NestedScrollView(
headerSliverBuilder: (context, isScrolled) {
return [
SliverAppBar(
pinned: true,
expandedHeight: 200,
flexibleSpace: FlexibleSpaceBar(
background: Image.asset(
'assets/pixel_google.jpg',
fit: BoxFit.fitWidth,
),
title: const Text('Google Pixel'),
titlePadding: const EdgeInsets.only(left: 16.0, bottom: 16.0),
),
),
];
},
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
r'$735',
style: Theme.of(context).textTheme.headlineSmall,
),
],
)
],
),
),
),
),
),
);
}
}