diff --git a/CHANGELOG.md b/CHANGELOG.md index 984ada5..bb2e554 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.0.4+5 - 2023-10-30 +### Added +- add en & zh lang +- add api reference button + ## 1.0.3+4 - 2023-10-28 ### Added - add ccupertino button diff --git a/lib/src/ui/pages/shared/code_space/code_space.dart b/lib/src/ui/pages/shared/code_space/code_space.dart index c98f38f..2a1ac02 100644 --- a/lib/src/ui/pages/shared/code_space/code_space.dart +++ b/lib/src/ui/pages/shared/code_space/code_space.dart @@ -8,7 +8,6 @@ import 'package:flutter/services.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; import 'package:url_launcher/url_launcher.dart'; -import 'package:url_launcher/url_launcher_string.dart'; part 'code_space.g.dart'; diff --git a/lib/src/ui/pages/shared/shared_code_view.dart b/lib/src/ui/pages/shared/shared_code_view.dart index 98d5e82..c1003b3 100644 --- a/lib/src/ui/pages/shared/shared_code_view.dart +++ b/lib/src/ui/pages/shared/shared_code_view.dart @@ -14,6 +14,7 @@ class NamedCodeScaffold extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( + drawer: Drawer(), appBar: AppBar( centerTitle: false, title: Text(title), @@ -37,19 +38,15 @@ class SharedCodeView extends StatefulWidget { State createState() => _SharedCodeViewState(); } -class _SharedCodeViewState extends State - with SingleTickerProviderStateMixin { - late final TabController _tabController; +class _SharedCodeViewState extends State { final _index = ValueNotifier(0); @override void initState() { super.initState(); - _tabController = TabController(length: widget.items.length, vsync: this); } @override void dispose() { - _tabController.dispose(); super.dispose(); } @@ -64,7 +61,6 @@ class _SharedCodeViewState extends State index: _index, onTap: (value) { _index.value = value; - _tabController.animateTo(value); }, ), ValueListenableBuilder( diff --git a/lib/src/ui/theme.dart b/lib/src/ui/theme.dart index 119fd8e..aced80b 100644 --- a/lib/src/ui/theme.dart +++ b/lib/src/ui/theme.dart @@ -1,26 +1,35 @@ import 'package:dreambook/src/utils/kv.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'theme.g.dart'; ThemeData appTheme([Brightness brightness = Brightness.light]) { const primary = Colors.cyan; - const cupertinoPrimary = CupertinoColors.systemTeal; + final colorScheme = + ColorScheme.fromSeed(seedColor: primary, brightness: brightness); return ThemeData( - colorScheme: - ColorScheme.fromSeed(seedColor: primary, brightness: brightness), - splashFactory: InkSparkle.splashFactory, + colorScheme: colorScheme, + splashFactory: _platformFactory, cupertinoOverrideTheme: CupertinoThemeData( brightness: brightness, - primaryColor: cupertinoPrimary, + primaryColor: colorScheme.primary, applyThemeToAll: true, - textTheme: const CupertinoTextThemeData(primaryColor: cupertinoPrimary), + textTheme: CupertinoTextThemeData(primaryColor: colorScheme.primary), ), useMaterial3: true, ); } +InteractiveInkFeatureFactory get _platformFactory { + if (kIsWeb) { + return InkRipple.splashFactory; + } else { + return InkSparkle.splashFactory; + } +} + @riverpod class ThemeModeData extends _$ThemeModeData { @override diff --git a/pubspec.yaml b/pubspec.yaml index 0ea52dd..40aa78b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.3+4 +version: 1.0.4+5 environment: sdk: '>=3.1.2 <4.0.0'