1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00
This commit is contained in:
Brett Morgan
2022-05-11 12:48:11 -07:00
committed by GitHub
parent fb00d0a102
commit ccd68f34e2
242 changed files with 1719 additions and 1430 deletions

View File

@@ -6,6 +6,7 @@ import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
// ignore: depend_on_referenced_packages
import 'package:window_size/window_size.dart';
import 'src/basics/01_animated_container.dart';

View File

@@ -15,7 +15,7 @@ class AnimatedContainerDemo extends StatefulWidget {
static String routeName = '/basics/01_animated_container';
@override
_AnimatedContainerDemoState createState() => _AnimatedContainerDemoState();
State<AnimatedContainerDemo> createState() => _AnimatedContainerDemoState();
}
class _AnimatedContainerDemoState extends State<AnimatedContainerDemo> {

View File

@@ -9,7 +9,7 @@ class AnimationControllerDemo extends StatefulWidget {
static const String routeName = '/basics/animation_controller';
@override
_AnimationControllerDemoState createState() =>
State<AnimationControllerDemo> createState() =>
_AnimationControllerDemoState();
}

View File

@@ -9,7 +9,7 @@ class TweenDemo extends StatefulWidget {
static const String routeName = '/basics/tweens';
@override
_TweenDemoState createState() => _TweenDemoState();
State<TweenDemo> createState() => _TweenDemoState();
}
class _TweenDemoState extends State<TweenDemo>

View File

@@ -9,7 +9,7 @@ class AnimatedBuilderDemo extends StatefulWidget {
static const String routeName = '/basics/animated_builder';
@override
_AnimatedBuilderDemoState createState() => _AnimatedBuilderDemoState();
State<AnimatedBuilderDemo> createState() => _AnimatedBuilderDemoState();
}
class _AnimatedBuilderDemoState extends State<AnimatedBuilderDemo>

View File

@@ -20,7 +20,7 @@ class CustomTweenDemo extends StatefulWidget {
static const String routeName = '/basics/custom_tweens';
@override
_CustomTweenDemoState createState() => _CustomTweenDemoState();
State<CustomTweenDemo> createState() => _CustomTweenDemoState();
}
class _CustomTweenDemoState extends State<CustomTweenDemo>
@@ -51,11 +51,6 @@ class _CustomTweenDemoState extends State<CustomTweenDemo>
title: const Text('Custom Tween'),
actions: [
MaterialButton(
child: Text(
controller.status == AnimationStatus.completed
? 'Delete Essay'
: 'Write Essay',
),
textColor: Colors.white,
onPressed: () {
if (controller.status == AnimationStatus.completed) {
@@ -68,6 +63,11 @@ class _CustomTweenDemoState extends State<CustomTweenDemo>
});
}
},
child: Text(
controller.status == AnimationStatus.completed
? 'Delete Essay'
: 'Write Essay',
),
),
],
),

View File

@@ -9,7 +9,7 @@ class TweenSequenceDemo extends StatefulWidget {
static const String routeName = '/basics/chaining_tweens';
@override
_TweenSequenceDemoState createState() => _TweenSequenceDemoState();
State<TweenSequenceDemo> createState() => _TweenSequenceDemoState();
}
class _TweenSequenceDemoState extends State<TweenSequenceDemo>

View File

@@ -11,7 +11,7 @@ class FadeTransitionDemo extends StatefulWidget {
static const String routeName = '/basics/fade_transition';
@override
_FadeTransitionDemoState createState() => _FadeTransitionDemoState();
State<FadeTransitionDemo> createState() => _FadeTransitionDemoState();
}
class _FadeTransitionDemoState extends State<FadeTransitionDemo>

View File

@@ -9,7 +9,7 @@ class AnimatedListDemo extends StatefulWidget {
static String routeName = '/misc/animated_list';
@override
_AnimatedListDemoState createState() => _AnimatedListDemoState();
State<AnimatedListDemo> createState() => _AnimatedListDemoState();
}
class _AnimatedListDemoState extends State<AnimatedListDemo> {

View File

@@ -11,7 +11,7 @@ class AnimatedPositionedDemo extends StatefulWidget {
static String routeName = '/basics/09_animated_positioned';
@override
_AnimatedPositionedDemoState createState() => _AnimatedPositionedDemoState();
State<AnimatedPositionedDemo> createState() => _AnimatedPositionedDemoState();
}
class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
@@ -62,6 +62,7 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
alignment: Alignment.center,
width: 150,
height: 50,
color: Theme.of(context).primaryColor,
child: Text(
'Click Me',
style: TextStyle(
@@ -69,7 +70,6 @@ class _AnimatedPositionedDemoState extends State<AnimatedPositionedDemo> {
Theme.of(context).buttonTheme.colorScheme!.onPrimary,
),
),
color: Theme.of(context).primaryColor,
),
),
),

View File

@@ -27,7 +27,7 @@ class AnimatedSwitcherDemo extends StatefulWidget {
static String routeName = '/basics/10_animated_switcher';
@override
_AnimatedSwitcherDemoState createState() => _AnimatedSwitcherDemoState();
State<AnimatedSwitcherDemo> createState() => _AnimatedSwitcherDemoState();
}
class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {
@@ -67,8 +67,8 @@ class _AnimatedSwitcherDemoState extends State<AnimatedSwitcherDemo> {
duration: const Duration(seconds: 1),
child: container,
transitionBuilder: (child, animation) => ScaleTransition(
child: child,
scale: animation,
child: child,
),
),
),

View File

@@ -10,7 +10,7 @@ class CardSwipeDemo extends StatefulWidget {
static String routeName = '/misc/card_swipe';
@override
_CardSwipeDemoState createState() => _CardSwipeDemoState();
State<CardSwipeDemo> createState() => _CardSwipeDemoState();
}
class _CardSwipeDemoState extends State<CardSwipeDemo> {
@@ -105,7 +105,7 @@ class SwipeableCard extends StatefulWidget {
: super(key: key);
@override
_SwipeableCardState createState() => _SwipeableCardState();
State<SwipeableCard> createState() => _SwipeableCardState();
}
class _SwipeableCardState extends State<SwipeableCard>

View File

@@ -49,7 +49,7 @@ class Carousel extends StatefulWidget {
const Carousel({Key? key, required this.itemBuilder}) : super(key: key);
@override
_CarouselState createState() => _CarouselState();
State<Carousel> createState() => _CarouselState();
}
class _CarouselState extends State<Carousel> {

View File

@@ -10,7 +10,7 @@ class CurvedAnimationDemo extends StatefulWidget {
static const String routeName = '/misc/curved_animation';
@override
_CurvedAnimationDemoState createState() => _CurvedAnimationDemoState();
State<CurvedAnimationDemo> createState() => _CurvedAnimationDemoState();
}
class CurveChoice {

View File

@@ -24,7 +24,7 @@ class ExpandCardDemo extends StatelessWidget {
class ExpandCard extends StatefulWidget {
const ExpandCard({Key? key}) : super(key: key);
@override
_ExpandCardState createState() => _ExpandCardState();
State<ExpandCard> createState() => _ExpandCardState();
}
class _ExpandCardState extends State<ExpandCard>

View File

@@ -31,7 +31,7 @@ class DraggableCard extends StatefulWidget {
final Widget child;
@override
_DraggableCardState createState() => _DraggableCardState();
State<DraggableCard> createState() => _DraggableCardState();
}
class _DraggableCardState extends State<DraggableCard>

View File

@@ -9,10 +9,10 @@ class RepeatingAnimationDemo extends StatefulWidget {
static String routeName = '/misc/repeating_animation';
@override
RepeatingAnimationDemoState createState() => RepeatingAnimationDemoState();
State<RepeatingAnimationDemo> createState() => _RepeatingAnimationDemoState();
}
class RepeatingAnimationDemoState extends State<RepeatingAnimationDemo>
class _RepeatingAnimationDemoState extends State<RepeatingAnimationDemo>
with SingleTickerProviderStateMixin {
late final AnimationController _controller;
late final Animation<BorderRadius?> _borderRadius;

View File

@@ -6,6 +6,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
window_size
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST
)
set(PLUGIN_BUNDLED_LIBRARIES)
foreach(plugin ${FLUTTER_PLUGIN_LIST})
@@ -14,3 +17,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
endforeach(plugin)
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
endforeach(ffi_plugin)

View File

@@ -19,4 +19,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 6eac6b3292e5142cfc23bdeb71848a40ec51c14c
COCOAPODS: 1.11.2
COCOAPODS: 1.11.3

View File

@@ -68,7 +68,7 @@ packages:
name: flutter_lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
version: "2.0.1"
flutter_test:
dependency: "direct dev"
description: flutter
@@ -80,7 +80,7 @@ packages:
name: lints
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
version: "2.0.0"
matcher:
dependency: transitive
description:
@@ -173,4 +173,4 @@ packages:
source: git
version: "0.1.0"
sdks:
dart: ">=2.17.0-0 <3.0.0"
dart: ">=2.17.0-206.0.dev <3.0.0"

View File

@@ -4,7 +4,7 @@ version: 1.0.0+1
publish_to: none
environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.17.0-0 <3.0.0"
dependencies:
flutter:
@@ -14,7 +14,7 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter_lints: ^2.0.1
# plugin is not yet part of the flutter framework
window_size: