Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connections and Wallpaper: increase radii #279

Merged
merged 1 commit into from
Feb 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"appTitle": "Ubuntu Einstellungen",
"searchHint": "Suche...",
"connected": "Verbunden",
"connected": "verbunden",
"disonnected": "Nicht verbunden",
"yes": "Ja",
"no": "Nein",
Expand Down Expand Up @@ -73,6 +73,7 @@
"screenLockPageTitle": "Bildschirmsperre",
"diagnosisPageTitle": "Fehlerdiagnose",
"connectionsPageTitle": "Verbindungen",
"connectionsPageHeadline": "Sichtbare Netzwerke",
"wifiPageTitle": "Wi-Fi",
"ethernetPageTitle": "Ethernet",
"cellularPageTitle": "Mobilfunk",
Expand Down
1 change: 1 addition & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"screenLockPageTitle": "Screen Lock",
"diagnosisPageTitle": "Diagnostics",
"connectionsPageTitle": "Connections",
"connectionsPageHeadline": "Visible networks",
"wifiPageTitle": "Wi-Fi",
"ethernetPageTitle": "Ethernet",
"cellularPageTitle": "Cellular",
Expand Down
30 changes: 9 additions & 21 deletions lib/view/pages/connections/connections_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:yaru_widgets/yaru_widgets.dart';

import 'models/wifi_model.dart';

class ConnectionsPage extends StatefulWidget {
class ConnectionsPage extends StatelessWidget {
static Widget create(BuildContext context) {
final service = Provider.of<NetworkManagerClient>(context, listen: false);
return ChangeNotifierProvider<WifiModel>(
Expand All @@ -30,20 +30,6 @@ class ConnectionsPage extends StatefulWidget {

const ConnectionsPage({Key? key}) : super(key: key);

@override
State<ConnectionsPage> createState() => _ConnectionsPageState();
}

class _ConnectionsPageState extends State<ConnectionsPage>
with TickerProviderStateMixin {
late TabController tabController;

@override
void initState() {
tabController = TabController(length: 3, vsync: this);
super.initState();
}

@override
Widget build(BuildContext context) {
final wifiModel = context.watch<WifiModel>();
Expand All @@ -59,12 +45,14 @@ class _ConnectionsPageState extends State<ConnectionsPage>
wifiModel.isWifiDeviceAvailable
? const WifiDevicesContent()
: const WifiAdaptorNotFound(),
Column(
children: const [Text('Ethernet')],
),
Column(
children: const [Text('Cellular')],
)
const YaruPage(children: [
// TODO: Implement Ethernet page
Text('Ethernet - Please implement 🥲️'),
]),
const YaruPage(children: [
// TODO: Implement Cellular page
Text('Cellular - Please implement 🥲️'),
]),
], width: kDefaultWidth);
}
}
7 changes: 5 additions & 2 deletions lib/view/pages/connections/wifi_content.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:settings/constants.dart';
import 'package:settings/l10n/l10n.dart';
import 'package:yaru_icons/yaru_icons.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

Expand All @@ -25,7 +26,9 @@ class WifiDevicesContent extends StatelessWidget {
actionWidget: Row(
children: [
Text(
wifiModel.isWifiEnabled ? 'connected' : 'disconnected',
wifiModel.isWifiEnabled
? context.l10n.connected
: context.l10n.disonnected,
style: TextStyle(
color: Theme.of(context)
.colorScheme
Expand All @@ -44,7 +47,7 @@ class WifiDevicesContent extends StatelessWidget {
builder: (_, __) {
return YaruSection(
width: kDefaultWidth,
headline: 'Visible Networks',
headline: context.l10n.connectionsPageHeadline,
children: [
for (final accessPoint in wifiDevice.accesPoints)
AccessPointTile(
Expand Down
21 changes: 18 additions & 3 deletions lib/view/pages/wallpaper/wallpaper_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,30 @@ class _AddWallpaperTile extends StatelessWidget {
final model = context.read<WallpaperModel>();
return Padding(
padding: const EdgeInsets.all(6.0),
child: OutlinedButton(
onPressed: () async {
child: InkWell(
borderRadius: BorderRadius.circular(8),
onTap: () async {
final picPath = await openFilePicker(context);
if (null != picPath) {
model.pictureUri = picPath;
model.copyToCollection(picPath);
}
},
child: const Icon(YaruIcons.plus),
child: Container(
decoration: BoxDecoration(
border: Border.all(
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.15),
),
borderRadius: BorderRadius.circular(8),
),
child: Padding(
padding: const EdgeInsets.all(6.0),
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: const Icon(YaruIcons.plus),
),
),
),
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ packages:
description:
path: "."
ref: HEAD
resolved-ref: cd5058fe96f00615870af34f03c152ad19c4c42e
resolved-ref: "5148015afc952dbe0770aea4af44f7abaf921be8"
url: "https://github.com/ubuntu/yaru_widgets.dart"
source: git
version: "1.0.5"
Expand Down