Basic Mobile App Framework
This commit is contained in:
15
web_native/lib/screens/gallery/components/body.dart
Normal file
15
web_native/lib/screens/gallery/components/body.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class Body extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: RaisedButton(
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(context, '/Upload');
|
||||
},
|
||||
child: Text('Page Two!'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
20
web_native/lib/screens/gallery/gallery-bloc.dart
Normal file
20
web_native/lib/screens/gallery/gallery-bloc.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'dart:async';
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:imagini/models/contact.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:imagini/bloc/bloc.dart';
|
||||
|
||||
class GalleryBloc extends Bloc {
|
||||
StreamSubscription _audioPlayerStateSubscription;
|
||||
|
||||
Stream<String> get example => _exampleSubject.stream;
|
||||
Sink<String> get exampleSink => _exampleSubject.sink;
|
||||
final StreamController<String> _exampleSubject = StreamController<String>();
|
||||
|
||||
GalleryBloc();
|
||||
|
||||
void dispose() {
|
||||
_exampleSubject.close();
|
||||
}
|
||||
}
|
||||
45
web_native/lib/screens/gallery/galleryscreen.dart
Normal file
45
web_native/lib/screens/gallery/galleryscreen.dart
Normal file
@@ -0,0 +1,45 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:imagini/screens/gallery/components/body.dart';
|
||||
import 'package:imagini/screens/gallery/gallery-bloc.dart';
|
||||
import 'package:imagini/bloc/bloc-prov.dart';
|
||||
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
|
||||
|
||||
|
||||
class GalleryScreen extends StatefulWidget {
|
||||
@override
|
||||
_GalleryScreenState createState() => _GalleryScreenState();
|
||||
}
|
||||
|
||||
class _GalleryScreenState extends State<GalleryScreen> {
|
||||
GalleryBloc exampleBloc;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
exampleBloc = GalleryBloc();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
exampleBloc.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
bloc: exampleBloc,
|
||||
child: PlatformScaffold(
|
||||
appBar: PlatformAppBar(
|
||||
title: Text('Gallerys'),
|
||||
cupertino: (_, __) => CupertinoNavigationBarData(
|
||||
// Issue with cupertino where a bar with no transparency
|
||||
// will push the list down. Adding some alpha value fixes it (in a hacky way)
|
||||
backgroundColor: Colors.lightGreen.withAlpha(254),
|
||||
),
|
||||
),
|
||||
body: Body(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user