我还是个初来乍到的人,所以我决定学习一个教程,教我如何使用Flight制作一个Spotify克隆版.他指定了一个定制的黑色主题,当他运行代码时,它确实是一个黑色主题,但当我运行它时,它仍然是白色的.我最初以为我在某个地方打了一个字,所以我复制了他的代码,但这并没有改变任何事情.
This is the result I want to get
我的main.dart文件
import 'package:flutter/material.dart';
void main() {
runApp(Spotify());
}
class Spotify extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Spotify UI',
debugShowCheckedModeBanner: false,
darkTheme: ThemeData(
brightness: Brightness.dark,
appBarTheme: const AppBarTheme(backgroundColor: Colors.black),
scaffoldBackgroundColor: const Color(0xFF121212),
backgroundColor: const Color(0xFF121212),
primaryColor: Colors.black,
accentColor: const Color(0xFF1DB954),
iconTheme: const IconThemeData().copyWith(color: Colors.black),
fontFamily: 'Montserrat',
textTheme: TextTheme(
headline2: const TextStyle(
color: Colors.white,
fontSize: 32.0,
fontWeight: FontWeight.bold,
),
headline4: TextStyle(
fontSize: 12.0,
color: Colors.grey[300],
fontWeight: FontWeight.w500,
letterSpacing: 2.0,
),
bodyText1: TextStyle(
color: Colors.grey[300],
fontSize: 14.0,
fontWeight: FontWeight.w600,
letterSpacing: 1.0,
),
bodyText2: TextStyle(
color: Colors.grey[300],
letterSpacing: 1.0,
),
),
),
home: Shell(),
);
}
}
class Shell extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
children: [
Expanded(
child: Row(
children: [
Container(
height: double.infinity,
width: 280.0,
color: Colors.green,
),
// PlaylistScreen
],
),
),
Container(
height: 84.0,
width: double.infinity,
color: Colors.blue,
),
],
),
);
}
}