diff options
| author | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
|---|---|---|
| committer | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
| commit | 449d8b74bd6d9dae98a07254cdfad677b920e7b0 (patch) | |
| tree | c131c3528c4d517f56e19b854a7453fedb097d40 /plugins/aves_ui | |
| download | aves-src-master.tar.gz aves-src-master.zip | |
Diffstat (limited to 'plugins/aves_ui')
| -rw-r--r-- | plugins/aves_ui/.gitignore | 45 | ||||
| -rw-r--r-- | plugins/aves_ui/.metadata | 10 | ||||
| -rw-r--r-- | plugins/aves_ui/analysis_options.yaml | 1 | ||||
| -rw-r--r-- | plugins/aves_ui/lib/aves_ui.dart | 1 | ||||
| -rw-r--r-- | plugins/aves_ui/lib/src/dot.dart | 62 | ||||
| -rw-r--r-- | plugins/aves_ui/pubspec.yaml | 16 |
6 files changed, 135 insertions, 0 deletions
diff --git a/plugins/aves_ui/.gitignore b/plugins/aves_ui/.gitignore new file mode 100644 index 0000000..79c113f --- /dev/null +++ b/plugins/aves_ui/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/plugins/aves_ui/.metadata b/plugins/aves_ui/.metadata new file mode 100644 index 0000000..c24d00d --- /dev/null +++ b/plugins/aves_ui/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 5464c5bac742001448fe4fc0597be939379f88ea + channel: stable + +project_type: package diff --git a/plugins/aves_ui/analysis_options.yaml b/plugins/aves_ui/analysis_options.yaml new file mode 100644 index 0000000..f04c6cf --- /dev/null +++ b/plugins/aves_ui/analysis_options.yaml @@ -0,0 +1 @@ +include: ../../analysis_options.yaml diff --git a/plugins/aves_ui/lib/aves_ui.dart b/plugins/aves_ui/lib/aves_ui.dart new file mode 100644 index 0000000..148314a --- /dev/null +++ b/plugins/aves_ui/lib/aves_ui.dart @@ -0,0 +1 @@ +export 'src/dot.dart'; diff --git a/plugins/aves_ui/lib/src/dot.dart b/plugins/aves_ui/lib/src/dot.dart new file mode 100644 index 0000000..5ae99af --- /dev/null +++ b/plugins/aves_ui/lib/src/dot.dart @@ -0,0 +1,62 @@ +import 'package:flutter/material.dart'; + +class AvesDot extends StatelessWidget { + final double diameter, outerBorderWidth, innerBorderWidth; + final Color Function(bool isDark) getOuterBorderColor, getInnerBorderColor; + + const AvesDot({ + super.key, + this.diameter = 16, + this.outerBorderWidth = 1.5, + this.innerBorderWidth = 2, + this.getOuterBorderColor = themedOuterBorderColor, + this.getInnerBorderColor = themedInnerBorderColor, + }); + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final isDark = theme.brightness == Brightness.dark; + final outerBorderColor = getOuterBorderColor(isDark); + final innerBorderColor = getInnerBorderColor(isDark); + final outerBorderRadius = BorderRadius.all(Radius.circular(diameter)); + final innerRadius = Radius.circular(diameter - outerBorderWidth); + final innerBorderRadius = BorderRadius.all(innerRadius); + + final outerDecoration = BoxDecoration( + border: Border.fromBorderSide(BorderSide( + color: outerBorderColor, + width: outerBorderWidth, + )), + borderRadius: outerBorderRadius, + ); + + final innerDecoration = BoxDecoration( + border: Border.fromBorderSide(BorderSide( + color: innerBorderColor, + width: innerBorderWidth, + )), + borderRadius: innerBorderRadius, + ); + + return Container( + decoration: outerDecoration, + child: DecoratedBox( + decoration: innerDecoration, + position: DecorationPosition.foreground, + child: ClipRRect( + borderRadius: innerBorderRadius, + child: Container( + width: diameter, + height: diameter, + color: theme.colorScheme.primary, + ), + ), + ), + ); + } + + static Color themedOuterBorderColor(bool isDark) => isDark ? Colors.white30 : Colors.black26; + + static Color themedInnerBorderColor(bool isDark) => isDark ? const Color(0xFF212121) : Colors.white; +} diff --git a/plugins/aves_ui/pubspec.yaml b/plugins/aves_ui/pubspec.yaml new file mode 100644 index 0000000..0d730fd --- /dev/null +++ b/plugins/aves_ui/pubspec.yaml @@ -0,0 +1,16 @@ +name: aves_ui +version: 0.0.1 +publish_to: none + +environment: + sdk: ">=3.6.0 <4.0.0" # incoherent dartfmt from 3.7.0 +resolution: workspace + +dependencies: + flutter: + sdk: flutter + +dev_dependencies: + flutter_lints: + +flutter: |
