mirror of
https://github.com/Iconica-Development/flutter_start.git
synced 2025-05-18 10:03:45 +02:00
Add BSD-3-Clause license
This commit is contained in:
parent
d9f1568f70
commit
aa2595efbf
4 changed files with 38 additions and 0 deletions
9
LICENSE
Normal file
9
LICENSE
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Copyright (c) 2024 Iconica, All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -5,6 +5,14 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
|
/// Builds a screen with a fade transition.
|
||||||
|
///
|
||||||
|
/// The [context] parameter is the [BuildContext] in which this widget is built.
|
||||||
|
/// The [state] parameter is the [GoRouterState] that contains
|
||||||
|
/// the current routing state.
|
||||||
|
/// The [child] parameter is the widget that will be displayed on the screen.
|
||||||
|
///
|
||||||
|
/// Returns a [CustomTransitionPage] with a fade transition.
|
||||||
CustomTransitionPage buildScreenWithFadeTransition<T>({
|
CustomTransitionPage buildScreenWithFadeTransition<T>({
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
required GoRouterState state,
|
required GoRouterState state,
|
||||||
|
@ -17,6 +25,14 @@ CustomTransitionPage buildScreenWithFadeTransition<T>({
|
||||||
FadeTransition(opacity: animation, child: child),
|
FadeTransition(opacity: animation, child: child),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/// Builds a screen without any transition.
|
||||||
|
///
|
||||||
|
/// The [context] parameter is the [BuildContext] in which this widget is built.
|
||||||
|
/// The [state] parameter is the [GoRouterState] that contains
|
||||||
|
/// the current routing state.
|
||||||
|
/// The [child] parameter is the widget that will be displayed on the screen.
|
||||||
|
///
|
||||||
|
/// Returns a [CustomTransitionPage] without any transition.
|
||||||
CustomTransitionPage buildScreenWithoutTransition<T>({
|
CustomTransitionPage buildScreenWithoutTransition<T>({
|
||||||
required BuildContext context,
|
required BuildContext context,
|
||||||
required GoRouterState state,
|
required GoRouterState state,
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_introduction/flutter_introduction.dart';
|
import 'package:flutter_introduction/flutter_introduction.dart';
|
||||||
|
|
||||||
|
/// An immutable class that represents the configuration for
|
||||||
|
/// starting a user story.
|
||||||
@immutable
|
@immutable
|
||||||
class StartUserStoryConfiguration {
|
class StartUserStoryConfiguration {
|
||||||
|
/// Creates a new instance of [StartUserStoryConfiguration].
|
||||||
const StartUserStoryConfiguration({
|
const StartUserStoryConfiguration({
|
||||||
this.splashScreenBuilder,
|
this.splashScreenBuilder,
|
||||||
this.introductionBuilder,
|
this.introductionBuilder,
|
||||||
|
|
|
@ -3,7 +3,17 @@ import 'dart:convert';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:package_info_plus/package_info_plus.dart';
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
|
|
||||||
|
/// A service class to check if a killswitch is active for the current app.
|
||||||
class KillswitchService {
|
class KillswitchService {
|
||||||
|
/// Checks if the killswitch is active for the current app.
|
||||||
|
///
|
||||||
|
/// It makes a GET request to a specific URL with the app
|
||||||
|
/// name as a query parameter.
|
||||||
|
/// If the request fails or times out after 5 seconds,
|
||||||
|
/// it defaults to returning 'false'.
|
||||||
|
///
|
||||||
|
/// Returns a [Future] that completes with 'true' if the killswitch is active,
|
||||||
|
/// and 'false' otherwise.
|
||||||
Future<bool> isKillswitchActive() async {
|
Future<bool> isKillswitchActive() async {
|
||||||
var packageInfo = await PackageInfo.fromPlatform();
|
var packageInfo = await PackageInfo.fromPlatform();
|
||||||
var appName = packageInfo.appName;
|
var appName = packageInfo.appName;
|
||||||
|
|
Loading…
Reference in a new issue