5 changed files with 74 additions and 0 deletions
@ -0,0 +1,9 @@ |
|||
import 'package:get/get.dart'; |
|||
import '../controllers/timbre_controller.dart'; |
|||
|
|||
class TimbreBinding extends Bindings { |
|||
@override |
|||
void dependencies() { |
|||
Get.put<TimbreController>(TimbreController()); |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
import 'package:get/get.dart'; |
|||
|
|||
class TimbreController extends GetxController { |
|||
@override |
|||
void onInit() { |
|||
super.onInit(); |
|||
} |
|||
} |
|||
@ -0,0 +1,49 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|||
import 'package:get/get.dart'; |
|||
import '../controllers/timbre_controller.dart'; |
|||
|
|||
class TimbreView extends GetView<TimbreController> { |
|||
const TimbreView({Key? key}) : super(key: key); |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
final isDarkMode = Theme.of(context).brightness == Brightness.dark; |
|||
|
|||
return Scaffold( |
|||
backgroundColor: isDarkMode ? Colors.black : Colors.grey[50], |
|||
appBar: _buildAppBar(isDarkMode), |
|||
body: _buildBody(context, isDarkMode), |
|||
); |
|||
} |
|||
|
|||
// 构建应用栏 |
|||
PreferredSizeWidget _buildAppBar(bool isDarkMode) { |
|||
return AppBar( |
|||
backgroundColor: isDarkMode ? Colors.black : Colors.white, |
|||
elevation: 0.5, |
|||
leading: IconButton( |
|||
icon: Icon( |
|||
Icons.arrow_back_ios, |
|||
color: isDarkMode ? Colors.white : Colors.black, |
|||
size: 20.sp, |
|||
), |
|||
onPressed: () => Get.back(), |
|||
), |
|||
title: Text( |
|||
'选择音色', |
|||
style: TextStyle( |
|||
fontSize: 17.sp, |
|||
fontWeight: FontWeight.w600, |
|||
color: isDarkMode ? Colors.white : Colors.black, |
|||
), |
|||
), |
|||
centerTitle: true, |
|||
); |
|||
} |
|||
|
|||
// 构建主体内容 |
|||
Widget _buildBody(BuildContext context, bool isDarkMode) { |
|||
return Container(); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue