Skip to content

Commit

Permalink
1.0.4+5
Browse files Browse the repository at this point in the history
  • Loading branch information
laiiihz committed Oct 30, 2023
1 parent f251817 commit 0a1dee3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion lib/src/ui/pages/shared/code_space/code_space.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
8 changes: 2 additions & 6 deletions lib/src/ui/pages/shared/shared_code_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class NamedCodeScaffold extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: Drawer(),
appBar: AppBar(
centerTitle: false,
title: Text(title),
Expand All @@ -37,19 +38,15 @@ class SharedCodeView extends StatefulWidget {
State<SharedCodeView> createState() => _SharedCodeViewState();
}

class _SharedCodeViewState extends State<SharedCodeView>
with SingleTickerProviderStateMixin {
late final TabController _tabController;
class _SharedCodeViewState extends State<SharedCodeView> {
final _index = ValueNotifier<int>(0);
@override
void initState() {
super.initState();
_tabController = TabController(length: widget.items.length, vsync: this);
}

@override
void dispose() {
_tabController.dispose();
super.dispose();
}

Expand All @@ -64,7 +61,6 @@ class _SharedCodeViewState extends State<SharedCodeView>
index: _index,
onTap: (value) {
_index.value = value;
_tabController.animateTo(value);
},
),
ValueListenableBuilder<int>(
Expand Down
21 changes: 15 additions & 6 deletions lib/src/ui/theme.dart
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 0a1dee3

Please sign in to comment.