mirror of
https://github.com/flutter/samples.git
synced 2026-05-18 04:48:02 +00:00
Migrate desktop_photo_search to top level (#1002)
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
// Copyright 2019 The Flutter team. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart' as url_launcher;
|
||||
|
||||
class PolicyDialog extends StatelessWidget {
|
||||
const PolicyDialog({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Terms & Conditions'),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
RichText(
|
||||
textAlign: TextAlign.left,
|
||||
text: TextSpan(
|
||||
text: '• ',
|
||||
style: const TextStyle(color: Colors.black, fontSize: 18),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: 'https://policies.google.com/terms',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold, color: Colors.lightBlue),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () async {
|
||||
const url = 'https://policies.google.com/terms';
|
||||
if (await url_launcher.canLaunch(url)) {
|
||||
await url_launcher.launch(url);
|
||||
}
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
RichText(
|
||||
textAlign: TextAlign.left,
|
||||
text: TextSpan(
|
||||
text: '• ',
|
||||
style: const TextStyle(color: Colors.black, fontSize: 18),
|
||||
children: [
|
||||
TextSpan(
|
||||
text: 'https://unsplash.com/terms',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold, color: Colors.lightBlue),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () async {
|
||||
const url = 'https://unsplash.com/terms';
|
||||
if (await url_launcher.canLaunch(url)) {
|
||||
await url_launcher.launch(url);
|
||||
}
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text('CLOSE'),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user