mirror of
https://github.com/DefinedNet/mobile_nebula.git
synced 2025-09-07 19:46:06 +00:00
TODO: - [x] Address Android, which this probably breaks. Previously the back button was taking up all the room in the title bar, this fixes it so that we can see titles again. It also truncates site names so they stay to one line. |Before|After| |---|---| ||| |Before|After| |---|---| ||| |Before|After| |---|---| ||| |Before|After| |---|---| ||| A few other "After" screenshots: |Logs|DN enrollment| |---|---| |||
32 lines
933 B
Dart
32 lines
933 B
Dart
import 'dart:io';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/svg.dart';
|
|
|
|
import '../models/Site.dart';
|
|
|
|
class SiteTitle extends StatelessWidget {
|
|
const SiteTitle({Key? key, required this.site}) : super(key: key);
|
|
|
|
final Site site;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final dnIcon =
|
|
Theme.of(context).brightness == Brightness.dark ? 'images/dn-logo-dark.svg' : 'images/dn-logo-light.svg';
|
|
|
|
return IntrinsicWidth(
|
|
child: Padding(
|
|
padding: EdgeInsets.symmetric(horizontal: 16),
|
|
child: Row(children: [
|
|
site.managed
|
|
? Padding(padding: EdgeInsets.only(right: 10), child: SvgPicture.asset(dnIcon, width: 12))
|
|
: Container(),
|
|
Expanded(
|
|
child: Text(
|
|
site.name,
|
|
overflow: TextOverflow.ellipsis,
|
|
))
|
|
])));
|
|
}
|
|
}
|