DEV Community

kyorohiro (kiyohiro kawamura)
kyorohiro (kiyohiro kawamura)

Posted on

Dart x Flutter MokuMoku Live Coding 04/10/2020 AM

I 'm makeing something with Dart and Flutter while doing live coding on 04/10/2020 now

  • not performance coding , not speed coding

Live Coding Address

https://youtu.be/_qVvJBwieNY

Code

https://github.com/kyorohiro/mokumoku03

What is mokumoku

For the time being, people who are interested in a certain theme gather and do their own work. Just that.

# What is making

Image uploader at dart x flutter x firebase

History

  • Dart x Flutter MokuMoku Live Stream 05/09/2020

https://dev.to/kyorohiro/dart-x-flutter-mokumoku-live-stream-2020-09-05-30oa

  • Dart x Flutter MokuMoku Live Stream 12/09/2020

https://dev.to/kyorohiro/todo-dart-x-flutter-mokumoku-live-coding-12-09-2020-bbm

  • Dart x Flutter MokuMoku Live Stream 19/09/2020

https://dev.to/kyorohiro/dart-x-flutter-mokumoku-live-coding-19-09-2020-iec

  • Dart x Flutter MokuMoku Live Stream 26/09/2020

https://dev.to/kyorohiro/dart-x-flutter-mokumoku-live-coding-26-09-2020-1icb

  • Dart x Flutter MokuMoku Live Stream 04/10/2020

now

Result

Alt Text

Alt Text

Alt Text

Alt Text

Alt Text

..

Todo

..

know-how

Write To In Discussion

  • How to use http query paramter at flutter router

Top comments (1)

Collapse
 
kyorohiro profile image
kyorohiro (kiyohiro kawamura)

How to use http query paramter at flutter router

//
// use http query paramter at flutter rpouter
//

import 'package:flutter/material.dart';

main() {
  runApp(MaterialApp(
      onGenerateRoute: (RouteSettings settings) {
        var _uri = Uri.parse(settings.name);
        String path = _uri.path;
        Map<String,String> params = _uri.queryParameters;
        if(path.startsWith("/image")) {
          return MaterialPageRoute(
            settings: RouteSettings(
              name:"/image?uuid=${params['uuid']}"
            ),
            builder: (context) {
              return ImagePage(params["uuid"]);
            },
          );
        } else {
          return null;
        }
      },
      routes: {
        "/home" :(context)=> HomePage()
      } ,
      initialRoute: "/home",
  ));
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(child: RaisedButton(
        child: Text("move to /image?uuid=xxxx"),
        onPressed: () {
          Navigator.pushNamed(context, "/image?uuid=xxxx");
        },),
    ));
  }
}
class ImagePage extends StatelessWidget{
  String imageName;
  ImagePage(this.imageName){}
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(child: Text("${imageName}"),),
    );
  }
}