如何在主题上更改Colors.orage ro Colors.orage [800]?

时间:2019-05-16 17:08:22

标签: dart flutter flutter-layout flutter-dependencies flutter-animation

我需要更改整个应用程序主题。我将此添加到我的主要方法中。是更改整个应用程序主题的最佳方法还是另一种方法?请告诉我。

@override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: new ThemeData(
        primarySwatch: Colors.orange
      ),

我需要更改为Colors.orange [800]。我添加了此颜色代码,但未出现工作错误。

1 个答案:

答案 0 :(得分:1)

public function searchResponse(Request $request){ $query1 = $request->get('term',''); $c1=\DB::table('T_EMPLOYEE_SERVICE_AREAS'); if($request->type=='EmpService') { $c1->where('EmployeeService','LIKE','%'.$query1.'%') ->groupBy('EmployeeService') ->get(); } $c1=$c1->get(); $data=array(); foreach ($c1 as $service) { $data[]=array('EmployeeService'=>$service->EmployeeService); } if(count($data)) return $data; else return ['EmployeeService'=>'']; } primarySwatch以外,MaterialColorColors.orange[800]

要解决此问题,您可以将Color设置为primaryColor see the difference between primarySwatch and primaryColor

或者为primarySwatch创建自定义Colors.orange[800]对象,如下所示:

MaterialColor