Skip to content

Commit

Permalink
61: adds vertical() method to all switches
Browse files Browse the repository at this point in the history
  • Loading branch information
maeddin committed Aug 12, 2024
1 parent dfbdbc1 commit a160450
Show file tree
Hide file tree
Showing 14 changed files with 413 additions and 343 deletions.
2 changes: 1 addition & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
4 changes: 2 additions & 2 deletions example/lib/crazy_switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class _CrazySwitchState extends State<CrazySwitch> {
return CustomAnimatedToggleSwitch(
current: current,
spacing: 36.0,
values: [false, true],
values: const [false, true],
animationDuration: const Duration(milliseconds: 350),
animationCurve: Curves.bounceOut,
iconBuilder: (context, local, global) => const SizedBox(),
Expand All @@ -41,7 +41,7 @@ class _CrazySwitchState extends State<CrazySwitch> {
return Container(
alignment: Alignment.center,
decoration:
BoxDecoration(color: Colors.white, shape: BoxShape.circle),
const BoxDecoration(color: Colors.white, shape: BoxShape.circle),
child: Container(
width: innerIndicatorSize * 0.4 +
global.position * innerIndicatorSize * 0.6,
Expand Down
8 changes: 4 additions & 4 deletions example/lib/load_switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class _LoadSwitchState extends State<LoadSwitch> {
const borderWidth = 5.0;
return CustomAnimatedToggleSwitch(
height: height,
indicatorSize: Size.square(height),
indicatorSize: const Size.square(height),
current: value,
values: [false, true],
values: const [false, true],
onChanged: (newValue) {
setState(() => value = newValue);
return Future.delayed(const Duration(seconds: 2));
Expand All @@ -42,8 +42,8 @@ class _LoadSwitchState extends State<LoadSwitch> {
return Stack(
fit: StackFit.expand,
children: [
Padding(
padding: const EdgeInsets.all(borderWidth),
const Padding(
padding: EdgeInsets.all(borderWidth),
child: DecoratedBox(
decoration: BoxDecoration(
shape: BoxShape.circle, color: Colors.white)),
Expand Down
Loading

0 comments on commit a160450

Please sign in to comment.