Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter 我的主题无法正常工作,有人能为我找到解决方案吗?_Flutter_Flutter Theme - Fatal编程技术网

Flutter 我的主题无法正常工作,有人能为我找到解决方案吗?

Flutter 我的主题无法正常工作,有人能为我找到解决方案吗?,flutter,flutter-theme,Flutter,Flutter Theme,请使用: import 'package:flutter/material.dart'; import 'first_page.dart'; import 'second_page.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget b

请使用:

import 'package:flutter/material.dart';

import 'first_page.dart';
import 'second_page.dart';

void main() {

  runApp(MyApp());
}

class MyApp extends StatelessWidget {

  // This widget is the root of your application.
  
@override
  
Widget build(BuildContext context) {
  
  return MaterialApp(
  
    theme: ThemeData.dark().copyWith(
  
      primaryColor: Color(0xFF0A0E21),
  
    scaffoldBackgroundColor:Colors.black12,
  
    ),
  
   home: First_page(),
  
    routes: {
  
      '/zero': (context)=> First_page(),
  
      '/first':(context)=> Second_page(),
  
      //'/second':(context)=>Screen2(),
  
    },

  
  );
  
}

}
ThemeData(
       primaryColor: Color(0xFF0A0E21),
       scaffoldBackgroundColor:Colors.black12,
    ),