Browse Source

dart format .

heavyrain 4 months ago
parent
commit
bb243862af

+ 0 - 1
lib/dao/user_dao.dart

@@ -1,6 +1,5 @@
 import 'package:flutter_clock/model/user_model.dart';
 
-
 class UserDao {
   /// 登录
   Future<UserModel?> login(String username, String password) async {

+ 10 - 10
lib/model/constants.dart

@@ -1,12 +1,12 @@
-  import 'package:flutter/material.dart';
+import 'package:flutter/material.dart';
 
-  const Color kPrimaryColor = Color(0xFF366CF6);
-  const Color kSecondaryColor = Color(0xFFF5F6FC);
-  const Color kBgLightColor = Color(0xFFF2F4FC);
-  const Color kBgDarkColor = Color(0xFFEBEDFA);
-  const Color kBadgeColor = Color(0xFFEE376E);
-  const Color kGrayColor = Color(0xFF8793B2);
-  const Color kTitleTextColor = Color(0xFF30384D);
-  const Color kTextColor = Color(0xFF4D5875);
+const Color kPrimaryColor = Color(0xFF366CF6);
+const Color kSecondaryColor = Color(0xFFF5F6FC);
+const Color kBgLightColor = Color(0xFFF2F4FC);
+const Color kBgDarkColor = Color(0xFFEBEDFA);
+const Color kBadgeColor = Color(0xFFEE376E);
+const Color kGrayColor = Color(0xFF8793B2);
+const Color kTitleTextColor = Color(0xFF30384D);
+const Color kTextColor = Color(0xFF4D5875);
 
-  const double kDefaultPadding = 20.0;
+const double kDefaultPadding = 20.0;

+ 1 - 1
lib/model/timer_settings.dart

@@ -37,4 +37,4 @@ class TimerSettings {
       loop: prefs.getBool(_loopKey) ?? true,
     );
   }
-} 
+}

+ 1 - 3
lib/model/user_model.dart

@@ -7,7 +7,7 @@ class UserModel {
     required this.userid,
     required this.password,
     required this.logo,
-  }); 
+  });
 
   factory UserModel.fromJson(Map<String, dynamic> json) {
     return UserModel(
@@ -24,6 +24,4 @@ class UserModel {
       'logo': logo,
     };
   }
-  
-  
 }

+ 1 - 1
lib/pages/alarm_page.dart

@@ -18,4 +18,4 @@ class _AlarmPageState extends State<AlarmPage> {
       ),
     );
   }
-} 
+}

+ 1 - 1
lib/pages/clock_page.dart

@@ -88,4 +88,4 @@ class InnerFaceClipper extends CustomClipper<Rect> {
 
   @override
   bool shouldReclip(CustomClipper oldClipper) => true;
-} 
+}

+ 6 - 2
lib/pages/main_page.dart

@@ -16,7 +16,8 @@ class MainPage extends StatefulWidget {
   }
 }
 
-class _MainPageState extends State<MainPage> with SingleTickerProviderStateMixin {
+class _MainPageState extends State<MainPage>
+    with SingleTickerProviderStateMixin {
   late TabController _tabController;
   final List<Widget> _tabs = [
     Tab(child: Text('Alarm', style: TextStyle(fontSize: 16))),
@@ -32,7 +33,10 @@ class _MainPageState extends State<MainPage> with SingleTickerProviderStateMixin
   @override
   void initState() {
     super.initState();
-    _tabController = TabController(length: 4, vsync: this, initialIndex: 3); // Timer tab is selected by default
+    _tabController = TabController(
+        length: 4,
+        vsync: this,
+        initialIndex: 3); // Timer tab is selected by default
     Timer.periodic(Duration(seconds: 1),
         (_) => setState(() => _localTime = DateTime.now()));
   }

+ 1 - 1
lib/pages/splash_page.dart

@@ -20,4 +20,4 @@ class _SplashPageState extends State<SplashPage> {
       ),
     );
   }
-}
+}

+ 1 - 1
lib/pages/stopwatch_page.dart

@@ -18,4 +18,4 @@ class _StopwatchPageState extends State<StopwatchPage> {
       ),
     );
   }
-} 
+}

+ 1 - 3
lib/utils/app_utils.dart

@@ -1,3 +1 @@
-class AppUtils{
-  
-}
+class AppUtils {}

+ 12 - 11
lib/utils/audio_manager.dart

@@ -5,18 +5,18 @@ class AudioManager {
   static final AudioManager _instance = AudioManager._internal();
   final AudioPlayer _audioPlayer = AudioPlayer();
   bool _isPlaying = false;
-  
+
   factory AudioManager() {
     return _instance;
   }
-  
+
   AudioManager._internal();
-  
+
   Future<void> playSound(String sound, double volume, bool loop) async {
     if (_isPlaying) {
       await stopSound();
     }
-    
+
     // For this example, we're using dummy sound mapping
     // In a real app, you would have actual sound files
     String soundAsset;
@@ -33,33 +33,34 @@ class AudioManager {
       default:
         soundAsset = 'assets/sounds/dripping.mp3';
     }
-    
+
     await _audioPlayer.setVolume(volume);
-    await _audioPlayer.setReleaseMode(loop ? ReleaseMode.loop : ReleaseMode.release);
+    await _audioPlayer
+        .setReleaseMode(loop ? ReleaseMode.loop : ReleaseMode.release);
     await _audioPlayer.play(AssetSource(soundAsset));
     _isPlaying = true;
   }
-  
+
   Future<void> stopSound() async {
     await _audioPlayer.stop();
     _isPlaying = false;
   }
-  
+
   Future<void> triggerVibration() async {
     if (await Vibration.hasVibrator() ?? false) {
       Vibration.vibrate(pattern: [500, 1000, 500, 1000], repeat: 1);
     }
   }
-  
+
   Future<void> stopVibration() async {
     if (await Vibration.hasVibrator() ?? false) {
       Vibration.cancel();
     }
   }
-  
+
   Future<void> dispose() async {
     await stopSound();
     await stopVibration();
     await _audioPlayer.dispose();
   }
-} 
+}

+ 5 - 5
lib/utils/screen_manager.dart

@@ -2,19 +2,19 @@ import 'package:wakelock/wakelock.dart';
 
 class ScreenManager {
   static bool _wakeLockEnabled = false;
-  
+
   static bool get isWakeLockEnabled => _wakeLockEnabled;
-  
+
   static Future<void> enableWakeLock() async {
     await Wakelock.enable();
     _wakeLockEnabled = true;
   }
-  
+
   static Future<void> disableWakeLock() async {
     await Wakelock.disable();
     _wakeLockEnabled = false;
   }
-  
+
   static Future<void> toggleWakeLock() async {
     if (_wakeLockEnabled) {
       await disableWakeLock();
@@ -22,4 +22,4 @@ class ScreenManager {
       await enableWakeLock();
     }
   }
-} 
+}

+ 0 - 1
lib/views/side_menu.dart

@@ -59,7 +59,6 @@ class SideMenu extends StatelessWidget {
                 showBorder: false,
                 itemCount: 0,
               ),
-
             ],
           ),
         ),