mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 15:24:35 +01:00
opt. proj struct
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:toolbox/data/res/color.dart';
|
||||
import 'package:toolbox/data/res/menu.dart';
|
||||
import 'package:toolbox/generated/l10n.dart';
|
||||
|
||||
import '../../data/res/menu.dart';
|
||||
import '../../generated/l10n.dart';
|
||||
import 'primary_color.dart';
|
||||
|
||||
class DropdownBtnItem {
|
||||
final String text;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:toolbox/data/res/color.dart';
|
||||
|
||||
import 'primary_color.dart';
|
||||
|
||||
InputDecoration buildDecoration(String label,
|
||||
{TextStyle? textStyle, IconData? icon, String? hint}) {
|
||||
|
||||
20
lib/view/widget/primary_color.dart
Normal file
20
lib/view/widget/primary_color.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../data/store/setting.dart';
|
||||
import '../../locator.dart';
|
||||
|
||||
final _primaryColor = locator<SettingStore>().primaryColor.listenable();
|
||||
|
||||
class PrimaryColor extends StatelessWidget {
|
||||
final Widget Function(BuildContext context, Color primaryColor) builder;
|
||||
|
||||
const PrimaryColor({Key? key, required this.builder}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ValueListenableBuilder<int>(
|
||||
builder: (context, c, child) => builder(context, Color(c)),
|
||||
valueListenable: _primaryColor,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user