Есть ошибка в строке 68, не могу понять почему она появилась и как её решить.
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
scaffoldBackgroundColor: Colors.black,
colorScheme: ColorScheme.fromSeed(seedColor: const Color.fromARGB(255, 202, 185, 33)),
useMaterial3: true,
textTheme: const TextTheme(
bodyMedium: TextStyle(
color: Colors.white,
fontWeight: FontWeight.w500,
fontSize: 20,
),
),
),
home: const MyHomePage(title: 'CryptoCurrenciesList'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: ListView.builder(
itemCount: 10,
itemBuilder: (context, i) => const ListTile(
title: Text(
"Bitcoin",
style: theme.textTheme.bodyMedium,
),
subtitle: Text('2000\$',
style: TextStyle(
color: Colors.white.withOpacity(0.6),
fontWeight: FontWeight.w700,
fontSize: 14,
),
),
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: const Icon(Icons.add),
),
);
}
}