fix marker rendering & modernize riding widgets for dark mode - 2026-04-11
This commit is contained in:
@@ -6,14 +6,14 @@ import 'mydialoug.dart';
|
||||
|
||||
class MyCircleContainer extends StatelessWidget {
|
||||
final Widget child;
|
||||
final Color backgroundColor;
|
||||
final Color borderColor;
|
||||
final Color? backgroundColor;
|
||||
final Color? borderColor;
|
||||
|
||||
MyCircleContainer({
|
||||
Key? key,
|
||||
required this.child,
|
||||
this.backgroundColor = AppColor.secondaryColor,
|
||||
this.borderColor = AppColor.accentColor,
|
||||
this.backgroundColor,
|
||||
this.borderColor,
|
||||
}) : super(key: key);
|
||||
|
||||
final controller = Get.put(CircleController());
|
||||
@@ -40,9 +40,9 @@ class MyCircleContainer extends StatelessWidget {
|
||||
height: controller.size,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: controller.backgroundColor,
|
||||
color: controller.isAccented ? AppColor.accentColor : (backgroundColor ?? AppColor.secondaryColor),
|
||||
border: Border.all(
|
||||
color: borderColor,
|
||||
color: borderColor ?? AppColor.accentColor,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
@@ -53,12 +53,10 @@ class MyCircleContainer extends StatelessWidget {
|
||||
}
|
||||
|
||||
class CircleController extends GetxController {
|
||||
Color backgroundColor = AppColor.secondaryColor;
|
||||
bool isAccented = false;
|
||||
double size = 40;
|
||||
void changeColor() {
|
||||
backgroundColor = backgroundColor == AppColor.secondaryColor
|
||||
? AppColor.accentColor
|
||||
: AppColor.secondaryColor;
|
||||
isAccented = !isAccented;
|
||||
size = 60;
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -26,18 +26,18 @@ class IconWidgetMenu extends StatelessWidget {
|
||||
children: [
|
||||
Container(
|
||||
width: 40,
|
||||
decoration: const BoxDecoration(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.secondaryColor,
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.secondaryColor,
|
||||
offset: Offset(-2, -2),
|
||||
offset: const Offset(-2, -2),
|
||||
blurRadius: 0,
|
||||
spreadRadius: 0,
|
||||
blurStyle: BlurStyle.outer,
|
||||
),
|
||||
BoxShadow(
|
||||
const BoxShadow(
|
||||
color: AppColor.accentColor,
|
||||
offset: Offset(3, 3),
|
||||
blurRadius: 0,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../constant/style.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../constant/colors.dart';
|
||||
|
||||
class MyCircularProgressIndicatorWithTimer extends StatefulWidget {
|
||||
final Color backgroundColor;
|
||||
@@ -8,7 +9,7 @@ class MyCircularProgressIndicatorWithTimer extends StatefulWidget {
|
||||
|
||||
const MyCircularProgressIndicatorWithTimer({
|
||||
Key? key,
|
||||
this.backgroundColor = Colors.white,
|
||||
this.backgroundColor = Colors.transparent,
|
||||
required this.isLoading,
|
||||
}) : super(key: key);
|
||||
|
||||
@@ -88,7 +89,7 @@ class _MyCircularProgressIndicatorWithTimerState
|
||||
height: 200,
|
||||
decoration: BoxDecoration(
|
||||
color: widget.backgroundColor == Colors.transparent
|
||||
? Colors.white.withOpacity(0.96)
|
||||
? AppColor.secondaryColor.withOpacity(0.96)
|
||||
: widget.backgroundColor,
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
@@ -110,7 +111,9 @@ class _MyCircularProgressIndicatorWithTimerState
|
||||
child: CircularProgressIndicator(
|
||||
value: progress,
|
||||
strokeWidth: 6,
|
||||
backgroundColor: Colors.grey.shade100,
|
||||
backgroundColor: Get.isDarkMode
|
||||
? Colors.grey.shade800
|
||||
: Colors.grey.shade100,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(timerColor),
|
||||
strokeCap: StrokeCap.round,
|
||||
),
|
||||
@@ -139,9 +142,8 @@ class _MyCircularProgressIndicatorWithTimerState
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: _isLowTime
|
||||
? Colors.orangeAccent
|
||||
: Colors.blueGrey.shade800,
|
||||
color:
|
||||
_isLowTime ? Colors.orangeAccent : AppColor.writeColor,
|
||||
letterSpacing: 1.2,
|
||||
fontFeatures: const [FontFeature.tabularFigures()],
|
||||
),
|
||||
|
||||
@@ -9,16 +9,13 @@ class MyScafolld extends StatelessWidget {
|
||||
super.key,
|
||||
required this.title,
|
||||
required this.body,
|
||||
this.action = const Icon(
|
||||
Icons.clear,
|
||||
color: AppColor.secondaryColor,
|
||||
),
|
||||
this.action,
|
||||
required this.isleading,
|
||||
});
|
||||
|
||||
final String title;
|
||||
final List<Widget> body;
|
||||
final Widget action;
|
||||
final Widget? action;
|
||||
final bool isleading;
|
||||
|
||||
@override
|
||||
@@ -33,13 +30,18 @@ class MyScafolld extends StatelessWidget {
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
icon: const Icon(
|
||||
icon: Icon(
|
||||
Icons.arrow_back_ios_new,
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
)
|
||||
: const SizedBox(),
|
||||
actions: [action],
|
||||
actions: [
|
||||
action ?? Icon(
|
||||
Icons.clear,
|
||||
color: AppColor.secondaryColor,
|
||||
)
|
||||
],
|
||||
title: Text(
|
||||
title,
|
||||
style: AppStyle.title.copyWith(fontSize: 30),
|
||||
|
||||
@@ -62,8 +62,8 @@ class _GlassCard extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(_DC.radius),
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Colors.white.withOpacity(0.95),
|
||||
Colors.white.withOpacity(0.88),
|
||||
AppColor.secondaryColor.withOpacity(0.95),
|
||||
AppColor.secondaryColor.withOpacity(0.88),
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
@@ -82,7 +82,7 @@ class _GlassCard extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
border: Border.all(
|
||||
color: Colors.white.withOpacity(0.6),
|
||||
color: AppColor.secondaryColor.withOpacity(0.6),
|
||||
width: 1.2,
|
||||
),
|
||||
),
|
||||
@@ -247,7 +247,7 @@ class _SpeakButtonState extends State<_SpeakButton>
|
||||
setState(() => _speaking = true);
|
||||
_pulse.repeat(reverse: true);
|
||||
|
||||
final tts = Get.put(TextToSpeechController());
|
||||
final tts = Get.find<TextToSpeechController>();
|
||||
for (final t in widget.texts) {
|
||||
await tts.speakText(t);
|
||||
}
|
||||
@@ -367,7 +367,7 @@ class MyDialog extends GetxController {
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: -0.4,
|
||||
color: Colors.black87,
|
||||
color: AppColor.writeColor,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -467,7 +467,7 @@ class MyDialogContent extends GetxController {
|
||||
fontSize: 17,
|
||||
fontWeight: FontWeight.w700,
|
||||
letterSpacing: -0.3,
|
||||
color: Colors.black87,
|
||||
color: AppColor.writeColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user